diff --git a/src/Config/_GrampsConfigKeys.py b/src/Config/_GrampsConfigKeys.py index 2e2b2f1d6..c186d1f77 100644 --- a/src/Config/_GrampsConfigKeys.py +++ b/src/Config/_GrampsConfigKeys.py @@ -174,6 +174,7 @@ PRIVATE_GIVEN_TEXT = ('preferences', 'private-given-text', 2) PRIVATE_RECORD_TEXT = ('preferences', 'private-record-text', 2) RELATION_DISPLAY_THEME= ('preferences', 'relation-display-theme', 2) INVALID_DATE_FORMAT = ('preferences', 'invalid-date-format', 2) +FULLSCREEN = ('interface', 'fullscreen', 0) default_value = { DEFAULT_SOURCE : False, @@ -301,4 +302,5 @@ default_value = { PRIVATE_RECORD_TEXT : "[%s]" % _("Private Record"), RELATION_DISPLAY_THEME: "CLASSIC", INVALID_DATE_FORMAT : "%s", + FULLSCREEN : False, } diff --git a/src/ViewManager.py b/src/ViewManager.py index 9eb10dc75..e5995b07d 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -114,6 +114,7 @@ UIDEFAULT = ''' + @@ -223,6 +224,7 @@ class ViewManager: self.show_sidebar = Config.get(Config.VIEW) self.show_toolbar = Config.get(Config.TOOLBAR_ON) self.show_filter = Config.get(Config.FILTER) + self.fullscreen = Config.get(Config.FULLSCREEN) self.__pmgr = PluginManager.get_instance() @@ -302,6 +304,9 @@ class ViewManager: else: self.toolbar.hide() + if self.fullscreen: + self.window.fullscreen() + # Showing the main window is deferred so that # ArgHandler can work without it always shown # But we need to realize it here to have gtk.gdk.window handy @@ -460,6 +465,8 @@ class ViewManager: self.show_toolbar ), ('Filter', None, _('_Filter Sidebar'), None, None, filter_toggle, self.show_filter), + ('Fullscreen', None, _('F_ull Screen'), "F11", None, + self.fullscreen_toggle, self.fullscreen), ] self._undo_action_list = [ @@ -765,6 +772,19 @@ class ViewManager: Config.set(Config.TOOLBAR_ON, False) Config.sync() + def fullscreen_toggle(self, obj): + """ + Set the main Granps window fullscreen based on the value of the + toggle button. Save the setting in the config file. + """ + if obj.get_active(): + self.window.fullscreen() + Config.set(Config.FULLSCREEN, True) + else: + self.window.unfullscreen() + Config.set(Config.FULLSCREEN, False) + Config.sync() + def register_view(self, view): """ Allow other objects to register a view with the View Manager