diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2013-09-02 14:31:37 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2013-09-02 14:42:07 (GMT) |
commit | 181c0a8dfc5fd434a978498840586e3d2b3637ba (patch) | |
tree | 5e2f3f06a679e3cecc07cb5b324a9cb32c57b40a /widgets.py | |
parent | 583df7a03f81a73ae392a63575ef05b1dbe70c4b (diff) |
Save and restore tools state in the metadata - SL #2708
Signed-off-by: Puneet Kaur <puneet.gkaur@gmail.com>
Acked-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'widgets.py')
-rw-r--r-- | widgets.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -188,8 +188,8 @@ class ButtonStrokeColor(Gtk.ToolItem): # Replace it with a ColorButton self.color_button = BrushButton(has_invoker=False) self.add(self.color_button) - self.color_button.set_brush_size(2) - self.color_button.set_brush_shape('circle') + self.color_button.set_brush_size(self.properties['line size']) + self.color_button.set_brush_shape(self.properties['line shape']) self.color_button.set_stamp_size(20) # The following is so that the behaviour on the toolbar is correct. @@ -237,6 +237,7 @@ class ButtonStrokeColor(Gtk.ToolItem): # This is where we set restrictions for size: # Initial value, minimum value, maximum value, step + adj = Gtk.Adjustment(self.properties['line size'], 1.0, 100.0, 1.0) self.size_scale = Gtk.HScale() self.size_scale.set_adjustment(adj) @@ -268,12 +269,16 @@ class ButtonStrokeColor(Gtk.ToolItem): self.custom_box.pack_start(self.vbox_brush_options, True, True, 0) item1 = RadioToolButton() item1.set_icon_name('tool-shape-ellipse') - item1.set_active(True) item2 = RadioToolButton() item2.set_icon_name('tool-shape-rectangle') item2.props.group = item1 + if self.properties['line shape'] == 'circle': + item1.set_active(True) + else: + item2.set_active(True) + item1.connect('toggled', self._on_toggled, self.properties, 'circle') item2.connect('toggled', self._on_toggled, self.properties, 'square') |