Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/readactivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-08-15 21:15:17 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-08-15 21:15:17 (GMT)
commitc59427ee2b894fa2c7c3bc4ec1583822b07ffa3c (patch)
tree47ebe96bd58e786966d0af39bee2d340ea238168 /readactivity.py
parent3794bfc76c6704c8829fc4d08ed947de2d096ecb (diff)
New design to bookmark visualization
The sidebar where we displayed the bookmark was a thin area at the left of the screen, was not very intuitive, and was dificult to access with a finger. With Gtk3 we can use overlays, then this patch move the sidebar to the top/right of the screen, and display it with a shape similar to other book readers, using the user colors. I have tried to do the botom triangle transparent, but without success, we can try it later. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'readactivity.py')
-rw-r--r--readactivity.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/readactivity.py b/readactivity.py
index c56c0db..7decd10 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -47,6 +47,7 @@ from sugar3 import mime
from sugar3.datastore import datastore
from sugar3.graphics.objectchooser import ObjectChooser
+from sugar3.graphics import style
from readtoolbar import EditToolbar
from readtoolbar import ViewToolbar
@@ -258,11 +259,18 @@ class ReadActivity(activity.Activity):
self._topbar = TopBar()
self._vbox.pack_start(self._topbar, False, False, 0)
+ overlay = Gtk.Overlay()
+
self._hbox = Gtk.HBox()
self._hbox.show()
- self._hbox.pack_start(self._sidebar, False, False, 0)
-
- self._vbox.pack_start(self._hbox, True, True, 0)
+ overlay.add(self._hbox)
+
+ self._sidebar.props.halign = Gtk.Align.END
+ self._sidebar.props.valign = Gtk.Align.START
+ self._sidebar.props.margin_right = style.GRID_CELL_SIZE / 2
+ overlay.add_overlay(self._sidebar)
+ overlay.show()
+ self._vbox.pack_start(overlay, True, True, 0)
self.set_canvas(self._vbox)
# Set up for idle suspend