diff options
Diffstat (limited to 'view.py')
-rw-r--r-- | view.py | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -148,11 +148,25 @@ class ThoughtView(CanvasElement): return layout def draw(self, context): + + # draw background + if self.model.color is None or not self.model.color: + color = style.Color('#FFFFFF') + else: + color = style.Color(self.model.color) + + r, g, b, a = color.get_rgba() + context.save() + context.set_source_rgb(r, g, b) + context.paint() + context.restore() + if self._dragging: context.set_source_rgb(0.8, 0.8, 0.8) else: context.set_source_rgb(0, 0, 0) + # draw text context.save() layout = self._get_name_layout(context) @@ -166,6 +180,7 @@ class ThoughtView(CanvasElement): context.show_layout(layout) context.restore() + # draw bounding box context.save() context.set_line_width(4) |