From 4284eb95a7a5007b543667b562c0abc51706a7bb Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Sun, 5 Feb 2017 15:24:48 -0800 Subject: [PATCH] slightly enhance MW's setup_configs --- gramps/gui/managedwindow.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py index 8ca4ed750..7bd190b42 100644 --- a/gramps/gui/managedwindow.py +++ b/gramps/gui/managedwindow.py @@ -625,7 +625,8 @@ class ManagedWindow: def setup_configs(self, config_base, default_width, default_height, - default_horiz_position=None, default_vert_position=None): + default_horiz_position=None, default_vert_position=None, + p_width=None, p_height=None): # for fullscreen """ Helper method to setup the window's configuration settings @@ -636,13 +637,18 @@ class ManagedWindow: @param default_horiz_position, default_vert_position: if either is None then that position is centered on the parent, else explicitly set @type default_horiz_position, default_vert_position: int or None + @param p_width, p_height: the parent's width and height + @type p_width, p_height: int or None """ self.width_key = config_base + '-width' self.height_key = config_base + '-height' self.horiz_position_key = config_base + '-horiz-position' self.vert_position_key = config_base + '-vert-position' - (p_width, p_height) = self.parent_window.get_size() - (p_horiz, p_vert) = self.parent_window.get_position() + if p_width is None and p_height is None: # default case + (p_width, p_height) = self.parent_window.get_size() + (p_horiz, p_vert) = self.parent_window.get_position() + else: + p_horiz = p_vert = 0 # fullscreen if default_horiz_position is None: default_horiz_position = p_horiz + ((p_width - default_width) // 2) if default_vert_position is None: