From e6d7297deaf020b942e2d21974c0bc380dc95133 Mon Sep 17 00:00:00 2001
From: Gonzalo Odiard <godiard@gmail.com>
Date: Tue, 14 Jan 2014 17:43:22 -0300
Subject: [PATCH] Make consistent the tooltip of the show/hide tray button
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
---
viewtoolbar.py | 7 ++++++-
webactivity.py | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/viewtoolbar.py b/viewtoolbar.py
index 2008277..f65ae4f 100644
a
|
b
|
class ViewToolbar(Gtk.Toolbar): |
110 | 110 | def __tray_toggled_cb(self, button): |
111 | 111 | if button.props.active: |
112 | 112 | self._activity.tray.show() |
113 | | self.traybutton.set_tooltip(_('Show Tray')) |
114 | 113 | else: |
115 | 114 | self._activity.tray.hide() |
| 115 | self.update_traybutton_tooltip() |
| 116 | |
| 117 | def update_traybutton_tooltip(self): |
| 118 | if not self.traybutton.props.active: |
| 119 | self.traybutton.set_tooltip(_('Show Tray')) |
| 120 | else: |
116 | 121 | self.traybutton.set_tooltip(_('Hide Tray')) |
diff --git a/webactivity.py b/webactivity.py
index 43267e2..cfaa240 100644
a
|
b
|
class WebActivity(activity.Activity): |
614 | 614 | item.show() |
615 | 615 | self._view_toolbar.traybutton.props.sensitive = True |
616 | 616 | self._view_toolbar.traybutton.props.active = True |
| 617 | self._view_toolbar.update_traybutton_tooltip() |
617 | 618 | |
618 | 619 | def _link_removed_cb(self, button, hash): |
619 | 620 | ''' remove a link from tray and delete it in the model ''' |
… |
… |
class WebActivity(activity.Activity): |
622 | 623 | if len(self._tray.get_children()) == 0: |
623 | 624 | self._view_toolbar.traybutton.props.sensitive = False |
624 | 625 | self._view_toolbar.traybutton.props.active = False |
| 626 | self._view_toolbar.update_traybutton_tooltip() |
625 | 627 | |
626 | 628 | def _link_clicked_cb(self, button, url): |
627 | 629 | ''' an item of the link tray has been clicked ''' |