Ticket #4712: 0001-Make-consistent-the-tooltip-of-the-show-hide-tray-bu.patch

File 0001-Make-consistent-the-tooltip-of-the-show-hide-tray-bu.patch, 1.9 KB (added by godiard, 10 years ago)
  • viewtoolbar.py

    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): 
    110110    def __tray_toggled_cb(self, button):
    111111        if button.props.active:
    112112            self._activity.tray.show()
    113             self.traybutton.set_tooltip(_('Show Tray'))
    114113        else:
    115114            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:
    116121            self.traybutton.set_tooltip(_('Hide Tray'))
  • webactivity.py

    diff --git a/webactivity.py b/webactivity.py
    index 43267e2..cfaa240 100644
    a b class WebActivity(activity.Activity): 
    614614        item.show()
    615615        self._view_toolbar.traybutton.props.sensitive = True
    616616        self._view_toolbar.traybutton.props.active = True
     617        self._view_toolbar.update_traybutton_tooltip()
    617618
    618619    def _link_removed_cb(self, button, hash):
    619620        ''' remove a link from tray and delete it in the model '''
    class WebActivity(activity.Activity): 
    622623        if len(self._tray.get_children()) == 0:
    623624            self._view_toolbar.traybutton.props.sensitive = False
    624625            self._view_toolbar.traybutton.props.active = False
     626            self._view_toolbar.update_traybutton_tooltip()
    625627
    626628    def _link_clicked_cb(self, button, url):
    627629        ''' an item of the link tray has been clicked '''