Fix very long search strings causing main window to become wider than screen

This commit is contained in:
Kovid Goyal 2009-10-11 13:07:11 -06:00
parent 4978a030d8
commit 470f1aa4c9
2 changed files with 12 additions and 0 deletions

View File

@ -507,6 +507,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
self._calculated_available_height = min(max_available_height()-15,
self.height())
self.resize(self.width(), self._calculated_available_height)
self.search.setMaximumWidth(self.width()-150)
if config['autolaunch_server']:
@ -523,6 +524,11 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
self.scheduler.show_dialog)
self.location_view.setCurrentIndex(self.location_view.model().index(0))
def resizeEvent(self, ev):
MainWindow.resizeEvent(self, ev)
self.search.setMaximumWidth(self.width()-150)
def create_device_menu(self):
self._sync_menu = DeviceMenu(self)
self.action_sync.setMenu(self._sync_menu)

View File

@ -192,6 +192,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>700</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;p&gt;Search the list of books by title, author, publisher, tags, comments, etc.&lt;br&gt;&lt;br&gt;Words separated by spaces are ANDed</string>
</property>