Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webtoolbar.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-09-16 14:32:26 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-09-16 14:32:26 (GMT)
commit90990c178837d2d31f63df8a9209f49b03cc8ed3 (patch)
tree47eb5a727c158e620818a11c32ae7a404a84fd70 /webtoolbar.py
parent5c31ae6ef9d3d6cf631bc224bd8516a21cca6f04 (diff)
* Make hide/show of the treay one button #3475
Diffstat (limited to 'webtoolbar.py')
-rwxr-xr-xwebtoolbar.py48
1 files changed, 25 insertions, 23 deletions
diff --git a/webtoolbar.py b/webtoolbar.py
index 6aab4bd..098ac4d 100755
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -38,12 +38,9 @@ class WebToolbar(gtk.Toolbar):
'add-link': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
([])),
- 'show-tray': (gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE,
- ([])),
- 'hide-tray': (gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE,
- ([]))
+ 'visibility-tray': (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE,
+ ([]))
}
def __init__(self, browser):
@@ -87,18 +84,12 @@ class WebToolbar(gtk.Toolbar):
self.insert(self._link_add, -1)
self._link_add.show()
- self._tray_show = ToolButton('tray-show')
- self._tray_show.set_tooltip(_('Show Tray'))
- self._tray_show.connect('clicked', self._tray_show_clicked_cb)
- self.insert(self._tray_show, -1)
- self._tray_show.show()
-
- self._tray_hide = ToolButton('tray-hide')
- self._tray_hide.set_tooltip(_('Hide Tray'))
- self._tray_hide.connect('clicked', self._tray_hide_clicked_cb)
- self.insert(self._tray_hide, -1)
- self._tray_hide.show()
-
+ self._tray_vis = ToolButton()
+ self._tray_vis.connect('clicked', self._tray_vis_clicked_cb)
+ self.insert(self._tray_vis, -1)
+ self.tray_set_empty()
+ self._tray_vis.show()
+
progress_listener = progresslistener.get_instance()
progress_listener.connect('location-changed', self._location_changed_cb)
progress_listener.connect('loading-start', self._loading_start_cb)
@@ -219,8 +210,19 @@ class WebToolbar(gtk.Toolbar):
def _link_add_clicked_cb(self, button):
self.emit('add-link')
- def _tray_show_clicked_cb(self, button):
- self.emit('show-tray')
-
- def _tray_hide_clicked_cb(self, button):
- self.emit('hide-tray')
+ def tray_set_empty(self):
+ self._tray_vis.set_icon('tray-empty')
+ self._tray_vis.set_sensitive(False)
+
+ def tray_set_show(self):
+ self._tray_vis.set_icon('tray-show')
+ self._tray_vis.set_tooltip(_('Show Tray'))
+ self._tray_vis.set_sensitive(True)
+
+ def tray_set_hide(self):
+ self._tray_vis.set_icon('tray-hide')
+ self._tray_vis.set_tooltip(_('Hide Tray'))
+ self._tray_vis.set_sensitive(True)
+
+ def _tray_vis_clicked_cb(self, button):
+ self.emit('visibility-tray')