Restore correct window size in single window mode

This commit is contained in:
lovetox 2016-10-03 22:43:17 +02:00
parent a8586ec20a
commit 16fd31ca37
1 changed files with 5 additions and 8 deletions

View File

@ -996,19 +996,16 @@ class MessageWindowMgr(GObject.GObject):
"""
Resizes window according to config settings
"""
hpaned = gajim.config.get('roster_hpaned_position')
if self.mode in (self.ONE_MSG_WINDOW_ALWAYS,
self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER):
self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER):
size = (gajim.config.get('msgwin-width'),
gajim.config.get('msgwin-height'))
if self.mode == self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER:
parent_size = win.window.get_size()
# Need to add the size of the now visible paned handle, otherwise
# the saved width of the message window decreases by this amount
s = GObject.Value()
s.init(GObject.TYPE_INT)
win.parent_paned.style_get_property('handle-size', s)
handle_size = s.get_int()
size = (parent_size[0] + size[0] + handle_size, size[1])
handle_size = win.parent_paned.style_get_property('handle-size')
size = (hpaned + size[0] + handle_size, size[1])
elif self.mode == self.ONE_MSG_WINDOW_PERACCT:
size = (gajim.config.get_per('accounts', acct, 'msgwin-width'),
gajim.config.get_per('accounts', acct, 'msgwin-height'))
@ -1022,7 +1019,7 @@ class MessageWindowMgr(GObject.GObject):
return
win.resize(size[0], size[1])
if win.parent_paned:
win.parent_paned.set_position(gajim.config.get('roster_hpaned_position'))
win.parent_paned.set_position(hpaned)
def _position_window(self, win, acct, type_):
"""