replace the pressure-expanded, velocity-expanded and random-expanded

2008-05-22  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintoptions.[ch]: replace the pressure-expanded,
	velocity-expanded and random-expanded properties by a single
	dynamics-expanded property.

	* app/tools/gimppaintoptions-gui.c: pack the toggle matrix into an
	expander, some cleanup.


svn path=/trunk/; revision=25765
This commit is contained in:
Michael Natterer 2008-05-22 19:06:51 +00:00 committed by Michael Natterer
parent 791638fb15
commit d66828c883
4 changed files with 54 additions and 56 deletions

View File

@ -1,3 +1,12 @@
2008-05-22 Michael Natterer <mitch@gimp.org>
* app/paint/gimppaintoptions.[ch]: replace the pressure-expanded,
velocity-expanded and random-expanded properties by a single
dynamics-expanded property.
* app/tools/gimppaintoptions-gui.c: pack the toggle matrix into an
expander, some cleanup.
2008-05-22 Michael Natterer <mitch@gimp.org>
* app/tools/gimppaintoptions-gui.c: revert accidential change of

View File

@ -38,7 +38,8 @@
#define DEFAULT_APPLICATION_MODE GIMP_PAINT_CONSTANT
#define DEFAULT_HARD FALSE
#define DEFAULT_PRESSURE_EXPANDED FALSE
#define DEFAULT_DYNAMICS_EXPANDED FALSE
#define DEFAULT_PRESSURE_OPACITY TRUE
#define DEFAULT_PRESSURE_HARDNESS FALSE
#define DEFAULT_PRESSURE_RATE FALSE
@ -46,7 +47,6 @@
#define DEFAULT_PRESSURE_INVERSE_SIZE FALSE
#define DEFAULT_PRESSURE_COLOR FALSE
#define DEFAULT_VELOCITY_EXPANDED FALSE
#define DEFAULT_VELOCITY_OPACITY FALSE
#define DEFAULT_VELOCITY_HARDNESS FALSE
#define DEFAULT_VELOCITY_RATE FALSE
@ -54,7 +54,6 @@
#define DEFAULT_VELOCITY_INVERSE_SIZE FALSE
#define DEFAULT_VELOCITY_COLOR FALSE
#define DEFAULT_RANDOM_EXPANDED FALSE
#define DEFAULT_RANDOM_OPACITY FALSE
#define DEFAULT_RANDOM_HARDNESS FALSE
#define DEFAULT_RANDOM_RATE FALSE
@ -85,7 +84,8 @@ enum
PROP_APPLICATION_MODE,
PROP_HARD,
PROP_PRESSURE_EXPANDED,
PROP_DYNAMICS_EXPANDED,
PROP_PRESSURE_OPACITY,
PROP_PRESSURE_HARDNESS,
PROP_PRESSURE_RATE,
@ -93,7 +93,6 @@ enum
PROP_PRESSURE_INVERSE_SIZE,
PROP_PRESSURE_COLOR,
PROP_VELOCITY_EXPANDED,
PROP_VELOCITY_OPACITY,
PROP_VELOCITY_HARDNESS,
PROP_VELOCITY_RATE,
@ -101,7 +100,6 @@ enum
PROP_VELOCITY_INVERSE_SIZE,
PROP_VELOCITY_COLOR,
PROP_RANDOM_EXPANDED,
PROP_RANDOM_OPACITY,
PROP_RANDOM_HARDNESS,
PROP_RANDOM_RATE,
@ -184,10 +182,11 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
DEFAULT_HARD,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_PRESSURE_EXPANDED,
"pressure-expanded", NULL,
DEFAULT_PRESSURE_EXPANDED,
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DYNAMICS_EXPANDED,
"dynamics-expanded", NULL,
DEFAULT_DYNAMICS_EXPANDED,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_PRESSURE_OPACITY,
"pressure-opacity", NULL,
DEFAULT_PRESSURE_OPACITY,
@ -213,10 +212,6 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
DEFAULT_PRESSURE_INVERSE_SIZE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_VELOCITY_EXPANDED,
"velocity-expanded", NULL,
DEFAULT_VELOCITY_EXPANDED,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_VELOCITY_OPACITY,
"velocity-opacity", NULL,
DEFAULT_VELOCITY_OPACITY,
@ -242,10 +237,6 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
DEFAULT_VELOCITY_INVERSE_SIZE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RANDOM_EXPANDED,
"random-expanded", NULL,
DEFAULT_RANDOM_EXPANDED,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RANDOM_OPACITY,
"random-opacity", NULL,
DEFAULT_RANDOM_OPACITY,
@ -413,9 +404,10 @@ gimp_paint_options_set_property (GObject *object,
options->hard = g_value_get_boolean (value);
break;
case PROP_PRESSURE_EXPANDED:
pressure_options->expanded = g_value_get_boolean (value);
case PROP_DYNAMICS_EXPANDED:
options->dynamics_expanded = g_value_get_boolean (value);
break;
case PROP_PRESSURE_OPACITY:
pressure_options->opacity = g_value_get_boolean (value);
break;
@ -435,9 +427,6 @@ gimp_paint_options_set_property (GObject *object,
pressure_options->color = g_value_get_boolean (value);
break;
case PROP_VELOCITY_EXPANDED:
velocity_options->expanded = g_value_get_boolean (value);
break;
case PROP_VELOCITY_OPACITY:
velocity_options->opacity = g_value_get_boolean (value);
break;
@ -457,9 +446,6 @@ gimp_paint_options_set_property (GObject *object,
velocity_options->color = g_value_get_boolean (value);
break;
case PROP_RANDOM_EXPANDED:
random_options->expanded = g_value_get_boolean (value);
break;
case PROP_RANDOM_OPACITY:
random_options->opacity = g_value_get_boolean (value);
break;
@ -569,9 +555,10 @@ gimp_paint_options_get_property (GObject *object,
g_value_set_boolean (value, options->hard);
break;
case PROP_PRESSURE_EXPANDED:
g_value_set_boolean (value, pressure_options->expanded);
case PROP_DYNAMICS_EXPANDED:
g_value_set_boolean (value, options->dynamics_expanded);
break;
case PROP_PRESSURE_OPACITY:
g_value_set_boolean (value, pressure_options->opacity);
break;
@ -591,9 +578,6 @@ gimp_paint_options_get_property (GObject *object,
g_value_set_boolean (value, pressure_options->color);
break;
case PROP_VELOCITY_EXPANDED:
g_value_set_boolean (value, velocity_options->expanded);
break;
case PROP_VELOCITY_OPACITY:
g_value_set_boolean (value, velocity_options->opacity);
break;
@ -613,9 +597,6 @@ gimp_paint_options_get_property (GObject *object,
g_value_set_boolean (value, velocity_options->color);
break;
case PROP_RANDOM_EXPANDED:
g_value_set_boolean (value, random_options->expanded);
break;
case PROP_RANDOM_OPACITY:
g_value_set_boolean (value, random_options->opacity);
break;

View File

@ -39,7 +39,6 @@ typedef struct _GimpGradientOptions GimpGradientOptions;
struct _GimpPressureOptions
{
gboolean expanded;
gboolean opacity;
gboolean hardness;
gboolean rate;
@ -50,7 +49,6 @@ struct _GimpPressureOptions
struct _GimpVelocityOptions
{
gboolean expanded;
gboolean opacity;
gboolean hardness;
gboolean rate;
@ -61,7 +59,6 @@ struct _GimpVelocityOptions
struct _GimpRandomOptions
{
gboolean expanded;
gboolean opacity;
gboolean hardness;
gboolean rate;
@ -118,9 +115,11 @@ struct _GimpPaintOptions
gboolean hard;
gboolean dynamics_expanded;
GimpPressureOptions *pressure_options;
GimpVelocityOptions *velocity_options;
GimpRandomOptions *random_options;
GimpFadeOptions *fade_options;
GimpJitterOptions *jitter_options;
GimpGradientOptions *gradient_options;

View File

@ -87,20 +87,6 @@ static GtkWidget * jitter_options_gui (GimpJitterOptions *jitter,
/* public functions */
static void
toggle_allocate (GtkWidget *toggle,
GtkAllocation *allocation,
GtkWidget *label)
{
gint x;
gint y;
x = toggle->allocation.x + toggle->allocation.width - label->allocation.width;
y = label->parent->allocation.height - label->allocation.height;
gtk_fixed_move (GTK_FIXED (label->parent), label, x, y);
}
GtkWidget *
gimp_paint_options_gui (GimpToolOptions *tool_options)
{
@ -212,11 +198,21 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
if (n_dynamics > 0)
{
GtkWidget *inner_frame;
GtkWidget *fixed;
gint i;
frame = gimp_prop_expander_new (config, "dynamics-expanded",
_("Dynamics sensitivity"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
inner_frame = gimp_frame_new ("<expander>");
gtk_container_add (GTK_CONTAINER (frame), inner_frame);
gtk_widget_show (inner_frame);
table = gtk_table_new (4, n_dynamics + 1, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (inner_frame), table);
gtk_widget_show (table);
label = gtk_label_new (_("Pressure:"));
@ -394,6 +390,19 @@ dynamics_check_button_new (GObject *config,
return button;
}
static void
dynamics_check_button_size_allocate (GtkWidget *toggle,
GtkAllocation *allocation,
GtkWidget *label)
{
GtkWidget *fixed = label->parent;
gint x = (allocation->x + allocation->width -
label->allocation.width - fixed->allocation.x);
gint y = (fixed->allocation.height - label->allocation.height);
gtk_fixed_move (GTK_FIXED (fixed), label, x, y);
}
static void
pressure_options_gui (GimpPressureOptions *pressure,
GimpPaintOptions *paint_options,
@ -411,7 +420,7 @@ pressure_options_gui (GimpPressureOptions *pressure,
button = dynamics_check_button_new (config, "pressure-opacity",
table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
G_CALLBACK (dynamics_check_button_size_allocate),
labels[column - 1]);
column++;
}
@ -421,7 +430,7 @@ pressure_options_gui (GimpPressureOptions *pressure,
button = dynamics_check_button_new (config, "pressure-hardness",
table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
G_CALLBACK (dynamics_check_button_size_allocate),
labels[column - 1]);
column++;
}
@ -431,7 +440,7 @@ pressure_options_gui (GimpPressureOptions *pressure,
button = dynamics_check_button_new (config, "pressure-rate",
table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
G_CALLBACK (dynamics_check_button_size_allocate),
labels[column - 1]);
column++;
}
@ -446,7 +455,7 @@ pressure_options_gui (GimpPressureOptions *pressure,
table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
G_CALLBACK (dynamics_check_button_size_allocate),
labels[column - 1]);
column++;
}
@ -456,7 +465,7 @@ pressure_options_gui (GimpPressureOptions *pressure,
button = dynamics_check_button_new (config, "pressure-color",
table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
G_CALLBACK (dynamics_check_button_size_allocate),
labels[column - 1]);
column++;
}