From f748e6f8f07e03467b8915eabd125a556dc8e599 Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Thu, 20 May 2010 05:51:30 +0000 Subject: fix #931 - Make "keep aspect ratio" selection visible in the UI. Tested-by: James Cameron Signed-off-by: James Cameron --- (limited to 'toolbox.py') diff --git a/toolbox.py b/toolbox.py index 448847e..23fc4b7 100644 --- a/toolbox.py +++ b/toolbox.py @@ -357,6 +357,11 @@ class ToolsToolbar(gtk.Toolbar): self._tool_marquee_rectangular = ToolButton('tool-marquee-rectangular') self.insert(self._tool_marquee_rectangular, -1) self._tool_marquee_rectangular.set_tooltip(_('Rectangular Marquee')) + try: + self._configure_palette(self._tool_marquee_rectangular, self._TOOL_MARQUEE_RECTANGULAR) + except: + logging.debug('Could not create palette for tool Rectangular Marquee') + # New connect method # Using dictionnaries to control tool's properties @@ -483,7 +488,7 @@ class ToolsToolbar(gtk.Toolbar): label.show() colorbutton = ButtonFillColor(self._activity) - colorbutton.show() + colorbutton.show_all() hbox.pack_start(label) hbox.pack_start(colorbutton) @@ -493,8 +498,20 @@ class ToolsToolbar(gtk.Toolbar): content_box.pack_start(hbox) colorbutton.connect_after('color-set', self._on_color_set, self._TOOL_POLYGON) + if tool['name'] is self._TOOL_MARQUEE_RECTANGULAR['name']: + # Creating a CheckButton named "Fill". + keep_aspect_checkbutton = gtk.CheckButton(_('Keep aspect')) + keep_aspect_checkbutton.show() + keep_aspect_checkbutton.set_active(self._activity.area.keep_aspect_ratio) + + keep_aspect_checkbutton.connect('toggled', self._keep_aspect_checkbutton_toggled, widget) + palette.action_bar.pack_start(keep_aspect_checkbutton) + def _keep_aspect_checkbutton_toggled(self, checkbutton, button=None): + logging.debug('Keep aspect is Active: %s', checkbutton.get_active()) + self._activity.area.keep_aspect_ratio = checkbutton.get_active() + def set_shape(self, widget=None, tool=None, shape=None): """ Set a tool shape according to user choice at Tool Palette -- cgit v0.9.1