Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
path: root/webactivity.py
diff options
authorManuel Quiñones <manuq@laptop.org>2012-09-28 00:34:12 (GMT)
committer Manuel Quiñones <manuq@laptop.org>2012-09-28 00:34:12 (GMT)
commit49495aa4584035a97754c75b124a3c326d9f8db9 (patch)
tree45fb2fc882271deb88048648aa584fe8abf05c4b /webactivity.py
parent5d0188398a92d6f28fbe5a7aa22f43b3e2edfe21 (diff)
Restore the Bookmarks tray handling using a toggle button - SL #3868
Instead of changing the tooltip and icon of the tool button based on the visibility of the tray, with the map and unmap callbacks that this patch removes, do the inverse: when a bookmark is made, the toggle button is activated, and it shows the tray in the toggled callback. Also when the only pending bookmark is removed, the toggle button is deactivated, and it hides the tray in the toggled callback. The switch to a toggle button allows us to do the tray and button interaction in a more standard way, and the bugs that the unconventional interaction raised are now fixed. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Diffstat (limited to 'webactivity.py')
1 files changed, 2 insertions, 3 deletions
diff --git a/webactivity.py b/webactivity.py
index 75b857b..dff3a4a 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -173,7 +173,6 @@ class WebActivity(activity.Activity):
self._tray = HTray()
self.set_tray(self._tray, Gtk.PositionType.BOTTOM)
- self._tray.show()
self._primary_toolbar = PrimaryToolbar(self._tabbed_view, self)
self._edit_toolbar = EditToolbar(self)
@@ -553,9 +552,8 @@ class WebActivity(activity.Activity):
# use index to add to the tray
self._tray.add_item(item, index)
- if self._tray.props.visible is False:
- self._tray.show()
self._view_toolbar.traybutton.props.sensitive = True
+ self._view_toolbar.traybutton.props.active = True
def _link_removed_cb(self, button, hash):
''' remove a link from tray and delete it in the model '''
@@ -563,6 +561,7 @@ class WebActivity(activity.Activity):
if len(self._tray.get_children()) == 0:
self._view_toolbar.traybutton.props.sensitive = False
+ self._view_toolbar.traybutton.props.active = False
def _link_clicked_cb(self, button, url):
''' an item of the link tray has been clicked '''