gimp r25874 - in trunk: . app/actions
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25874 - in trunk: . app/actions
- Date: Sat, 31 May 2008 20:05:03 +0000 (UTC)
Author: martinn
Date: Sat May 31 20:05:03 2008
New Revision: 25874
URL: http://svn.gnome.org/viewvc/gimp?rev=25874&view=rev
Log:
2008-05-31 Martin Nordholts <martinn svn gnome org>
Add keyboard shortcut support for reseting to default value of
e.g. brush scale. Fixes bug #493030.
* app/actions/actions.[ch]: Make action_select_value() take a
default-parameter and add support for it. Also use default_value
from gint and gdouble param specs.
* app/actions/actions-types.h: Added
GIMP_ACTION_SELECT_SET_TO_DEFAULT.
* app/actions/tools-actions.c: Add _SET_TO_DEFAULT actions.
* app/actions/view-commands.c:
* app/actions/layers-commands.c:
* app/actions/context-commands.c: Pass defaults to
action_select_property().
Modified:
trunk/ChangeLog
trunk/app/actions/actions-types.h
trunk/app/actions/actions.c
trunk/app/actions/actions.h
trunk/app/actions/context-commands.c
trunk/app/actions/layers-commands.c
trunk/app/actions/tools-actions.c
trunk/app/actions/view-commands.c
Modified: trunk/app/actions/actions-types.h
==============================================================================
--- trunk/app/actions/actions-types.h (original)
+++ trunk/app/actions/actions-types.h Sat May 31 20:05:03 2008
@@ -27,16 +27,17 @@
typedef enum
{
GIMP_ACTION_SELECT_SET = 0,
- GIMP_ACTION_SELECT_FIRST = -1,
- GIMP_ACTION_SELECT_LAST = -2,
- GIMP_ACTION_SELECT_SMALL_PREVIOUS = -3,
- GIMP_ACTION_SELECT_SMALL_NEXT = -4,
- GIMP_ACTION_SELECT_PREVIOUS = -5,
- GIMP_ACTION_SELECT_NEXT = -6,
- GIMP_ACTION_SELECT_SKIP_PREVIOUS = -7,
- GIMP_ACTION_SELECT_SKIP_NEXT = -8,
- GIMP_ACTION_SELECT_PERCENT_PREVIOUS = -9,
- GIMP_ACTION_SELECT_PERCENT_NEXT = -10
+ GIMP_ACTION_SELECT_SET_TO_DEFAULT = -1,
+ GIMP_ACTION_SELECT_FIRST = -2,
+ GIMP_ACTION_SELECT_LAST = -3,
+ GIMP_ACTION_SELECT_SMALL_PREVIOUS = -4,
+ GIMP_ACTION_SELECT_SMALL_NEXT = -5,
+ GIMP_ACTION_SELECT_PREVIOUS = -6,
+ GIMP_ACTION_SELECT_NEXT = -7,
+ GIMP_ACTION_SELECT_SKIP_PREVIOUS = -8,
+ GIMP_ACTION_SELECT_SKIP_NEXT = -9,
+ GIMP_ACTION_SELECT_PERCENT_PREVIOUS = -10,
+ GIMP_ACTION_SELECT_PERCENT_NEXT = -11
} GimpActionSelectType;
typedef enum
Modified: trunk/app/actions/actions.c
==============================================================================
--- trunk/app/actions/actions.c (original)
+++ trunk/app/actions/actions.c Sat May 31 20:05:03 2008
@@ -376,6 +376,7 @@
gdouble value,
gdouble min,
gdouble max,
+ gdouble def,
gdouble small_inc,
gdouble inc,
gdouble skip_inc,
@@ -384,6 +385,10 @@
{
switch (select_type)
{
+ case GIMP_ACTION_SELECT_SET_TO_DEFAULT:
+ value = def;
+ break;
+
case GIMP_ACTION_SELECT_FIRST:
value = min;
break;
@@ -477,6 +482,7 @@
value,
G_PARAM_SPEC_DOUBLE (pspec)->minimum,
G_PARAM_SPEC_DOUBLE (pspec)->maximum,
+ G_PARAM_SPEC_DOUBLE (pspec)->default_value,
small_inc, inc, skip_inc, 0, wrap);
g_object_set (object, property_name, value, NULL);
@@ -491,6 +497,7 @@
value,
G_PARAM_SPEC_INT (pspec)->minimum,
G_PARAM_SPEC_INT (pspec)->maximum,
+ G_PARAM_SPEC_INT (pspec)->default_value,
small_inc, inc, skip_inc, 0, wrap);
g_object_set (object, property_name, value, NULL);
Modified: trunk/app/actions/actions.h
==============================================================================
--- trunk/app/actions/actions.h (original)
+++ trunk/app/actions/actions.h Sat May 31 20:05:03 2008
@@ -36,6 +36,7 @@
gdouble value,
gdouble min,
gdouble max,
+ gdouble def,
gdouble small_inc,
gdouble inc,
gdouble skip_inc,
Modified: trunk/app/actions/context-commands.c
==============================================================================
--- trunk/app/actions/context-commands.c (original)
+++ trunk/app/actions/context-commands.c Sat May 31 20:05:03 2008
@@ -152,7 +152,7 @@
gimp_context_get_foreground (context, &color);
color.r = action_select_value ((GimpActionSelectType) value,
color.r,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
}
@@ -169,7 +169,7 @@
gimp_context_get_foreground (context, &color);
color.g = action_select_value ((GimpActionSelectType) value,
color.g,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
}
@@ -186,7 +186,7 @@
gimp_context_get_foreground (context, &color);
color.b = action_select_value ((GimpActionSelectType) value,
color.b,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
}
@@ -203,7 +203,7 @@
gimp_context_get_background (context, &color);
color.r = action_select_value ((GimpActionSelectType) value,
color.r,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
}
@@ -220,7 +220,7 @@
gimp_context_get_background (context, &color);
color.g = action_select_value ((GimpActionSelectType) value,
color.g,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
}
@@ -237,7 +237,7 @@
gimp_context_get_background (context, &color);
color.b = action_select_value ((GimpActionSelectType) value,
color.b,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
}
@@ -256,7 +256,7 @@
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value ((GimpActionSelectType) value,
hsv.h,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
@@ -276,7 +276,7 @@
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value ((GimpActionSelectType) value,
hsv.s,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
@@ -296,7 +296,7 @@
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value ((GimpActionSelectType) value,
hsv.v,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
@@ -316,7 +316,7 @@
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value ((GimpActionSelectType) value,
hsv.h,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
@@ -336,7 +336,7 @@
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value ((GimpActionSelectType) value,
hsv.s,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
@@ -356,7 +356,7 @@
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value ((GimpActionSelectType) value,
hsv.v,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
@@ -375,6 +375,7 @@
gimp_context_get_opacity (context),
GIMP_OPACITY_TRANSPARENT,
GIMP_OPACITY_OPAQUE,
+ GIMP_OPACITY_OPAQUE,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_opacity (context, opacity);
}
@@ -393,7 +394,7 @@
index = action_select_value ((GimpActionSelectType) value,
context_paint_mode_index (paint_mode),
- 0, G_N_ELEMENTS (paint_modes) - 1,
+ 0, G_N_ELEMENTS (paint_modes) - 1, 0,
0.0, 1.0, 1.0, 0.0, FALSE);
gimp_context_set_paint_mode (context, paint_modes[index]);
}
@@ -484,7 +485,7 @@
spacing = gimp_brush_get_spacing (brush);
spacing = action_select_value ((GimpActionSelectType) value,
spacing,
- 1.0, 5000.0,
+ 1.0, 5000.0, 20.0,
1.0, 5.0, 20.0, 0.0, FALSE);
gimp_brush_set_spacing (brush, spacing);
@@ -554,7 +555,7 @@
radius = action_select_value ((GimpActionSelectType) value,
radius,
- min_radius, 4000.0,
+ min_radius, 4000.0, min_radius,
0.1, 1.0, 10.0, 0.05, FALSE);
gimp_brush_generated_set_radius (generated, radius);
}
@@ -579,7 +580,7 @@
spikes = gimp_brush_generated_get_spikes (generated);
spikes = action_select_value ((GimpActionSelectType) value,
spikes,
- 2.0, 20.0,
+ 2.0, 20.0, 2.0,
0.0, 1.0, 4.0, 0.0, FALSE);
gimp_brush_generated_set_spikes (generated, spikes);
}
@@ -604,7 +605,7 @@
hardness = gimp_brush_generated_get_hardness (generated);
hardness = action_select_value ((GimpActionSelectType) value,
hardness,
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
0.001, 0.01, 0.1, 0.0, FALSE);
gimp_brush_generated_set_hardness (generated, hardness);
}
@@ -629,7 +630,7 @@
aspect = gimp_brush_generated_get_aspect_ratio (generated);
aspect = action_select_value ((GimpActionSelectType) value,
aspect,
- 1.0, 20.0,
+ 1.0, 20.0, 1.0,
0.1, 1.0, 4.0, 0.0, FALSE);
gimp_brush_generated_set_aspect_ratio (generated, aspect);
}
@@ -660,7 +661,7 @@
else
angle = action_select_value ((GimpActionSelectType) value,
angle,
- 0.0, 180.0,
+ 0.0, 180.0, 0.0,
0.1, 1.0, 15.0, 0.0, TRUE);
gimp_brush_generated_set_angle (generated, angle);
@@ -710,7 +711,7 @@
index = action_select_value (select_type,
index,
- 0, max,
+ 0, max, 0,
0, 1, 4, 0, FALSE);
context_set_color_index (index, use_colormap, use_palette, color);
Modified: trunk/app/actions/layers-commands.c
==============================================================================
--- trunk/app/actions/layers-commands.c (original)
+++ trunk/app/actions/layers-commands.c Sat May 31 20:05:03 2008
@@ -839,7 +839,7 @@
opacity = action_select_value ((GimpActionSelectType) value,
gimp_layer_get_opacity (layer),
- 0.0, 1.0,
+ 0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_layer_set_opacity (layer, opacity, push_undo);
gimp_image_flush (image);
@@ -868,7 +868,7 @@
index = action_select_value ((GimpActionSelectType) value,
layers_mode_index (layer_mode),
- 0, G_N_ELEMENTS (layer_modes) - 1,
+ 0, G_N_ELEMENTS (layer_modes) - 1, 0,
0.0, 1.0, 1.0, 0.0, FALSE);
gimp_layer_set_mode (layer, layer_modes[index], push_undo);
gimp_image_flush (image);
Modified: trunk/app/actions/tools-actions.c
==============================================================================
--- trunk/app/actions/tools-actions.c (original)
+++ trunk/app/actions/tools-actions.c Sat May 31 20:05:03 2008
@@ -347,6 +347,10 @@
"Set Value 1", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
+ { "tools-value-1-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
+ "Set Value 1 To Default", NULL, NULL,
+ GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
+ NULL },
{ "tools-value-1-minimum", GIMP_STOCK_TOOL_OPTIONS,
"Minimize Value 1", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
@@ -379,6 +383,10 @@
"Set Value 2", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
+ { "tools-value-2-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
+ "Set Value 2 To Default", NULL, NULL,
+ GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
+ NULL },
{ "tools-value-2-minimum", GIMP_STOCK_TOOL_OPTIONS,
"Minimize Value 2", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
@@ -411,6 +419,10 @@
"Set Value 3", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
+ { "tools-value-3-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
+ "Set Value 3 To Default", NULL, NULL,
+ GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
+ NULL },
{ "tools-value-3-minimum", GIMP_STOCK_TOOL_OPTIONS,
"Minimize Value 3", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
@@ -443,6 +455,10 @@
"Set Value 4", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
+ { "tools-value-4-set-to-default", GIMP_STOCK_TOOL_OPTIONS,
+ "Set Value 4 To Default", NULL, NULL,
+ GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
+ NULL },
{ "tools-value-4-minimum", GIMP_STOCK_TOOL_OPTIONS,
"Minimize Value 4", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
Modified: trunk/app/actions/view-commands.c
==============================================================================
--- trunk/app/actions/view-commands.c (original)
+++ trunk/app/actions/view-commands.c Sat May 31 20:05:03 2008
@@ -161,7 +161,7 @@
scale = action_select_value ((GimpActionSelectType) value,
scale,
- 0.0, 512.0,
+ 0.0, 512.0, 1.0,
1.0 / 8.0, 1.0, 16.0, 0.0,
FALSE);
@@ -259,6 +259,7 @@
shell->hsbdata->lower,
shell->hsbdata->upper -
shell->hsbdata->page_size,
+ shell->hsbdata->lower,
1,
shell->hsbdata->step_increment,
shell->hsbdata->page_increment,
@@ -284,6 +285,7 @@
shell->vsbdata->lower,
shell->vsbdata->upper -
shell->vsbdata->page_size,
+ shell->vsbdata->lower,
1,
shell->vsbdata->step_increment,
shell->vsbdata->page_increment,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]