Do not require a restart to change the show layout buttons setting

This commit is contained in:
Kovid Goyal 2023-12-24 09:25:40 +05:30
parent 11feacf4f5
commit 8c45539904
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 4 additions and 4 deletions

View File

@ -391,7 +391,6 @@ class CentralContainer(QWidget):
return False
gui.book_details.vertical = is_wide
self.layout = layout
gui.place_layout_buttons()
self.write_settings()
self.relayout()
return True

View File

@ -498,6 +498,7 @@ class LayoutMixin: # {{{
for button in reversed(self.layout_buttons):
self.status_bar.insertPermanentWidget(1, button)
self.layout_button.setMenu(LayoutMenu(self))
self.layout_button.setVisible(not gprefs['show_layout_buttons'])
def init_layout_mixin(self):
self.vl_tabs = VLTabs(self)
@ -549,7 +550,6 @@ class LayoutMixin: # {{{
b.setToolTip(_(
'Show and hide various parts of the calibre main window'))
self.status_bar.addPermanentWidget(b)
b.setVisible(not gprefs['show_layout_buttons'])
self.status_bar.addPermanentWidget(self.jobs_button)
self.setStatusBar(self.status_bar)
self.status_bar.update_label.linkActivated.connect(self.update_link_clicked)

View File

@ -582,7 +582,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
r('book_list_tooltips', gprefs)
r('dnd_merge', gprefs)
r('wrap_toolbar_text', gprefs, restart_required=True)
r('show_layout_buttons', gprefs, restart_required=True)
r('show_layout_buttons', gprefs)
r('row_numbers_in_book_list', gprefs)
r('tag_browser_old_look', gprefs)
r('tag_browser_hide_empty_categories', gprefs)
@ -1182,6 +1182,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
def refresh_gui(self, gui):
gui.book_details.book_info.refresh_css()
gui.place_layout_buttons()
m = gui.library_view.model()
m.update_db_prefs_cache()
m.beginResetModel(), m.endResetModel()

View File

@ -31,7 +31,7 @@
<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>
<string>Show &amp;layout buttons in the status bar</string>
</property>
</widget>
</item>