diff --git a/gramps/gen/config.py b/gramps/gen/config.py index a6efe7191..074cef3ac 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -224,6 +224,8 @@ register('interface.lds-width', 600) register('interface.location-height', 250) register('interface.location-width', 600) register('interface.main-window-height', 500) +register('interface.main-window-horiz-position', 15) +register('interface.main-window-vert-position', 10) register('interface.main-window-width', 775) register('interface.mapservice', 'OpenStreetMap') register('interface.media-height', 450) diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py index 786026ef1..71ef2aea3 100644 --- a/gramps/gui/managedwindow.py +++ b/gramps/gui/managedwindow.py @@ -527,6 +527,7 @@ class ManagedWindow: """ Set the dimensions of the window """ + # self.width_key is set in the subclass, typically in its _local_init if self.width_key is not None: width = config.get(self.width_key) height = config.get(self.height_key) @@ -536,6 +537,7 @@ class ManagedWindow: """ Save the dimensions of the window to the config file """ + # self.width_key is set in the subclass, typically in its _local_init if self.width_key is not None: (width, height) = self.window.get_size() config.set(self.width_key, width) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 6a3422833..5a5ea1941 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -356,10 +356,13 @@ class ViewManager(CLIManager): """ width = config.get('interface.main-window-width') height = config.get('interface.main-window-height') + horiz_position = config.get('interface.main-window-horiz-position') + vert_position = config.get('interface.main-window-vert-position') self.window = Gtk.Window() self.window.set_icon_from_file(ICON) self.window.set_default_size(width, height) + self.window.move(horiz_position, vert_position) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.window.add(vbox) @@ -758,6 +761,10 @@ class ViewManager(CLIManager): (width, height) = self.window.get_size() config.set('interface.main-window-width', width) config.set('interface.main-window-height', height) + # save the current window position + (horiz_position, vert_position) = self.window.get_position() + config.set('interface.main-window-horiz-position', horiz_position) + config.set('interface.main-window-vert-position', vert_position) config.save() Gtk.main_quit()