From 76c896f977aca507ec585e8903da31c9252449bd Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Fri, 28 Dec 2012 10:27:38 +0000 Subject: [PATCH] Improve hover handling on displaytabs svn: r20858 --- gramps/gui/editors/displaytabs/embeddedlist.py | 8 ++++++++ gramps/gui/editors/displaytabs/gallerytab.py | 1 - gramps/gui/editors/displaytabs/groupembeddedlist.py | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gramps/gui/editors/displaytabs/embeddedlist.py b/gramps/gui/editors/displaytabs/embeddedlist.py index 79944eea6..0ae9abf6c 100644 --- a/gramps/gui/editors/displaytabs/embeddedlist.py +++ b/gramps/gui/editors/displaytabs/embeddedlist.py @@ -114,6 +114,14 @@ class EmbeddedList(ButtonTab): if fun: fun() return True + elif event.type == Gdk.EventType.BUTTON_PRESS and event.button == 1: + if self.tree.get_hover_selection(): + self.tree.set_hover_selection(False) + return True + else: + self.tree.set_hover_selection(True) + #let code for single click still select the current row: + return False return False def get_popup_menu_items(self): diff --git a/gramps/gui/editors/displaytabs/gallerytab.py b/gramps/gui/editors/displaytabs/gallerytab.py index 450f29e0c..d65a600cf 100644 --- a/gramps/gui/editors/displaytabs/gallerytab.py +++ b/gramps/gui/editors/displaytabs/gallerytab.py @@ -565,6 +565,5 @@ class GalleryTab(ButtonTab, DbGUIElement): return self.get_data().index(obj) def clean_up(self): - print "CLEANING" self.iconlist.disconnect(self.__id_connect_sel) super(ButtonTab, self).clean_up() diff --git a/gramps/gui/editors/displaytabs/groupembeddedlist.py b/gramps/gui/editors/displaytabs/groupembeddedlist.py index e6e2dc305..35370257e 100644 --- a/gramps/gui/editors/displaytabs/groupembeddedlist.py +++ b/gramps/gui/editors/displaytabs/groupembeddedlist.py @@ -119,6 +119,14 @@ class GroupEmbeddedList(EmbeddedList): if fun: fun() return True + elif event.type == Gdk.EventType.BUTTON_PRESS and event.button == 1: + if self.tree.get_hover_selection(): + self.tree.set_hover_selection(False) + return True + else: + self.tree.set_hover_selection(True) + #let code for single click still select the current row: + return False return False def is_empty(self):