[gimp] Bug 367388 - Small/percentage adjustment actions for tool-value and tip-sizes



commit 1d7dd157e23d5d41ba57da1bba00211db82844c5
Author: David Gowers <00ai99 gmail com>
Date:   Tue Jul 6 09:02:22 2010 +0930

    Bug 367388 - Small/percentage adjustment actions for tool-value and tip-sizes
    
    Implement actions for relative adjustment of tool values and brush
    sizes.

 app/actions/actions.c          |    5 ++-
 app/actions/actions.h          |    1 +
 app/actions/context-commands.c |   12 ++++----
 app/actions/tools-actions.c    |   59 ++++++++++++++++++++++++++++++++++++++++
 app/actions/tools-commands.c   |   18 ++++++------
 5 files changed, 78 insertions(+), 17 deletions(-)
---
diff --git a/app/actions/actions.c b/app/actions/actions.c
index 0bc37ac..084e8e6 100644
--- a/app/actions/actions.c
+++ b/app/actions/actions.c
@@ -547,6 +547,7 @@ action_select_property (GimpActionSelectType  select_type,
                         gdouble               small_inc,
                         gdouble               inc,
                         gdouble               skip_inc,
+                        gdouble               delta_factor,
                         gboolean              wrap)
 {
   GParamSpec *pspec;
@@ -569,7 +570,7 @@ action_select_property (GimpActionSelectType  select_type,
                                    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);
+                                   small_inc, inc, skip_inc, delta_factor, wrap);
 
       g_object_set (object, property_name, value, NULL);
 
@@ -595,7 +596,7 @@ action_select_property (GimpActionSelectType  select_type,
                                    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);
+                                   small_inc, inc, skip_inc, delta_factor, wrap);
 
       g_object_set (object, property_name, value, NULL);
 
diff --git a/app/actions/actions.h b/app/actions/actions.h
index 8a9c354..c6ac2df 100644
--- a/app/actions/actions.h
+++ b/app/actions/actions.h
@@ -50,6 +50,7 @@ void               action_select_property  (GimpActionSelectType  select_type,
                                             gdouble               small_inc,
                                             gdouble               inc,
                                             gdouble               skip_inc,
+                                            gdouble               delta_factor,
                                             gboolean              wrap);
 GimpObject       * action_select_object    (GimpActionSelectType  select_type,
                                             GimpContainer        *container,
diff --git a/app/actions/context-commands.c b/app/actions/context-commands.c
index 4bdf86b..88464a1 100644
--- a/app/actions/context-commands.c
+++ b/app/actions/context-commands.c
@@ -385,7 +385,7 @@ context_opacity_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "opacity",
-                              1.0 / 255.0, 0.01, 0.1, FALSE);
+                              1.0 / 255.0, 0.01, 0.1, 0.1, FALSE);
     }
 }
 
@@ -517,7 +517,7 @@ context_brush_spacing_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (brush),
                               "spacing",
-                              1.0, 5.0, 20.0, FALSE);
+                              1.0, 5.0, 20.0, 0.1, FALSE);
     }
 }
 
@@ -632,7 +632,7 @@ context_brush_spikes_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (brush),
                               "spikes",
-                              0.0, 1.0, 4.0, FALSE);
+                              0.0, 1.0, 4.0, 0.1, FALSE);
     }
 }
 
@@ -654,7 +654,7 @@ context_brush_hardness_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (brush),
                               "hardness",
-                              0.001, 0.01, 0.1, FALSE);
+                              0.001, 0.01, 0.1, 0.1, FALSE);
     }
 }
 
@@ -676,7 +676,7 @@ context_brush_aspect_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (brush),
                               "aspect-ratio",
-                              0.1, 1.0, 4.0, FALSE);
+                              0.1, 1.0, 4.0, 0.1, FALSE);
     }
 }
 
@@ -708,7 +708,7 @@ context_brush_angle_cmd_callback (GtkAction *action,
         angle = action_select_value ((GimpActionSelectType) value,
                                      angle,
                                      0.0, 180.0, 0.0,
-                                     0.1, 1.0, 15.0, 0.0, TRUE);
+                                     0.1, 1.0, 15.0, 0.1, TRUE);
 
       gimp_brush_generated_set_angle (generated, angle);
 
diff --git a/app/actions/tools-actions.c b/app/actions/tools-actions.c
index 027dbb7..544353f 100644
--- a/app/actions/tools-actions.c
+++ b/app/actions/tools-actions.c
@@ -172,6 +172,15 @@ static const GimpEnumActionEntry tools_paint_brush_angle_actions[] =
     "Increase Brush Angle More", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
+  { "tools-paint-brush-scale-decrease-percent", GIMP_STOCK_TOOL_PAINTBRUSH,
+    "Decrease Brush Scale Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
+    NULL },
+  { "tools-paint-brush-scale-increase-percent", GIMP_STOCK_TOOL_PAINTBRUSH,
+    "Increase Brush Scale Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
+    NULL },
+
 };
 
 static const GimpEnumActionEntry tools_paint_brush_aspect_ratio_actions[] =
@@ -240,6 +249,14 @@ static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
     "Increase Ink Blob Size More", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
+  { "tools-ink-blob-size-decrease-percent", GIMP_STOCK_TOOL_INK,
+    "Decrease Ink Blob Size Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
+    NULL },
+  { "tools-ink-blob-size-increase-percent", GIMP_STOCK_TOOL_INK,
+    "Increase Ink Blob Size Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
+    NULL },
 };
 
 static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
@@ -352,6 +369,16 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
     "Increase Foreground Select Brush Size More", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
+  { "tools-foreground-select-brush-size-decrease-percent",
+    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
+    "Decrease Foreground Select Brush Size Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
+    NULL },
+  { "tools-foreground-select-brush-size-increase-percent",
+    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
+    "Increase Foreground Select Brush Size", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
+    NULL },
 };
 
 static const GimpEnumActionEntry tools_transform_preview_opacity_actions[] =
@@ -423,6 +450,14 @@ static const GimpEnumActionEntry tools_value_1_actions[] =
     "Increase Value 1 More", "<control>greater", NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
+  { "tools-value-1-decrease-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Decrease Value 1 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
+    NULL },
+  { "tools-value-1-increase-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Increase Value 1 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
+    NULL },
 };
 
 /* tools-value-2 is effectively used to control
@@ -462,6 +497,14 @@ static const GimpEnumActionEntry tools_value_2_actions[] =
     "Increase Value 2 More", "<shift>bracketright", NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
+  { "tools-value-2-decrease-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Decrease Value 2 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
+    NULL },
+  { "tools-value-2-increase-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Increase Value 2 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
+    NULL },
 };
 
 static const GimpEnumActionEntry tools_value_3_actions[] =
@@ -498,6 +541,14 @@ static const GimpEnumActionEntry tools_value_3_actions[] =
     "Increase Value 3 More", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
+  { "tools-value-3-decrease-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Decrease Value 3 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
+    NULL },
+  { "tools-value-3-increase-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Increase Value 3 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
+    NULL },
 };
 
 static const GimpEnumActionEntry tools_value_4_actions[] =
@@ -534,6 +585,14 @@ static const GimpEnumActionEntry tools_value_4_actions[] =
     "Increase Value 4 More", NULL, NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
+  { "tools-value-4-decrease-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Decrease Value 4 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
+    NULL },
+  { "tools-value-4-increase-percent", GIMP_STOCK_TOOL_OPTIONS,
+    "Increase Value 4 Relative", NULL, NULL,
+    GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
+    NULL },
 };
 
 static const GimpEnumActionEntry tools_object_1_actions[] =
diff --git a/app/actions/tools-commands.c b/app/actions/tools-commands.c
index c06e38e..453dbfb 100644
--- a/app/actions/tools-commands.c
+++ b/app/actions/tools-commands.c
@@ -119,7 +119,7 @@ tools_color_average_radius_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "average-radius",
-                              1.0, 1.0, 10.0, FALSE);
+                              1.0, 1.0, 10.0, 0.1, FALSE);
     }
 }
 
@@ -140,7 +140,7 @@ tools_paint_brush_scale_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "brush-scale",
-                              0.01, 0.1, 1.0, FALSE);
+                              0.01, 0.1, 1.0, 0.1, FALSE);
     }
 }
 
@@ -161,7 +161,7 @@ tools_paint_brush_angle_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "brush-angle",
-                              0.1, 1.0, 15.0, TRUE);
+                              0.1, 1.0, 15.0, 0.1, TRUE);
     }
 }
 
@@ -182,7 +182,7 @@ tools_paint_brush_aspect_ratio_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "brush-aspect-ratio",
-                              0.01, 0.1, 1.0, TRUE);
+                              0.01, 0.1, 1.0, 0.1, TRUE);
     }
 }
 
@@ -203,7 +203,7 @@ tools_ink_blob_size_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "size",
-                              1.0, 1.0, 10.0, FALSE);
+                              1.0, 1.0, 10.0, 0.1, FALSE);
     }
 }
 
@@ -224,7 +224,7 @@ tools_ink_blob_aspect_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "blob-aspect",
-                              1.0, 0.1, 1.0, FALSE);
+                              1.0, 0.1, 1.0, 0.1, FALSE);
     }
 }
 
@@ -245,7 +245,7 @@ tools_ink_blob_angle_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "blob-angle",
-                              1.0, 1.0, 15.0, TRUE);
+                              1.0, 1.0, 15.0, 0.1, TRUE);
     }
 }
 
@@ -266,7 +266,7 @@ tools_fg_select_brush_size_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "stroke-width",
-                              1.0, 4.0, 16.0, FALSE);
+                              1.0, 4.0, 16.0, 0.1, FALSE);
     }
 }
 
@@ -287,7 +287,7 @@ tools_transform_preview_opacity_cmd_callback (GtkAction *action,
                               action_data_get_display (data),
                               G_OBJECT (tool_info->tool_options),
                               "preview-opacity",
-                              0.01, 0.1, 0.5, FALSE);
+                              0.01, 0.1, 0.5, 0.1, FALSE);
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]