From b74fdf1c8bc4d478582cfd67e6ca6bf2f660bceb Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 21 Feb 2016 11:07:04 +0100 Subject: [PATCH] add advanced option to put the roster on the right in single window mode. Fixes #4679 --- src/common/config.py | 1 + src/message_window.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/common/config.py b/src/common/config.py index 680c9e412..e70866587 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -164,6 +164,7 @@ class Config: 'roster_width': [ opt_int, 200 ], 'roster_height': [ opt_int, 400 ], 'roster_hpaned_position': [opt_int, 200], + 'roster_on_the_right': [opt_bool, False, _('Place the roster on the right in single window mode'), True], 'history_window_width': [ opt_int, 650 ], 'history_window_height': [ opt_int, 450 ], 'history_window_x-position': [ opt_int, 0 ], diff --git a/src/message_window.py b/src/message_window.py index c82cf189a..3a2859782 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -86,8 +86,16 @@ class MessageWindow(object): self.parent_paned = parent_paned old_parent = self.notebook.get_parent() old_parent.remove(self.notebook) - self.parent_paned.add(self.notebook) - self.parent_paned.pack2(self.notebook, resize=True, shrink=True) + if gajim.config.get('roster_on_the_right'): + child1 = self.parent_paned.get_child1() + self.parent_paned.remove(child1) + self.parent_paned.add(self.notebook) + self.parent_paned.pack1(self.notebook, resize=False, + shrink=True) + self.parent_paned.pack2(child1, resize=True, shrink=True) + else: + self.parent_paned.add(self.notebook) + self.parent_paned.pack2(self.notebook, resize=True, shrink=True) gajim.interface.roster.xml.get_object('show_roster_menuitem').\ set_sensitive(True) orig_window.destroy()