Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-01-29 16:11:24 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-01-29 16:11:24 (GMT)
commitc9bd79e9eebe954944f5a1e9406c3503f56e83be (patch)
treefc60ab18d940f748d517f0e7de5993b847b2fdbe
parent98d13b0b292ba17ac56e4d133e6c4619c46c7ed7 (diff)
Fix sizing
-rw-r--r--thoughtview.py4
-rw-r--r--view.py10
2 files changed, 10 insertions, 4 deletions
diff --git a/thoughtview.py b/thoughtview.py
index 478dd00..a079476 100644
--- a/thoughtview.py
+++ b/thoughtview.py
@@ -86,9 +86,13 @@ class ThoughtView(Box):
layout.set_text(_('Untitled'))
width, height = layout.get_pixel_size()
+ #logging.debug('_draw_label %r %r %r' % (layout.get_text(), width, height))
self.min_width = width + self._PADDING * 2
self.min_height = height + self._PADDING * 2
+ self.width = max(self.width, self.min_width)
+ self.height = max(self.height, self.min_height)
+
x = self._PADDING
y = self._PADDING
context.cairo.translate(x, y)
diff --git a/view.py b/view.py
index 3e5e02e..ed4f884 100644
--- a/view.py
+++ b/view.py
@@ -138,11 +138,13 @@ class NewThoughtTool(HandleTool):
def on_button_release(self, context, event):
logging.debug('NewThoughtTool.ungrab_handle')
- context.view.canvas.remove(self._new_connection)
- self._new_connection = None
+ if self._new_connection is not None:
+ context.view.canvas.remove(self._new_connection)
+ self._new_connection = None
+
+ context.view.model.create_new_thought(x=event.x, y=event.y,
+ parent_id=self._parent_thought.id)
- context.view.model.create_new_thought(x=event.x, y=event.y,
- parent_id=self._parent_thought.id)
HandleTool.on_button_release(self, context, event)
def move(self, view, item, handle, pos):