gimp r25763 - in trunk: . app/tools
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25763 - in trunk: . app/tools
- Date: Thu, 22 May 2008 18:38:18 +0000 (UTC)
Author: mitch
Date: Thu May 22 18:38:18 2008
New Revision: 25763
URL: http://svn.gnome.org/viewvc/gimp?rev=25763&view=rev
Log:
2008-05-22 Michael Natterer <mitch gimp org>
* app/tools/gimppaintoptions-gui.c: factor out a utility function
that creates a dynamics check button.
Modified:
trunk/ChangeLog
trunk/app/tools/gimppaintoptions-gui.c
Modified: trunk/app/tools/gimppaintoptions-gui.c
==============================================================================
--- trunk/app/tools/gimppaintoptions-gui.c (original)
+++ trunk/app/tools/gimppaintoptions-gui.c Thu May 22 18:38:18 2008
@@ -377,6 +377,23 @@
return (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL));
}
+static GtkWidget *
+dynamics_check_button_new (GObject *config,
+ const gchar *property_name,
+ GtkTable *table,
+ gint column,
+ gint row)
+{
+ GtkWidget *button;
+
+ button = gimp_prop_check_button_new (config, property_name, NULL);
+ gtk_table_attach (table, button, column, column + 1, row, row + 1,
+ GTK_SHRINK, GTK_SHRINK, 0, 0);
+ gtk_widget_show (button);
+
+ return button;
+}
+
static void
pressure_options_gui (GimpPressureOptions *pressure,
GimpPaintOptions *paint_options,
@@ -392,11 +409,8 @@
/* the opacity toggle */
if (tool_has_opacity_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "pressure-opacity", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
+ button = dynamics_check_button_new (config, "pressure-opacity",
+ table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
labels[column - 1]);
@@ -406,11 +420,8 @@
/* the pressure toggle */
if (tool_has_pressure_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "pressure-hardness", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
+ button = dynamics_check_button_new (config, "pressure-hardness",
+ table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
labels[column - 1]);
@@ -420,11 +431,8 @@
/* the rate toggle */
if (tool_has_rate_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "pressure-rate", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
+ button = dynamics_check_button_new (config, "pressure-rate",
+ table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
labels[column - 1]);
@@ -435,13 +443,11 @@
if (tool_has_size_dynamics (tool_type))
{
if (tool_type != GIMP_TYPE_AIRBRUSH_TOOL)
- button = gimp_prop_check_button_new (config, "pressure-size", NULL);
+ button = dynamics_check_button_new (config, "pressure-size",
+ table, column, row);
else
- button = gimp_prop_check_button_new (config, "pressure-inverse-size", NULL);
-
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
+ button = dynamics_check_button_new (config, "pressure-inverse-size",
+ table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
@@ -452,11 +458,8 @@
/* the color toggle */
if (tool_has_color_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "pressure-color", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
+ button = dynamics_check_button_new (config, "pressure-color",
+ table, column, row);
g_signal_connect (button, "size-allocate",
G_CALLBACK (toggle_allocate),
labels[column - 1]);
@@ -471,67 +474,45 @@
GtkTable *table,
gint row)
{
- GObject *config = G_OBJECT (paint_options);
- GtkWidget *button;
- gint column = 1;
+ GObject *config = G_OBJECT (paint_options);
+ gint column = 1;
/* the opacity toggle */
if (tool_has_opacity_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "velocity-opacity", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "velocity-opacity",
+ table, column++, row);
}
/* the pressure toggle */
if (tool_has_pressure_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "velocity-hardness", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "velocity-hardness",
+ table, column++, row);
}
/* the rate toggle */
if (tool_has_rate_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "velocity-rate", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "velocity-rate",
+ table, column++, row);
}
/* the size toggle */
if (tool_has_size_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "velocity-size", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "velocity-size",
+ table, column++, row);
}
/* the color toggle */
if (tool_has_color_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "velocity-color", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "velocity-color",
+ table, column++, row);
}
}
-
static void
random_options_gui (GimpRandomOptions *random,
GimpPaintOptions *paint_options,
@@ -539,63 +520,42 @@
GtkTable *table,
gint row)
{
- GObject *config = G_OBJECT (paint_options);
- GtkWidget *button;
- gint column = 1;
+ GObject*config = G_OBJECT (paint_options);
+ gint column = 1;
/* the opacity toggle */
if (tool_has_opacity_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "random-opacity", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "random-opacity",
+ table, column++, row);
}
/* the pressure toggle */
if (tool_has_pressure_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "random-hardness", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "random-hardness",
+ table, column++, row);
}
/* the rate toggle */
if (tool_has_rate_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "random-rate", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "random-rate",
+ table, column++, row);
}
/* the size toggle */
if (tool_has_size_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "random-size", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "random-size",
+ table, column++, row);
}
/* the color toggle */
if (tool_has_color_dynamics (tool_type))
{
- button = gimp_prop_check_button_new (config, "random-color", NULL);
- gtk_table_attach (table, button, column, column + 1, row, row + 1,
- GTK_SHRINK, GTK_SHRINK, 0, 0);
- gtk_widget_show (button);
-
- column++;
+ dynamics_check_button_new (config, "random-color",
+ table, column++, row);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]