Viewer: Add an option to keep the toolbar visible in full screen mode

This commit is contained in:
Kovid Goyal 2019-12-18 16:43:48 +05:30
parent 27e2b265e4
commit 783e1875d3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 8 additions and 1 deletions

View File

@ -232,6 +232,10 @@ class ActionsToolBar(ToolBar):
def update_visibility(self):
self.setVisible(bool(get_session_pref('show_actions_toolbar', default=False)))
@property
def visible_in_fullscreen(self):
return bool(get_session_pref('show_actions_toolbar_in_fullscreen', default=False))
def customize(self):
d = ConfigureToolBar(parent=self.parent())
if d.exec_() == d.Accepted:

View File

@ -210,7 +210,8 @@ class EbookViewer(MainWindow):
def set_full_screen(self, on):
if on:
self.maximized_at_last_fullscreen = self.isMaximized()
self.actions_toolbar.setVisible(False)
if not self.actions_toolbar.visible_in_fullscreen:
self.actions_toolbar.setVisible(False)
self.showFullScreen()
else:
self.actions_toolbar.update_visibility()

View File

@ -17,6 +17,7 @@ DEFAULTS = {
'remember_window_geometry': False,
'remember_last_read': True,
'show_actions_toolbar': False,
'show_actions_toolbar_in_fullscreen': False,
'save_annotations_in_ebook': True,
'singleinstance': False,
}
@ -50,6 +51,7 @@ def create_misc_panel(container, apply_func, cancel_func):
container.lastChild.append(E.span('\xa0'))
container.lastChild.append(
create_button(_('Customize toolbar'), action=ui_operations.customize_toolbar))
container.append(cb('show_actions_toolbar_in_fullscreen', _('Keep the toolbar in full screen mode (needs restart)')))
container.append(cb('remember_last_read', _('Remember current page when quitting')))
container.append(cb('save_annotations_in_ebook', _('Keep a copy of annotations/bookmarks in the e-book file, for easy sharing')))
container.append(cb('singleinstance', _('Allow only a single instance of the viewer (needs restart)')))