From f737f515babd1548e32237b300e32c62cbd919ed Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Apr 2025 08:56:18 +0530 Subject: [PATCH] Reduce the minimum width of the text search panel --- src/calibre/gui2/tweak_book/text_search.py | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/calibre/gui2/tweak_book/text_search.py b/src/calibre/gui2/tweak_book/text_search.py index 4011f25ed8..2ab5e95351 100644 --- a/src/calibre/gui2/tweak_book/text_search.py +++ b/src/calibre/gui2/tweak_book/text_search.py @@ -3,7 +3,7 @@ from lxml.etree import tostring -from qt.core import QCheckBox, QComboBox, QFont, QHBoxLayout, QIcon, QLabel, QPushButton, QSizePolicy, QVBoxLayout, QWidget, pyqtSignal +from qt.core import QCheckBox, QComboBox, QFont, QHBoxLayout, QIcon, QLabel, QSizePolicy, QToolButton, QVBoxLayout, QWidget, pyqtSignal from calibre import prepare_string_for_xml from calibre.gui2 import error_dialog @@ -111,24 +111,24 @@ class TextSearch(QWidget): h.addWidget(m) self.where_box = wb = WhereBox(self) h.addWidget(wb) + self.next_button = b = QToolButton(self) + b.setIcon(QIcon.ic('arrow-down.png')), b.setText(_('&Next')) + b.setToolTip(_('Find next match')) + h.addWidget(b) + self.prev_button = b = QToolButton(self) + b.setIcon(QIcon.ic('arrow-up.png')), b.setText(_('&Previous')) + b.setToolTip(_('Find previous match')) + h.addWidget(b) + connect_lambda(b.clicked, self, lambda self: self.do_search('up')) + + self.h3 = h = QHBoxLayout() + l.addLayout(h) self.cs = cs = QCheckBox(_('&Case sensitive')) h.addWidget(cs) self.da = da = QCheckBox(_('&Dot all')) da.setToolTip('

'+_("Make the '.' special character match any character at all, including a newline")) h.addWidget(da) - self.h3 = h = QHBoxLayout() - l.addLayout(h) - h.addStretch(10) - self.next_button = b = QPushButton(QIcon.ic('arrow-down.png'), _('&Next'), self) - b.setToolTip(_('Find next match')) - h.addWidget(b) - connect_lambda(b.clicked, self, lambda self: self.do_search('down')) - self.prev_button = b = QPushButton(QIcon.ic('arrow-up.png'), _('&Previous'), self) - b.setToolTip(_('Find previous match')) - h.addWidget(b) - connect_lambda(b.clicked, self, lambda self: self.do_search('up')) - state = tprefs.get('text_search_widget_state') self.state = state or {}