From 470f1aa4c944e6819470d3806518a4b41718fdf4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 Oct 2009 13:07:11 -0600 Subject: [PATCH] Fix very long search strings causing main window to become wider than screen --- src/calibre/gui2/main.py | 6 ++++++ src/calibre/gui2/main.ui | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index b33bf3d619..14ee79d310 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -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) diff --git a/src/calibre/gui2/main.ui b/src/calibre/gui2/main.ui index 0be1df12df..8849c2fa07 100644 --- a/src/calibre/gui2/main.ui +++ b/src/calibre/gui2/main.ui @@ -192,6 +192,12 @@ 0 + + + 700 + 16777215 + + <p>Search the list of books by title, author, publisher, tags, comments, etc.<br><br>Words separated by spaces are ANDed