mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the saved search box a bit larger
This commit is contained in:
parent
7e6efbd326
commit
12707c9756
@ -7,18 +7,17 @@ __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
|||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
from PyQt5.Qt import (
|
||||||
|
QActionGroup, QCoreApplication, QFrame, QHBoxLayout, QIcon, QLabel, QLineEdit,
|
||||||
|
QMenu, QObject, QSizePolicy, Qt, QToolButton, QVBoxLayout, QWidget, pyqtSignal
|
||||||
|
)
|
||||||
|
|
||||||
from PyQt5.Qt import (QIcon, Qt, QWidget, QSize, QFrame,
|
from calibre import human_readable
|
||||||
pyqtSignal, QToolButton, QMenu, QLineEdit, QCoreApplication,
|
|
||||||
QObject, QVBoxLayout, QSizePolicy, QLabel, QHBoxLayout, QActionGroup)
|
|
||||||
|
|
||||||
|
|
||||||
from calibre.constants import __appname__
|
from calibre.constants import __appname__
|
||||||
from calibre.gui2.search_box import SearchBox2, SavedSearchBox
|
|
||||||
from calibre.gui2.bars import BarsManager
|
from calibre.gui2.bars import BarsManager
|
||||||
|
from calibre.gui2.search_box import SavedSearchBox, SearchBox2
|
||||||
from calibre.gui2.widgets2 import RightClickButton
|
from calibre.gui2.widgets2 import RightClickButton
|
||||||
from calibre.utils.config_base import tweaks
|
from calibre.utils.config_base import tweaks
|
||||||
from calibre import human_readable
|
|
||||||
from polyglot.builtins import unicode_type
|
from polyglot.builtins import unicode_type
|
||||||
|
|
||||||
|
|
||||||
@ -274,8 +273,6 @@ class SearchBar(QFrame): # {{{
|
|||||||
l.addWidget(x)
|
l.addWidget(x)
|
||||||
|
|
||||||
x = parent.saved_search = SavedSearchBox(self)
|
x = parent.saved_search = SavedSearchBox(self)
|
||||||
x.setMaximumSize(QSize(150, 16777215))
|
|
||||||
x.setMinimumContentsLength(10)
|
|
||||||
x.setObjectName("saved_search")
|
x.setObjectName("saved_search")
|
||||||
l.addWidget(x)
|
l.addWidget(x)
|
||||||
x.setVisible(tweaks['show_saved_search_box'])
|
x.setVisible(tweaks['show_saved_search_box'])
|
||||||
|
@ -342,9 +342,10 @@ class SavedSearchBox(QComboBox): # {{{
|
|||||||
self.setCompleter(completer)
|
self.setCompleter(completer)
|
||||||
|
|
||||||
self.setEditable(True)
|
self.setEditable(True)
|
||||||
|
self.setMaxVisibleItems(25)
|
||||||
self.setInsertPolicy(QComboBox.InsertPolicy.NoInsert)
|
self.setInsertPolicy(QComboBox.InsertPolicy.NoInsert)
|
||||||
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon)
|
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon)
|
||||||
self.setMinimumContentsLength(10)
|
self.setMinimumContentsLength(25)
|
||||||
self.tool_tip_text = self.toolTip()
|
self.tool_tip_text = self.toolTip()
|
||||||
|
|
||||||
def initialize(self, _search_box, colorize=False, help_text=_('Search')):
|
def initialize(self, _search_box, colorize=False, help_text=_('Search')):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user