changed the default value for "sample_average" to TRUE (for Levels and

2003-10-21  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpcoloroptions.c: changed the default value for
	"sample_average" to TRUE (for Levels and Curves tools).

	* app/tools/gimpcolorpickeroptions.c: override the default value
	for "sample_average" and set it back to FALSE (for Color Picker).
This commit is contained in:
Sven Neumann 2003-10-21 12:45:58 +00:00 committed by Sven Neumann
parent 55fd373096
commit 1758feb8f4
3 changed files with 33 additions and 39 deletions

View File

@ -1,3 +1,11 @@
2003-10-21 Sven Neumann <sven@gimp.org>
* app/tools/gimpcoloroptions.c: changed the default value for
"sample_average" to TRUE (for Levels and Curves tools).
* app/tools/gimpcolorpickeroptions.c: override the default value
for "sample_average" and set it back to FALSE (for Color Picker).
2003-10-21 Sven Neumann <sven@gimp.org>
* app/widgets/gimptooldialog.c: documented gimp_tool_dialog_new().

View File

@ -43,7 +43,6 @@ enum
};
static void gimp_color_options_init (GimpColorOptions *options);
static void gimp_color_options_class_init (GimpColorOptionsClass *options_class);
static void gimp_color_options_set_property (GObject *object,
@ -76,7 +75,7 @@ gimp_color_options_get_type (void)
NULL, /* class_data */
sizeof (GimpColorOptions),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_color_options_init,
NULL /* instance_init */
};
type = g_type_register_static (GIMP_TYPE_TOOL_OPTIONS,
@ -87,12 +86,10 @@ gimp_color_options_get_type (void)
return type;
}
static void
static void
gimp_color_options_class_init (GimpColorOptionsClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
@ -105,7 +102,7 @@ gimp_color_options_class_init (GimpColorOptionsClass *klass)
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAMPLE_AVERAGE,
"sample-average", NULL,
FALSE,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_AVERAGE_RADIUS,
"average-radius", NULL,
@ -113,20 +110,13 @@ gimp_color_options_class_init (GimpColorOptionsClass *klass)
0);
}
static void
gimp_color_options_init (GimpColorOptions *options)
{
}
static void
gimp_color_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpColorOptions *options;
options = GIMP_COLOR_OPTIONS (object);
GimpColorOptions *options = GIMP_COLOR_OPTIONS (object);
switch (property_id)
{
@ -151,9 +141,7 @@ gimp_color_options_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GimpColorOptions *options;
options = GIMP_COLOR_OPTIONS (object);
GimpColorOptions *options = GIMP_COLOR_OPTIONS (object);
switch (property_id)
{
@ -175,14 +163,12 @@ gimp_color_options_get_property (GObject *object,
GtkWidget *
gimp_color_options_gui (GimpToolOptions *tool_options)
{
GObject *config;
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox;
GtkWidget *frame;
GtkWidget *table;
GtkWidget *button;
config = G_OBJECT (tool_options);
vbox = gimp_tool_options_gui (tool_options);
/* the sample average options */

View File

@ -37,12 +37,12 @@
enum
{
PROP_0,
PROP_SAMPLE_AVERAGE, /* overrides a GimpColorOptions property */
PROP_UPDATE_TOOLBOX,
PROP_PICK_MODE
};
static void gimp_color_picker_options_init (GimpColorPickerOptions *options);
static void gimp_color_picker_options_class_init (GimpColorPickerOptionsClass *options_class);
static void gimp_color_picker_options_set_property (GObject *object,
@ -75,7 +75,7 @@ gimp_color_picker_options_get_type (void)
NULL, /* class_data */
sizeof (GimpColorPickerOptions),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_color_picker_options_init,
NULL /* instance_init */
};
type = g_type_register_static (GIMP_TYPE_COLOR_OPTIONS,
@ -98,6 +98,11 @@ gimp_color_picker_options_class_init (GimpColorPickerOptionsClass *klass)
object_class->set_property = gimp_color_picker_options_set_property;
object_class->get_property = gimp_color_picker_options_get_property;
/* override a GimpColorOptions property to get a different default value */
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAMPLE_AVERAGE,
"sample-average", NULL,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_UPDATE_TOOLBOX,
"update-toolbox", NULL,
TRUE,
@ -109,23 +114,19 @@ gimp_color_picker_options_class_init (GimpColorPickerOptionsClass *klass)
0);
}
static void
gimp_color_picker_options_init (GimpColorPickerOptions *options)
{
}
static void
gimp_color_picker_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpColorPickerOptions *options;
options = GIMP_COLOR_PICKER_OPTIONS (object);
GimpColorPickerOptions *options = GIMP_COLOR_PICKER_OPTIONS (object);
switch (property_id)
{
case PROP_SAMPLE_AVERAGE:
GIMP_COLOR_OPTIONS (options)->sample_average = g_value_get_boolean (value);
break;
case PROP_UPDATE_TOOLBOX:
options->update_toolbox = g_value_get_boolean (value);
break;
@ -144,12 +145,14 @@ gimp_color_picker_options_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GimpColorPickerOptions *options;
options = GIMP_COLOR_PICKER_OPTIONS (object);
GimpColorPickerOptions *options = GIMP_COLOR_PICKER_OPTIONS (object);
switch (property_id)
{
case PROP_SAMPLE_AVERAGE:
g_value_set_boolean (value,
GIMP_COLOR_OPTIONS (options)->sample_average);
break;
case PROP_UPDATE_TOOLBOX:
g_value_set_boolean (value, options->update_toolbox);
break;
@ -165,16 +168,13 @@ gimp_color_picker_options_get_property (GObject *object,
GtkWidget *
gimp_color_picker_options_gui (GimpToolOptions *tool_options)
{
GimpColorPickerOptions *options;
GObject *config;
GimpColorPickerOptions *options = GIMP_COLOR_PICKER_OPTIONS (tool_options);
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *frame;
gchar *str;
options = GIMP_COLOR_PICKER_OPTIONS (tool_options);
config = G_OBJECT (tool_options);
vbox = gimp_color_options_gui (tool_options);
/* the sample merged toggle button */