[gimp] app: Add dynamics selector to the tool options
- From: Alexia Death <alexiade src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: Add dynamics selector to the tool options
- Date: Wed, 27 Oct 2010 18:49:50 +0000 (UTC)
commit e8df16436609930480b9aff51eb6cf4689334b7d
Author: Alexia Death <alexiadeath gmail com>
Date: Wed Oct 27 21:48:17 2010 +0300
app: Add dynamics selector to the tool options
app/paint/gimppaintoptions.c | 30 ++++++++++++++++++++
app/paint/gimppaintoptions.h | 2 +
app/tools/gimppaintoptions-gui.c | 8 +++++-
app/widgets/gimpviewablebox.c | 55 ++++++++++++++++++++++++++++++++++++++
app/widgets/gimpviewablebox.h | 8 +++++
5 files changed, 102 insertions(+), 1 deletions(-)
---
diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c
index 910c43e..1bb3b5a 100644
--- a/app/paint/gimppaintoptions.c
+++ b/app/paint/gimppaintoptions.c
@@ -89,6 +89,8 @@ enum
PROP_BRUSH_VIEW_TYPE,
PROP_BRUSH_VIEW_SIZE,
+ PROP_DYNAMICS_VIEW_TYPE,
+ PROP_DYNAMICS_VIEW_SIZE,
PROP_PATTERN_VIEW_TYPE,
PROP_PATTERN_VIEW_SIZE,
PROP_GRADIENT_VIEW_TYPE,
@@ -209,6 +211,18 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
GIMP_VIEW_SIZE_SMALL,
GIMP_PARAM_STATIC_STRINGS);
+ GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_DYNAMICS_VIEW_TYPE,
+ "dynamics-view-type", NULL,
+ GIMP_TYPE_VIEW_TYPE,
+ GIMP_VIEW_TYPE_LIST,
+ GIMP_PARAM_STATIC_STRINGS);
+ GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DYNAMICS_VIEW_SIZE,
+ "dynamics-view-size", NULL,
+ GIMP_VIEW_SIZE_TINY,
+ GIMP_VIEWABLE_MAX_BUTTON_SIZE,
+ GIMP_VIEW_SIZE_SMALL,
+ GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_PATTERN_VIEW_TYPE,
"pattern-view-type", NULL,
GIMP_TYPE_VIEW_TYPE,
@@ -351,6 +365,14 @@ gimp_paint_options_set_property (GObject *object,
options->brush_view_size = g_value_get_int (value);
break;
+ case PROP_DYNAMICS_VIEW_TYPE:
+ options->dynamics_view_type = g_value_get_enum (value);
+ break;
+
+ case PROP_DYNAMICS_VIEW_SIZE:
+ options->dynamics_view_size = g_value_get_int (value);
+ break;
+
case PROP_PATTERN_VIEW_TYPE:
options->pattern_view_type = g_value_get_enum (value);
break;
@@ -454,6 +476,14 @@ gimp_paint_options_get_property (GObject *object,
g_value_set_int (value, options->brush_view_size);
break;
+ case PROP_DYNAMICS_VIEW_TYPE:
+ g_value_set_enum (value, options->dynamics_view_type);
+ break;
+
+ case PROP_DYNAMICS_VIEW_SIZE:
+ g_value_set_int (value, options->dynamics_view_size);
+ break;
+
case PROP_PATTERN_VIEW_TYPE:
g_value_set_enum (value, options->pattern_view_type);
break;
diff --git a/app/paint/gimppaintoptions.h b/app/paint/gimppaintoptions.h
index d1ef0e0..ff2ee5b 100644
--- a/app/paint/gimppaintoptions.h
+++ b/app/paint/gimppaintoptions.h
@@ -89,6 +89,8 @@ struct _GimpPaintOptions
GimpViewType brush_view_type;
GimpViewSize brush_view_size;
+ GimpViewType dynamics_view_type;
+ GimpViewSize dynamics_view_size;
GimpViewType pattern_view_type;
GimpViewSize pattern_view_size;
GimpViewType gradient_view_type;
diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c
index 4d724a5..c0c6f9b 100644
--- a/app/tools/gimppaintoptions-gui.c
+++ b/app/tools/gimppaintoptions-gui.c
@@ -76,7 +76,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
tool_type = tool_options->tool_info->tool_type;
/* the main table */
- table = gtk_table_new (3, 3, FALSE);
+ table = gtk_table_new (3, 4, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
@@ -118,6 +118,12 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
_("Brush:"), 0.0, 0.5,
button, 2, FALSE);
+ button = gimp_prop_dynamics_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
+ "dynamics-view-type", "dynamics-view-size");
+ gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
+ _("Dynamics:"), 0.0, 0.5,
+ button, 2, FALSE);
+
adj_scale = gimp_prop_scale_entry_new (config, "brush-scale",
GTK_TABLE (table), 0, table_row++,
_("Scale:"),
diff --git a/app/widgets/gimpviewablebox.c b/app/widgets/gimpviewablebox.c
index 21172fd..29e549e 100644
--- a/app/widgets/gimpviewablebox.c
+++ b/app/widgets/gimpviewablebox.c
@@ -117,6 +117,61 @@ gimp_prop_brush_box_new (GimpContainer *container,
view_type_prop, view_size_prop);
}
+/* dynamics boxes */
+
+static GtkWidget *
+dynamics_box_new (GimpContainer *container,
+ GimpContext *context,
+ gint spacing,
+ GimpViewSize view_size)
+{
+ if (! container)
+ container = gimp_data_factory_get_container (context->gimp->dynamics_factory);
+
+ return gimp_viewable_box_new (container, context, spacing,
+ GIMP_VIEW_TYPE_LIST, GIMP_VIEW_SIZE_SMALL, view_size,
+ "gimp-dynamics-list",
+ GIMP_STOCK_DYNAMICS,
+ _("Open the dynamics selection dialog"));
+}
+
+GtkWidget *
+gimp_dynamics_box_new (GimpContainer *container,
+ GimpContext *context,
+ gint spacing)
+{
+ g_return_val_if_fail (container == NULL || GIMP_IS_CONTAINER (container),
+ NULL);
+ g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
+
+ return dynamics_box_new (container, context, spacing,
+ GIMP_VIEW_SIZE_SMALL);
+}
+GtkWidget *
+gimp_prop_dynamics_box_new (GimpContainer *container,
+ GimpContext *context,
+ gint spacing,
+ const gchar *view_type_prop,
+ const gchar *view_size_prop)
+{
+ GimpViewType view_type;
+ GimpViewSize view_size;
+
+ g_return_val_if_fail (container == NULL || GIMP_IS_CONTAINER (container),
+ NULL);
+ g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
+
+ g_object_get (context,
+ view_type_prop, &view_type,
+ view_size_prop, &view_size,
+ NULL);
+
+ return view_props_connect (dynamics_box_new (container, context,
+ spacing, view_size),
+ context,
+ view_type_prop, view_size_prop);
+}
+
/* pattern boxes */
diff --git a/app/widgets/gimpviewablebox.h b/app/widgets/gimpviewablebox.h
index 896c9b2..4cb6759 100644
--- a/app/widgets/gimpviewablebox.h
+++ b/app/widgets/gimpviewablebox.h
@@ -27,6 +27,14 @@ GtkWidget * gimp_prop_brush_box_new (GimpContainer *container,
gint spacing,
const gchar *view_type_prop,
const gchar *view_size_prop);
+GtkWidget * gimp_dynamics_box_new (GimpContainer *container,
+ GimpContext *context,
+ gint spacing);
+GtkWidget * gimp_prop_dynamics_box_new (GimpContainer *container,
+ GimpContext *context,
+ gint spacing,
+ const gchar *view_type_prop,
+ const gchar *view_size_prop);
GtkWidget * gimp_pattern_box_new (GimpContainer *container,
GimpContext *context,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]