Add an option in Preferences->Look & feel to show individual layout buttons in the status bar, as was the case in calibre 2.x

Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
Kovid Goyal 2017-06-18 15:26:47 +05:30
commit 6a7b721dd3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 23 additions and 9 deletions

View File

@ -123,6 +123,7 @@ def create_defs():
defs['tag_browser_old_look'] = False defs['tag_browser_old_look'] = False
defs['tag_browser_hide_empty_categories'] = False defs['tag_browser_hide_empty_categories'] = False
defs['book_list_tooltips'] = True defs['book_list_tooltips'] = True
defs['show_layout_buttons'] = False
defs['bd_show_cover'] = True defs['bd_show_cover'] = True
defs['bd_overlay_cover_size'] = False defs['bd_overlay_cover_size'] = False
defs['tags_browser_category_icons'] = {} defs['tags_browser_category_icons'] = {}

View File

@ -587,15 +587,20 @@ class LayoutMixin(object): # {{{
QToolButton:checked { background: rgba(0, 0, 0, 25%); } QToolButton:checked { background: rgba(0, 0, 0, 25%); }
''') ''')
self.status_bar.addPermanentWidget(button) self.status_bar.addPermanentWidget(button)
self.layout_button = b = QToolButton(self) if gprefs['show_layout_buttons']:
b.setAutoRaise(True), b.setCursor(Qt.PointingHandCursor) for b in self.layout_buttons:
b.setPopupMode(b.InstantPopup) b.setVisible(True)
b.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) self.status_bar.addPermanentWidget(b)
b.setText(_('Layout')), b.setIcon(QIcon(I('config.png'))) else:
b.setMenu(LayoutMenu(self)) self.layout_button = b = QToolButton(self)
b.setToolTip(_( b.setAutoRaise(True), b.setCursor(Qt.PointingHandCursor)
'Show and hide various parts of the calibre main window')) b.setPopupMode(b.InstantPopup)
self.status_bar.addPermanentWidget(b) b.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
b.setText(_('Layout')), b.setIcon(QIcon(I('config.png')))
b.setMenu(LayoutMenu(self))
b.setToolTip(_(
'Show and hide various parts of the calibre main window'))
self.status_bar.addPermanentWidget(b)
self.status_bar.addPermanentWidget(self.jobs_button) self.status_bar.addPermanentWidget(self.jobs_button)
self.setStatusBar(self.status_bar) self.setStatusBar(self.status_bar)
self.status_bar.update_label.linkActivated.connect(self.update_link_clicked) self.status_bar.update_label.linkActivated.connect(self.update_link_clicked)

View File

@ -348,6 +348,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.opt_hidpi.setVisible(False), self.label_hidpi.setVisible(False) self.opt_hidpi.setVisible(False), self.label_hidpi.setVisible(False)
r('ui_style', gprefs, restart_required=True, choices=[(_('System default'), 'system'), (_('calibre style'), 'calibre')]) r('ui_style', gprefs, restart_required=True, choices=[(_('System default'), 'system'), (_('calibre style'), 'calibre')])
r('book_list_tooltips', gprefs) r('book_list_tooltips', gprefs)
r('show_layout_buttons', gprefs, restart_required=True)
r('row_numbers_in_book_list', gprefs) r('row_numbers_in_book_list', gprefs)
r('tag_browser_old_look', gprefs, restart_required=True) r('tag_browser_old_look', gprefs, restart_required=True)
r('tag_browser_hide_empty_categories', gprefs) r('tag_browser_hide_empty_categories', gprefs)

View File

@ -126,6 +126,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1">
<widget class="QCheckBox" name="opt_show_layout_buttons">
<property name="text">
<string>Show &amp;layout buttons in the status bar (needs restart)</string>
</property>
</widget>
</item>
<item row="12" column="0"> <item row="12" column="0">
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">