Commit 492e1ab5 authored by Michael Natterer's avatar Michael Natterer 😴

app: reorder spacing after size in the new spacing override code/ui

parent 0c6848e7
......@@ -40,9 +40,9 @@
#define DEFAULT_BRUSH_SIZE 20.0
#define DEFAULT_BRUSH_SPACING 10.0
#define DEFAULT_BRUSH_ASPECT_RATIO 0.0
#define DEFAULT_BRUSH_ANGLE 0.0
#define DEFAULT_BRUSH_SPACING 10.0
#define DEFAULT_APPLICATION_MODE GIMP_PAINT_CONSTANT
#define DEFAULT_HARD FALSE
......@@ -78,9 +78,9 @@ enum
PROP_USE_APPLICATOR, /* temp debug */
PROP_BRUSH_SIZE,
PROP_BRUSH_SPACING,
PROP_BRUSH_ASPECT_RATIO,
PROP_BRUSH_ANGLE,
PROP_BRUSH_SPACING,
PROP_APPLICATION_MODE,
PROP_HARD,
......@@ -159,6 +159,11 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
1.0, 10000.0, DEFAULT_BRUSH_SIZE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_SPACING,
"brush-spacing", _("Brush Spacing"),
1.0, 5000.0, DEFAULT_BRUSH_SPACING,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_ASPECT_RATIO,
"brush-aspect-ratio", _("Brush Aspect Ratio"),
-20.0, 20.0, DEFAULT_BRUSH_ASPECT_RATIO,
......@@ -169,11 +174,6 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
-180.0, 180.0, DEFAULT_BRUSH_ANGLE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_SPACING,
"brush-spacing", _("Brush spacing"),
1.0, 5000.0, DEFAULT_BRUSH_SPACING,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_APPLICATION_MODE,
"application-mode", _("Every stamp has its own opacity"),
GIMP_TYPE_PAINT_APPLICATION_MODE,
......@@ -352,6 +352,10 @@ gimp_paint_options_set_property (GObject *object,
options->brush_size = g_value_get_double (value);
break;
case PROP_BRUSH_SPACING:
options->brush_spacing = g_value_get_double (value);
break;
case PROP_BRUSH_ASPECT_RATIO:
options->brush_aspect_ratio = g_value_get_double (value);
break;
......@@ -360,10 +364,6 @@ gimp_paint_options_set_property (GObject *object,
options->brush_angle = - 1.0 * g_value_get_double (value) / 360.0; /* let's make the angle mathematically correct */
break;
case PROP_BRUSH_SPACING:
options->brush_spacing = g_value_get_double (value);
break;
case PROP_APPLICATION_MODE:
options->application_mode = g_value_get_enum (value);
break;
......@@ -480,6 +480,10 @@ gimp_paint_options_get_property (GObject *object,
g_value_set_double (value, options->brush_size);
break;
case PROP_BRUSH_SPACING:
g_value_set_double (value, options->brush_spacing);
break;
case PROP_BRUSH_ASPECT_RATIO:
g_value_set_double (value, options->brush_aspect_ratio);
break;
......@@ -488,10 +492,6 @@ gimp_paint_options_get_property (GObject *object,
g_value_set_double (value, - 1.0 * options->brush_angle * 360.0); /* mathematically correct -> intuitively correct */
break;
case PROP_BRUSH_SPACING:
g_value_set_double (value, options->brush_spacing);
break;
case PROP_APPLICATION_MODE:
g_value_set_enum (value, options->application_mode);
break;
......@@ -784,7 +784,6 @@ gimp_paint_options_set_default_brush_spacing (GimpPaintOptions *paint_options,
if (brush)
{
g_object_set (paint_options,
"brush-spacing", (gdouble) gimp_brush_get_spacing (brush),
NULL);
......
......@@ -83,9 +83,9 @@ struct _GimpPaintOptions
gboolean use_applicator;
gdouble brush_size;
gdouble brush_spacing;
gdouble brush_angle;
gdouble brush_aspect_ratio;
gdouble brush_spacing;
GimpPaintApplicationMode application_mode;
GimpPaintApplicationMode application_mode_save;
......
......@@ -162,9 +162,11 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
scale = gimp_prop_spin_scale_new (config, "brush-aspect-ratio",
_("Aspect Ratio"),
0.1, 1.0, 2);
scale = gimp_prop_spin_scale_new (config, "brush-spacing",
_("Spacing"),
1.0, 10.0, 2);
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 1.0, 200.0);
gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (scale), 1.7);
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
gtk_widget_show (scale);
......@@ -176,19 +178,19 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_paint_options_gui_reset_aspect_ratio),
G_CALLBACK (gimp_paint_options_gui_reset_spacing),
options);
gimp_help_set_help_data (button,
_("Reset aspect ratio to brush's native"), NULL);
_("Reset size to brush's native spacing"), NULL);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
scale = gimp_prop_spin_scale_new (config, "brush-angle",
_("Angle"),
1.0, 5.0, 2);
scale = gimp_prop_spin_scale_new (config, "brush-aspect-ratio",
_("Aspect Ratio"),
0.1, 1.0, 2);
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
gtk_widget_show (scale);
......@@ -200,21 +202,19 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_paint_options_gui_reset_angle),
G_CALLBACK (gimp_paint_options_gui_reset_aspect_ratio),
options);
gimp_help_set_help_data (button,
_("Reset angle to zero"), NULL);
_("Reset aspect ratio to brush's native"), NULL);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
scale = gimp_prop_spin_scale_new (config, "brush-spacing",
_("Spacing"),
1.0, 10.0, 2);
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 1.0, 200.0);
gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (scale), 1.7);
scale = gimp_prop_spin_scale_new (config, "brush-angle",
_("Angle"),
1.0, 5.0, 2);
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
gtk_widget_show (scale);
......@@ -226,11 +226,11 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_paint_options_gui_reset_spacing),
G_CALLBACK (gimp_paint_options_gui_reset_angle),
options);
gimp_help_set_help_data (button,
_("Reset size to brush's native spacing"), NULL);
_("Reset angle to zero"), NULL);
button = gimp_prop_dynamics_box_new (NULL, GIMP_CONTEXT (tool_options),
_("Dynamics"), 2,
......@@ -442,7 +442,7 @@ gimp_paint_options_gui_reset_size (GtkWidget *button,
static void
gimp_paint_options_gui_reset_spacing (GtkWidget *button,
GimpPaintOptions *paint_options)
GimpPaintOptions *paint_options)
{
GimpBrush *brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment