Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-08-29 13:52:37 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-08-29 13:52:37 (GMT)
commit45cee6228d7472b373b074b1961783b8b694f07a (patch)
tree838fada828e37fce6e753661f71bc63e62b3f7ba
parent2c03a6df4c46f050e7269d45d51fecb016fae53f (diff)
Added the possibility to hide and show the linktray.
currently you can toggle this with ctrl+s
-rw-r--r--NEWS1
-rw-r--r--linktoolbar.py5
-rwxr-xr-xwebactivity.py15
3 files changed, 18 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 8764415..922ec62 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+* Added the possibility to hide and show the linktray. currently you can toggle this with ctrl+s(erikos)
* Port to new tubes API. (cassidy)
* Use sugar's tubeconn.py. (cassidy)
diff --git a/linktoolbar.py b/linktoolbar.py
index c727552..202d934 100644
--- a/linktoolbar.py
+++ b/linktoolbar.py
@@ -41,6 +41,7 @@ class LinkToolbar(gtk.Toolbar):
def __init__(self):
gtk.Toolbar.__init__(self)
+ self.isvisible = False
def _add_link(self, url, buffer, color, title, owner, pos):
@@ -65,6 +66,7 @@ class LinkToolbar(gtk.Toolbar):
menu_item.show()
if len(self.get_children()) > 0:
+ self.isvisible = True
self.show()
def _link_clicked_cb(self, link, url):
@@ -79,7 +81,8 @@ class LinkToolbar(gtk.Toolbar):
index = child.pos
self.remove(child)
if len(self.get_children()) is 0:
- self.hide()
+ self.isvisible = False
+ self.hide()
return index
def _link_rm_palette_cb(self, widget, link):
diff --git a/webactivity.py b/webactivity.py
index 7d9d65c..6c02e81 100755
--- a/webactivity.py
+++ b/webactivity.py
@@ -310,7 +310,7 @@ class WebActivity(activity.Activity):
def key_press_cb(self, widget, event):
if event.state & gtk.gdk.CONTROL_MASK:
- if gtk.gdk.keyval_name(event.keyval) == "l":
+ if gtk.gdk.keyval_name(event.keyval) == "l":
self._add_link()
return True
elif gtk.gdk.keyval_name(event.keyval) == "r":
@@ -319,6 +319,10 @@ class WebActivity(activity.Activity):
self.model.links[current]['deleted'] = 1
self.model.links[current]['thumb'] = ''
return True
+ elif gtk.gdk.keyval_name(event.keyval) == "s":
+ _logger.debug('keyboard: Toggle visibility of tray')
+ self._toggle_visibility_tray()
+ return True
return False
def _add_link(self):
@@ -333,6 +337,14 @@ class WebActivity(activity.Activity):
import base64
self.messenger._add_link(self.current, self.webtitle, self.owner.props.color,
self.owner.props.nick, base64.b64encode(buffer))
+
+ def _toggle_visibility_tray(self):
+ if self.linkbar.isvisible is True:
+ self.linkbar.isvisible = False
+ self.linkbar.hide()
+ else:
+ self.linkbar.isvisible = True
+ self.linkbar.show()
def _pixbuf_save_cb(self, buf, data):
data[0] += buf
@@ -342,7 +354,6 @@ class WebActivity(activity.Activity):
data = [""]
pixbuf.save_to_callback(self._pixbuf_save_cb, "png", {}, data)
return str(data[0])
-
def _get_screenshot(self):
window = self._browser.window