Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/detailview.py
diff options
context:
space:
mode:
authorEben Eliason <eben@localhost.localdomain>2008-04-19 08:37:03 (GMT)
committer Eben Eliason <eben@localhost.localdomain>2008-04-19 08:37:03 (GMT)
commite946a55e70f33e1f0e59cd62d1da876399be81b7 (patch)
treeb5a4f0a4fa32aed3807384599819d8fbeb920141 /detailview.py
parent468b11787f601ec90a440f0a998edcdcc0a9c661 (diff)
Replace the "back bar" in the detail view for entries
Diffstat (limited to 'detailview.py')
-rw-r--r--detailview.py46
1 files changed, 45 insertions, 1 deletions
diff --git a/detailview.py b/detailview.py
index d6688bc..66fc62e 100644
--- a/detailview.py
+++ b/detailview.py
@@ -30,6 +30,12 @@ from expandedentry import ExpandedEntry
from keepicon import KeepIcon
class DetailView(gtk.VBox):
+ __gtype_name__ = 'DetailView'
+
+ __gsignals__ = {
+ 'go-back-clicked': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([]))
+ }
+
def __init__(self):
gtk.VBox.__init__(self)
@@ -39,16 +45,25 @@ class DetailView(gtk.VBox):
canvas = hippo.Canvas()
self.pack_start(canvas)
canvas.show()
-
+
self._root = hippo.CanvasBox()
self._root.props.background_color = style.COLOR_PANEL_GREY.get_int()
canvas.set_root(self._root)
+ back_bar = BackBar()
+ back_bar.connect('button-release-event',
+ self.__back_bar_release_event_cb)
+ self._root.append(back_bar)
+
def _fav_icon_activated_cb(self, fav_icon):
keep = not self._expanded_entry.get_keep()
self._expanded_entry.set_keep(keep)
fav_icon.props.keep = keep
+ def __back_bar_release_event_cb(self, back_bar, event):
+ self.emit('go-back-clicked')
+ return False
+
def _update_view(self):
if self._expanded_entry:
self._root.remove(self._expanded_entry)
@@ -70,3 +85,32 @@ class DetailView(gtk.VBox):
if self._jobject:
self._jobject = datastore.get(self._jobject.object_id)
self._update_view()
+
+class BackBar(hippo.CanvasBox):
+ def __init__(self):
+ hippo.CanvasBox.__init__(self,
+ orientation=hippo.ORIENTATION_HORIZONTAL,
+ border=style.LINE_WIDTH,
+ background_color=style.COLOR_PANEL_GREY.get_int(),
+ border_color=style.COLOR_SELECTION_GREY.get_int(),
+ padding=style.DEFAULT_PADDING,
+ padding_left=style.DEFAULT_SPACING,
+ spacing=style.DEFAULT_SPACING)
+
+ icon = CanvasIcon(icon_name='go-previous',
+ size=style.SMALL_ICON_SIZE,
+ fill_color=style.COLOR_TOOLBAR_GREY.get_svg())
+ self.append(icon)
+
+ label = hippo.CanvasText(text=_('Back'),
+ font_desc=style.FONT_NORMAL.get_pango_desc())
+ self.append(label)
+
+ self.connect('motion-notify-event', self.__motion_notify_event_cb)
+
+ def __motion_notify_event_cb(self, box, event):
+ if event.detail == hippo.MOTION_DETAIL_ENTER:
+ box.props.background_color = style.COLOR_SELECTION_GREY.get_int()
+ elif event.detail == hippo.MOTION_DETAIL_LEAVE:
+ box.props.background_color = style.COLOR_PANEL_GREY.get_int()
+ return False