From c9bd79e9eebe954944f5a1e9406c3503f56e83be Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 29 Jan 2009 16:11:24 +0000 Subject: Fix sizing --- 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): -- cgit v0.9.1