mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Restore tooltip for window layout preference
This commit is contained in:
parent
cfc21828d1
commit
3f35571f8d
@ -98,6 +98,16 @@ class ConfigWidgetInterface:
|
||||
pass
|
||||
|
||||
|
||||
def set_help_tips(gui_obj, tt):
|
||||
if tt:
|
||||
if not str(gui_obj.whatsThis()):
|
||||
gui_obj.setWhatsThis(tt)
|
||||
if not str(gui_obj.statusTip()):
|
||||
gui_obj.setStatusTip(tt)
|
||||
tt = '\n'.join(textwrap.wrap(tt, 70))
|
||||
gui_obj.setToolTip(tt)
|
||||
|
||||
|
||||
class Setting:
|
||||
|
||||
CHOICES_SEARCH_FLAGS = Qt.MatchFlag.MatchExactly | Qt.MatchFlag.MatchCaseSensitive
|
||||
@ -138,13 +148,7 @@ class Setting:
|
||||
if h:
|
||||
self.gui_obj.setToolTip(h)
|
||||
tt = str(self.gui_obj.toolTip())
|
||||
if tt:
|
||||
if not str(self.gui_obj.whatsThis()):
|
||||
self.gui_obj.setWhatsThis(tt)
|
||||
if not str(self.gui_obj.statusTip()):
|
||||
self.gui_obj.setStatusTip(tt)
|
||||
tt = '\n'.join(textwrap.wrap(tt, 70))
|
||||
self.gui_obj.setToolTip(tt)
|
||||
set_help_tips(self.gui_obj, tt)
|
||||
|
||||
def changed(self, *args):
|
||||
self.widget.changed_signal.emit()
|
||||
|
@ -32,7 +32,9 @@ from calibre.gui2.custom_column_widgets import get_field_list as em_get_field_li
|
||||
from calibre.gui2.dialogs.quickview import get_qv_field_list
|
||||
from calibre.gui2.dialogs.template_dialog import TemplateDialog
|
||||
from calibre.gui2.library.alternate_views import CM_TO_INCH, auto_height
|
||||
from calibre.gui2.preferences import ConfigWidgetBase, Setting, test_widget
|
||||
from calibre.gui2.preferences import (
|
||||
ConfigWidgetBase, Setting, set_help_tips, test_widget,
|
||||
)
|
||||
from calibre.gui2.preferences.coloring import EditRules
|
||||
from calibre.gui2.preferences.look_feel_ui import Ui_Form
|
||||
from calibre.gui2.widgets import BusyCursor
|
||||
@ -833,6 +835,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||
self.opt_gui_layout.addItem(_('Wide'), 'wide')
|
||||
self.opt_gui_layout.addItem(_('Narrow'), 'narrow')
|
||||
self.opt_gui_layout.currentIndexChanged.connect(self.changed_signal)
|
||||
set_help_tips(self.opt_gui_layout, config.help('gui_layout'))
|
||||
|
||||
def initial_tab_changed(self):
|
||||
self.sections_view.setCurrentRow(self.tabWidget.currentIndex())
|
||||
|
Loading…
x
Reference in New Issue
Block a user