From b1d7152bddc7869cb6189d6e7ded5bc07a1bfcdc Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Sun, 6 Mar 2005 08:31:09 +0000 Subject: [PATCH] use the width of the first CellRenderer instead of the width of the pixbuf less deep indentation --- plugins/gtkgui/gtkgui.glade | 1 + plugins/gtkgui/gtkgui.py | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index 50ebed1f9..b7a96c955 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -8181,6 +8181,7 @@ Custom</property> <property name="shadow_type">GTK_SHADOW_IN</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property> <signal name="scroll_child" handler="on_conversation_scrolledwindow_scroll_child" last_modification_time="Sat, 05 Mar 2005 16:20:42 GMT"/> + <signal name="move_focus_out" handler="on_conversation_scrolledwindow_move_focus_out" last_modification_time="Sun, 06 Mar 2005 01:28:04 GMT"/> <child> <widget class="GtkTextView" id="conversation_textview"> diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 9528ef996..1d7fe8462 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -1936,21 +1936,20 @@ class roster_window: try: path, column, x, y = self.tree.get_path_at_pos(int(event.x), \ int(event.y)) - model = self.tree.get_model() - iter = model.get_iter(path) - type = model.get_value(iter, 2) - if (type == 'group'): - if (self.tree.row_expanded(path)): - #The integer 10 is the xoffset - if x <= self.pixbufs['opened'].get_pixbuf()\ - .get_width()+10: - self.tree.collapse_row(path) - else: - if x <= self.pixbufs['closed'].get_pixbuf()\ - .get_width()+10: - self.tree.expand_row(path, False) except TypeError: self.tree.get_selection().unselect_all() + return False + model = self.tree.get_model() + iter = model.get_iter(path) + type = model.get_value(iter, 2) + if (type == 'group'): #FIXME: what about doing the same with accounts ? + # The integer 30 is the width of the first CellRenderer (see + # iconCellDataFunc function) + if x <= 30: + if (self.tree.row_expanded(path)): + self.tree.collapse_row(path) + else: + self.tree.expand_row(path, False) return False def on_req_usub(self, widget, user, account):