Commit e8df1643 authored by Alexia Death's avatar Alexia Death

app: Add dynamics selector to the tool options

parent a27b6f5f
......@@ -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;
......
......@@ -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;
......
......@@ -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:"),
......
......@@ -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 */
......
......@@ -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,
......
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