gimp r25078 - in branches/gimp-2-4: . app/tools
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25078 - in branches/gimp-2-4: . app/tools
- Date: Sun, 9 Mar 2008 18:43:48 +0000 (GMT)
Author: mitch
Date: Sun Mar 9 18:43:48 2008
New Revision: 25078
URL: http://svn.gnome.org/viewvc/gimp?rev=25078&view=rev
Log:
2008-03-09 Michael Natterer <mitch gimp org>
Merged from trunk (slightly modified):
Fix mishandling of the "antialias" GParamSpec. Fixes bug #521069:
* app/tools/gimpselectionoptions.c (gimp_selection_options_reset):
don't set the default for "antialias" depending on the tool
type (which is impossible since the antialias GParamSpec only
exists once, and not once for each subclass).
* app/tools/gimpforegroundselectoptions.c: override the antialias
property here and default to FALSE.
Modified:
branches/gimp-2-4/ChangeLog
branches/gimp-2-4/app/tools/gimpforegroundselectoptions.c
branches/gimp-2-4/app/tools/gimpselectionoptions.c
Modified: branches/gimp-2-4/app/tools/gimpforegroundselectoptions.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimpforegroundselectoptions.c (original)
+++ branches/gimp-2-4/app/tools/gimpforegroundselectoptions.c Sun Mar 9 18:43:48 2008
@@ -38,6 +38,7 @@
enum
{
PROP_0,
+ PROP_ANTIALIAS,
PROP_CONTIGUOUS,
PROP_BACKGROUND,
PROP_STROKE_WIDTH,
@@ -72,20 +73,30 @@
object_class->set_property = gimp_foreground_select_options_set_property;
object_class->get_property = gimp_foreground_select_options_get_property;
+ /* override the antialias default value from GimpSelectionOptions */
+ GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ANTIALIAS,
+ "antialias",
+ N_("Smooth edges"),
+ FALSE,
+ GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CONTIGUOUS,
"contiguous",
_("Select a single contiguous area"),
TRUE,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_BACKGROUND,
"background", NULL,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_STROKE_WIDTH,
"stroke-width",
_("Size of the brush used for refinements"),
1, 80, 18,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_SMOOTHNESS,
"smoothness",
_("Smaller values give a more accurate "
@@ -93,25 +104,30 @@
"in the selection"),
0, 8, SIOX_DEFAULT_SMOOTHNESS,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_MASK_COLOR,
"mask-color", NULL,
GIMP_TYPE_CHANNEL_TYPE,
GIMP_BLUE_CHANNEL,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_EXPANDED,
"expanded", NULL,
FALSE,
0);
+
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_SENSITIVITY_L,
"sensitivity-l",
_("Sensitivity for brightness component"),
0.0, 10.0, SIOX_DEFAULT_SENSITIVITY_L,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_SENSITIVITY_A,
"sensitivity-a",
_("Sensitivity for red/green component"),
0.0, 10.0, SIOX_DEFAULT_SENSITIVITY_A,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_SENSITIVITY_B,
"sensitivity-b",
_("Sensitivity for yellow/blue component"),
@@ -134,33 +150,46 @@
switch (property_id)
{
+ case PROP_ANTIALIAS:
+ GIMP_SELECTION_OPTIONS (object)->antialias = g_value_get_boolean (value);
+ break;
+
case PROP_CONTIGUOUS:
options->contiguous = g_value_get_boolean (value);
break;
+
case PROP_BACKGROUND:
options->background = g_value_get_boolean (value);
break;
+
case PROP_STROKE_WIDTH:
options->stroke_width = g_value_get_int (value);
break;
+
case PROP_SMOOTHNESS:
options->smoothness = g_value_get_int (value);
break;
+
case PROP_MASK_COLOR:
options->mask_color = g_value_get_enum (value);
break;
+
case PROP_EXPANDED:
options->expanded = g_value_get_boolean (value);
break;
+
case PROP_SENSITIVITY_L:
options->sensitivity[0] = g_value_get_double (value);
break;
+
case PROP_SENSITIVITY_A:
options->sensitivity[1] = g_value_get_double (value);
break;
+
case PROP_SENSITIVITY_B:
options->sensitivity[2] = g_value_get_double (value);
break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -177,33 +206,46 @@
switch (property_id)
{
+ case PROP_ANTIALIAS:
+ g_value_set_boolean (value, GIMP_SELECTION_OPTIONS (object)->antialias);
+ break;
+
case PROP_CONTIGUOUS:
g_value_set_boolean (value, options->contiguous);
break;
+
case PROP_BACKGROUND:
g_value_set_boolean (value, options->background);
break;
+
case PROP_STROKE_WIDTH:
g_value_set_int (value, options->stroke_width);
break;
+
case PROP_SMOOTHNESS:
g_value_set_int (value, options->smoothness);
break;
+
case PROP_MASK_COLOR:
g_value_set_enum (value, options->mask_color);
break;
+
case PROP_EXPANDED:
g_value_set_boolean (value, options->expanded);
break;
+
case PROP_SENSITIVITY_L:
g_value_set_double (value, options->sensitivity[0]);
break;
+
case PROP_SENSITIVITY_A:
g_value_set_double (value, options->sensitivity[1]);
break;
+
case PROP_SENSITIVITY_B:
g_value_set_double (value, options->sensitivity[2]);
break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -227,6 +269,9 @@
gchar *title;
gint row = 0;
+ gtk_widget_set_sensitive (GIMP_SELECTION_OPTIONS (tool_options)->antialias_toggle,
+ FALSE);
+
/* single / multiple objects */
button = gimp_prop_check_button_new (config, "contiguous", _("Contiguous"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
Modified: branches/gimp-2-4/app/tools/gimpselectionoptions.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimpselectionoptions.c (original)
+++ branches/gimp-2-4/app/tools/gimpselectionoptions.c Sun Mar 9 18:43:48 2008
@@ -38,12 +38,9 @@
#include "widgets/gimppropwidgets.h"
#include "widgets/gimpwidgets-utils.h"
-#include "gimpforegroundselecttool.h"
-#include "gimprectangleselecttool.h"
#include "gimpregionselecttool.h"
#include "gimpiscissorstool.h"
#include "gimpselectionoptions.h"
-#include "gimprectangleselectoptions.h"
#include "gimptooloptions-gui.h"
#include "gimp-intl.h"
@@ -243,13 +240,6 @@
GParamSpec *pspec;
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (tool_options),
- "antialias");
-
- if (pspec)
- G_PARAM_SPEC_BOOLEAN (pspec)->default_value =
- (tool_options->tool_info->tool_type != GIMP_TYPE_FOREGROUND_SELECT_TOOL);
-
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (tool_options),
"threshold");
if (pspec)
@@ -350,9 +340,6 @@
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
- if (tool_options->tool_info->tool_type == GIMP_TYPE_FOREGROUND_SELECT_TOOL)
- gtk_widget_set_sensitive (button, FALSE);
-
options->antialias_toggle = button;
/* the feather frame */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]