Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/historietaactivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-03-12 20:02:06 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-03-12 20:02:06 (GMT)
commit605132efabf8bf88014145c924ae35d6d862fe52 (patch)
tree7265aacb30b1d8d79cacd42295404811a7cdcba7 /historietaactivity.py
parent2bd3ad79062647d225c1d9bcf9c6f8ef137fad9c (diff)
Add a title rectangle globe
The title globe is added when the activity starts with a empty page, and can't be deleted. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'historietaactivity.py')
-rw-r--r--historietaactivity.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/historietaactivity.py b/historietaactivity.py
index 3009c77..2737a5b 100644
--- a/historietaactivity.py
+++ b/historietaactivity.py
@@ -96,6 +96,9 @@ class HistorietaActivity(activity.Activity):
self.set_canvas(scrolled)
self.show()
self.metadata['mime_type'] = 'application/x-fototoon-activity'
+
+ self.page.empty_page = handle.object_id is None
+
#print "screen witdh " , SCREEN_WIDTH
#print "page witdh " , self.page.size_request()
@@ -341,6 +344,7 @@ class ComicBox(gtk.DrawingArea):
self.image_name = ''
self.image = None
self.image_saved = False
+ self.title_globe = None
self.width = (int)(SCREEN_WIDTH - DEF_SPACING) / 2
self.height = BOX_HEIGHT
@@ -408,6 +412,19 @@ class ComicBox(gtk.DrawingArea):
def expose(self, widget, event):
self.context = widget.window.cairo_create()
+
+ # check if is the title box and is a new page
+ if self.page.title_box == self and self.page.empty_page:
+ self.page.empty_page = False
+ # select title box
+ rect = self.get_allocation()
+ x = rect.width / 2
+ y = rect.height / 2
+ logging.error('Adding rectangle at %d %d', x, y)
+ self.add_rectangulo(x, y)
+ self.title_globe = self.globos[0]
+ self.title_globe.texto.set_text(_('Title:'))
+
self.draw(self.context, event.area, widget.window)
return False