mirror of https://github.com/GNOME/gimp.git
app: make the brush, pattern etc selecing boxes more compact
by integrating their label instead of requiring one externally. This way we get rid of some more labels in the tool options. Also clean up tool options further (add more spin scales, and some general reordering and spacing cleanup).
This commit is contained in:
parent
0e7db27926
commit
8f991c5950
|
@ -387,7 +387,7 @@ convert_dialog_palette_box (IndexedDialog *dialog)
|
|||
G_CALLBACK (convert_dialog_palette_changed),
|
||||
dialog);
|
||||
|
||||
return gimp_palette_box_new (dialog->container, dialog->context, 4);
|
||||
return gimp_palette_box_new (dialog->container, dialog->context, NULL, 4);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -202,41 +202,35 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
|
|||
GtkWidget *table;
|
||||
GtkWidget *vbox2;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *scale;
|
||||
GtkWidget *combo;
|
||||
GtkWidget *button;
|
||||
GtkWidget *scale;
|
||||
|
||||
table = g_object_get_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY);
|
||||
|
||||
/* the gradient */
|
||||
button = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
|
||||
button = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (tool_options),
|
||||
_("Gradient"), 2,
|
||||
"gradient-view-type",
|
||||
"gradient-view-size",
|
||||
"gradient-reverse");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||
_("Gradient:"), 0.0, 0.5,
|
||||
button, 2, TRUE);
|
||||
|
||||
/* the offset scale */
|
||||
gimp_prop_scale_entry_new (config, "offset",
|
||||
GTK_TABLE (table), 0, 3,
|
||||
_("Offset:"),
|
||||
1.0, 10.0, 1,
|
||||
FALSE, 0.0, 0.0);
|
||||
gtk_table_attach (GTK_TABLE (table), button, 0, 3, 2, 3,
|
||||
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* the gradient type menu */
|
||||
combo = gimp_prop_enum_combo_box_new (config, "gradient-type", 0, 0);
|
||||
g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||
gimp_enum_combo_box_set_stock_prefix (GIMP_ENUM_COMBO_BOX (combo),
|
||||
"gimp-gradient");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
|
||||
_("Shape:"), 0.0, 0.5,
|
||||
combo, 2, FALSE);
|
||||
|
||||
/* the repeat option */
|
||||
combo = gimp_prop_enum_combo_box_new (config, "gradient-repeat", 0, 0);
|
||||
g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 5,
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
|
||||
_("Repeat:"), 0.0, 0.5,
|
||||
combo, 2, FALSE);
|
||||
|
||||
|
@ -244,6 +238,16 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
|
|||
G_CALLBACK (blend_options_gradient_type_notify),
|
||||
combo);
|
||||
|
||||
/* the offset scale */
|
||||
scale = gimp_prop_spin_scale_new (config, "offset",
|
||||
_("Offset"),
|
||||
1.0, 10.0, 1);
|
||||
gtk_table_attach (GTK_TABLE (table), scale,
|
||||
0, 3, 5, 6,
|
||||
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
/* the dither toggle */
|
||||
button = gimp_prop_check_button_new (config, "dither",
|
||||
_("Dithering"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
|
|
@ -232,7 +232,8 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
|
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
|
||||
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options),
|
||||
NULL, 2,
|
||||
"pattern-view-type", "pattern-view-size");
|
||||
gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
|
||||
GIMP_PATTERN_BUCKET_FILL, TRUE);
|
||||
|
|
|
@ -114,7 +114,8 @@ gimp_clone_options_gui (GimpToolOptions *tool_options)
|
|||
gimp_enum_radio_frame_add (GTK_FRAME (frame), button,
|
||||
GIMP_IMAGE_CLONE, TRUE);
|
||||
|
||||
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
|
||||
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options),
|
||||
NULL, 2,
|
||||
"pattern-view-type", "pattern-view-size");
|
||||
gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
|
||||
GIMP_PATTERN_CLONE, TRUE);
|
||||
|
|
|
@ -123,17 +123,24 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
|
|||
{
|
||||
GtkObject *adj;
|
||||
|
||||
button = gimp_prop_brush_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
|
||||
button = gimp_prop_brush_box_new (NULL, GIMP_CONTEXT (tool_options),
|
||||
_("Brush"), 2,
|
||||
"brush-view-type", "brush-view-size");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
|
||||
_("Brush:"), 0.0, 0.5,
|
||||
button, 2, FALSE);
|
||||
gtk_table_attach (GTK_TABLE (table), button,
|
||||
0, 3, table_row, table_row + 1,
|
||||
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show (button);
|
||||
table_row++;
|
||||
|
||||
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);
|
||||
button = gimp_prop_dynamics_box_new (NULL, GIMP_CONTEXT (tool_options),
|
||||
_("Dynamics"), 2,
|
||||
"dynamics-view-type",
|
||||
"dynamics-view-size");
|
||||
gtk_table_attach (GTK_TABLE (table), button,
|
||||
0, 3, table_row, table_row + 1,
|
||||
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show (button);
|
||||
table_row++;
|
||||
|
||||
adj = gimp_prop_scale_entry_new (config, "brush-size",
|
||||
GTK_TABLE (table), 0, table_row++,
|
||||
|
@ -305,16 +312,19 @@ gradient_options_gui (GimpPaintOptions *paint_options,
|
|||
{
|
||||
GObject *config = G_OBJECT (paint_options);
|
||||
GtkWidget *frame;
|
||||
GtkWidget *table;
|
||||
GtkWidget *box;
|
||||
GtkWidget *button;
|
||||
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
/* the gradient view */
|
||||
box = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (config),
|
||||
_("Gradient"), 2,
|
||||
"gradient-view-type",
|
||||
"gradient-view-size",
|
||||
"gradient-reverse");
|
||||
|
||||
frame = gimp_prop_expanding_frame_new (config, "use-gradient",
|
||||
_("Use color from gradient"),
|
||||
table, &button);
|
||||
box, &button);
|
||||
|
||||
if (incremental_toggle)
|
||||
{
|
||||
|
@ -324,15 +334,6 @@ gradient_options_gui (GimpPaintOptions *paint_options,
|
|||
incremental_toggle);
|
||||
}
|
||||
|
||||
/* the gradient view */
|
||||
button = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (config), 2,
|
||||
"gradient-view-type",
|
||||
"gradient-view-size",
|
||||
"gradient-reverse");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Gradient:"), 0.0, 0.5,
|
||||
button, 2, TRUE);
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
|
|
@ -952,7 +952,8 @@ gimp_perspective_clone_options_gui (GimpToolOptions *tool_options)
|
|||
gimp_enum_radio_frame_add (GTK_FRAME (frame), button,
|
||||
GIMP_IMAGE_CLONE, TRUE);
|
||||
|
||||
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
|
||||
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options),
|
||||
NULL, 2,
|
||||
"pattern-view-type", "pattern-view-size");
|
||||
gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
|
||||
GIMP_PATTERN_CLONE, TRUE);
|
||||
|
|
|
@ -209,22 +209,20 @@ gimp_region_select_options_gui (GimpToolOptions *tool_options)
|
|||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
table = gtk_table_new (2, 3, FALSE);
|
||||
/* the threshold scale */
|
||||
scale = gimp_prop_spin_scale_new (config, "threshold",
|
||||
_("Threshold"),
|
||||
1.0, 16.0, 1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
/* the select criterion combo */
|
||||
table = gtk_table_new (1, 3, 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);
|
||||
gtk_widget_show (table);
|
||||
|
||||
/* the threshold scale */
|
||||
scale = gimp_prop_spin_scale_new (config, "threshold",
|
||||
_("Threshold"),
|
||||
1.0, 16.0, 1);
|
||||
gtk_table_attach (GTK_TABLE (table), scale,
|
||||
0, 3, 0, 1,
|
||||
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
/* the select criterion combo */
|
||||
combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("Select by:"), 0.0, 0.5,
|
||||
|
|
|
@ -470,18 +470,18 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
|
|||
GtkSizeGroup *size_group;
|
||||
gint row = 0;
|
||||
|
||||
table = gtk_table_new (2, 3, FALSE);
|
||||
hbox = gimp_prop_font_box_new (NULL, GIMP_CONTEXT (tool_options),
|
||||
_("Font"), 2,
|
||||
"font-view-type", "font-view-size");
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
table = gtk_table_new (1, 3, 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 (main_vbox), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
hbox = gimp_prop_font_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
|
||||
"font-view-type", "font-view-size");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, row++,
|
||||
_("Font:"), 0.0, 0.5,
|
||||
hbox, 2, FALSE);
|
||||
|
||||
entry = gimp_prop_size_entry_new (config,
|
||||
"font-size", FALSE, "font-size-unit", "%a",
|
||||
GIMP_SIZE_ENTRY_UPDATE_SIZE, 72.0);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimppropwidgets.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "gimprotatetool.h"
|
||||
|
@ -260,8 +261,8 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
|
|||
GtkWidget *box;
|
||||
GtkWidget *label;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *table;
|
||||
GtkWidget *combo;
|
||||
GtkWidget *scale;
|
||||
GtkWidget *preview_box;
|
||||
const gchar *constrain = NULL;
|
||||
|
||||
|
@ -322,66 +323,41 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
|
|||
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
|
||||
gtk_widget_show (combo);
|
||||
|
||||
preview_box = gtk_vbox_new (FALSE, 6);
|
||||
preview_box = gtk_vbox_new (FALSE, 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), preview_box);
|
||||
gtk_widget_show (preview_box);
|
||||
|
||||
/* the preview opacity scale */
|
||||
table = gtk_table_new (1, 3, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_box_pack_start (GTK_BOX (preview_box), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
gtk_widget_set_sensitive (table,
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE ||
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID);
|
||||
scale = gimp_prop_opacity_spin_scale_new (config, "preview-opacity",
|
||||
_("Opacity"));
|
||||
gtk_box_pack_start (GTK_BOX (preview_box), scale, FALSE, FALSE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
g_signal_connect (config, "notify::preview-type",
|
||||
G_CALLBACK (gimp_transform_options_preview_opacity_notify),
|
||||
table);
|
||||
|
||||
gimp_prop_opacity_entry_new (config, "preview-opacity",
|
||||
GTK_TABLE (table), 0, 0,
|
||||
_("Opacity:"));
|
||||
scale);
|
||||
gimp_transform_options_preview_opacity_notify (options, NULL, scale);
|
||||
|
||||
/* the grid type menu */
|
||||
combo = gimp_prop_enum_combo_box_new (config, "grid-type", 0, 0);
|
||||
gtk_box_pack_start (GTK_BOX (preview_box), combo, FALSE, FALSE, 0);
|
||||
gtk_widget_show (combo);
|
||||
|
||||
/* the grid density scale */
|
||||
table = gtk_table_new (1, 3, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_box_pack_start (GTK_BOX (preview_box), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
gtk_widget_set_sensitive (combo,
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_GRID ||
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID);
|
||||
|
||||
g_signal_connect (config, "notify::preview-type",
|
||||
G_CALLBACK (gimp_transform_options_preview_notify),
|
||||
combo);
|
||||
gimp_transform_options_preview_notify (options, NULL, combo);
|
||||
|
||||
gtk_widget_set_sensitive (table,
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_GRID ||
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE_GRID);
|
||||
/* the grid density scale */
|
||||
scale = gimp_prop_spin_scale_new (config, "grid-size", NULL,
|
||||
1.8, 8.0, 0);
|
||||
gtk_box_pack_start (GTK_BOX (preview_box), scale, FALSE, FALSE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
g_signal_connect (config, "notify::preview-type",
|
||||
G_CALLBACK (gimp_transform_options_preview_notify),
|
||||
table);
|
||||
|
||||
gimp_prop_scale_entry_new (config, "grid-size",
|
||||
GTK_TABLE (table), 0, 0,
|
||||
NULL,
|
||||
1.0, 8.0, 0,
|
||||
FALSE, 0.0, 0.0);
|
||||
scale);
|
||||
gimp_transform_options_preview_notify (options, NULL, scale);
|
||||
|
||||
if (tool_options->tool_info->tool_type == GIMP_TYPE_ROTATE_TOOL)
|
||||
{
|
||||
|
@ -416,9 +392,9 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
|
|||
static void
|
||||
gimp_transform_options_preview_notify (GimpTransformOptions *options,
|
||||
GParamSpec *pspec,
|
||||
GtkWidget *box)
|
||||
GtkWidget *widget)
|
||||
{
|
||||
gtk_widget_set_sensitive (box,
|
||||
gtk_widget_set_sensitive (widget,
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_GRID ||
|
||||
options->preview_type ==
|
||||
|
@ -428,9 +404,9 @@ gimp_transform_options_preview_notify (GimpTransformOptions *options,
|
|||
static void
|
||||
gimp_transform_options_preview_opacity_notify (GimpTransformOptions *options,
|
||||
GParamSpec *pspec,
|
||||
GtkWidget *table)
|
||||
GtkWidget *widget)
|
||||
{
|
||||
gtk_widget_set_sensitive (table,
|
||||
gtk_widget_set_sensitive (widget,
|
||||
options->preview_type ==
|
||||
GIMP_TRANSFORM_PREVIEW_TYPE_IMAGE ||
|
||||
options->preview_type ==
|
||||
|
|
|
@ -136,7 +136,8 @@ gimp_fill_editor_constructor (GType type,
|
|||
GIMP_FILL_STYLE_SOLID, FALSE);
|
||||
|
||||
pattern_box = gimp_prop_pattern_box_new (NULL,
|
||||
GIMP_CONTEXT (editor->options), 2,
|
||||
GIMP_CONTEXT (editor->options),
|
||||
NULL, 2,
|
||||
"pattern-view-type",
|
||||
"pattern-view-size");
|
||||
gimp_enum_radio_box_add (GTK_BOX (box), pattern_box,
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
static GtkWidget * gimp_viewable_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
GimpViewType view_type,
|
||||
GimpViewType button_view_size,
|
||||
|
@ -66,6 +67,7 @@ static void gimp_gradient_box_reverse_notify (GObject *object,
|
|||
static GtkWidget *
|
||||
brush_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
GimpViewType view_type,
|
||||
GimpViewSize view_size)
|
||||
|
@ -73,7 +75,7 @@ brush_box_new (GimpContainer *container,
|
|||
if (! container)
|
||||
container = gimp_data_factory_get_container (context->gimp->brush_factory);
|
||||
|
||||
return gimp_viewable_box_new (container, context, spacing,
|
||||
return gimp_viewable_box_new (container, context, label, spacing,
|
||||
view_type, GIMP_VIEW_SIZE_SMALL, view_size,
|
||||
"gimp-brush-grid|gimp-brush-list",
|
||||
GIMP_STOCK_BRUSH,
|
||||
|
@ -83,18 +85,21 @@ brush_box_new (GimpContainer *container,
|
|||
GtkWidget *
|
||||
gimp_brush_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
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 brush_box_new (container, context, spacing,
|
||||
return brush_box_new (container, context, label, spacing,
|
||||
GIMP_VIEW_TYPE_GRID, GIMP_VIEW_SIZE_SMALL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_prop_brush_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop)
|
||||
|
@ -111,7 +116,7 @@ gimp_prop_brush_box_new (GimpContainer *container,
|
|||
view_size_prop, &view_size,
|
||||
NULL);
|
||||
|
||||
return view_props_connect (brush_box_new (container, context, spacing,
|
||||
return view_props_connect (brush_box_new (container, context, label, spacing,
|
||||
view_type, view_size),
|
||||
context,
|
||||
view_type_prop, view_size_prop);
|
||||
|
@ -122,13 +127,14 @@ gimp_prop_brush_box_new (GimpContainer *container,
|
|||
static GtkWidget *
|
||||
dynamics_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
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,
|
||||
return gimp_viewable_box_new (container, context, label, spacing,
|
||||
GIMP_VIEW_TYPE_LIST, GIMP_VIEW_SIZE_SMALL, view_size,
|
||||
"gimp-dynamics-list",
|
||||
GIMP_STOCK_DYNAMICS,
|
||||
|
@ -137,19 +143,22 @@ dynamics_box_new (GimpContainer *container,
|
|||
|
||||
GtkWidget *
|
||||
gimp_dynamics_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
gint spacing)
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
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,
|
||||
return dynamics_box_new (container, context, label, spacing,
|
||||
GIMP_VIEW_SIZE_SMALL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_prop_dynamics_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop)
|
||||
|
@ -166,7 +175,7 @@ gimp_prop_dynamics_box_new (GimpContainer *container,
|
|||
view_size_prop, &view_size,
|
||||
NULL);
|
||||
|
||||
return view_props_connect (dynamics_box_new (container, context,
|
||||
return view_props_connect (dynamics_box_new (container, context, label,
|
||||
spacing, view_size),
|
||||
context,
|
||||
view_type_prop, view_size_prop);
|
||||
|
@ -178,6 +187,7 @@ gimp_prop_dynamics_box_new (GimpContainer *container,
|
|||
static GtkWidget *
|
||||
pattern_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
GimpViewType view_type,
|
||||
GimpViewSize view_size)
|
||||
|
@ -185,7 +195,7 @@ pattern_box_new (GimpContainer *container,
|
|||
if (! container)
|
||||
container = gimp_data_factory_get_container (context->gimp->pattern_factory);
|
||||
|
||||
return gimp_viewable_box_new (container, context, spacing,
|
||||
return gimp_viewable_box_new (container, context, label, spacing,
|
||||
view_type, GIMP_VIEW_SIZE_SMALL, view_size,
|
||||
"gimp-pattern-grid|gimp-pattern-list",
|
||||
GIMP_STOCK_PATTERN,
|
||||
|
@ -195,19 +205,21 @@ pattern_box_new (GimpContainer *container,
|
|||
GtkWidget *
|
||||
gimp_pattern_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
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 pattern_box_new (container, context, spacing,
|
||||
return pattern_box_new (container, context, label, spacing,
|
||||
GIMP_VIEW_TYPE_GRID, GIMP_VIEW_SIZE_SMALL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_prop_pattern_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop)
|
||||
|
@ -224,7 +236,7 @@ gimp_prop_pattern_box_new (GimpContainer *container,
|
|||
view_size_prop, &view_size,
|
||||
NULL);
|
||||
|
||||
return view_props_connect (pattern_box_new (container, context, spacing,
|
||||
return view_props_connect (pattern_box_new (container, context, label, spacing,
|
||||
view_type, view_size),
|
||||
context,
|
||||
view_type_prop, view_size_prop);
|
||||
|
@ -236,6 +248,7 @@ gimp_prop_pattern_box_new (GimpContainer *container,
|
|||
static GtkWidget *
|
||||
gradient_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
GimpViewType view_type,
|
||||
GimpViewSize view_size,
|
||||
|
@ -243,26 +256,23 @@ gradient_box_new (GimpContainer *container,
|
|||
{
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *button;
|
||||
GList *children;
|
||||
|
||||
if (! container)
|
||||
container = gimp_data_factory_get_container (context->gimp->gradient_factory);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, spacing);
|
||||
hbox = gimp_viewable_box_new (container, context, label, spacing,
|
||||
view_type, GIMP_VIEW_SIZE_LARGE, view_size,
|
||||
"gimp-gradient-list|gimp-gradient-grid",
|
||||
GIMP_STOCK_GRADIENT,
|
||||
_("Open the gradient selection dialog"));
|
||||
|
||||
children = gtk_container_get_children (GTK_CONTAINER (hbox));
|
||||
button = children->data;
|
||||
g_list_free (children);
|
||||
|
||||
button = gimp_viewable_button_new (container, context,
|
||||
view_type,
|
||||
GIMP_VIEW_SIZE_LARGE, view_size, 1,
|
||||
gimp_dialog_factory_get_singleton (),
|
||||
"gimp-gradient-list|gimp-gradient-grid",
|
||||
GIMP_STOCK_GRADIENT,
|
||||
_("Open the gradient selection dialog"));
|
||||
GIMP_VIEWABLE_BUTTON (button)->button_view_size = GIMP_VIEW_SIZE_SMALL;
|
||||
|
||||
g_object_set_data (G_OBJECT (hbox), "viewable-button", button);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
if (reverse_prop)
|
||||
{
|
||||
GtkWidget *toggle;
|
||||
|
@ -272,13 +282,13 @@ gradient_box_new (GimpContainer *container,
|
|||
|
||||
toggle = gimp_prop_check_button_new (G_OBJECT (context), reverse_prop,
|
||||
NULL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
gimp_help_set_help_data (toggle, _("Reverse"), NULL);
|
||||
|
||||
image = gtk_image_new_from_stock (GIMP_STOCK_FLIP_HORIZONTAL,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
GTK_ICON_SIZE_MENU);
|
||||
gtk_container_add (GTK_CONTAINER (toggle), image);
|
||||
gtk_widget_show (image);
|
||||
|
||||
|
@ -301,6 +311,7 @@ gradient_box_new (GimpContainer *container,
|
|||
GtkWidget *
|
||||
gimp_gradient_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *reverse_prop)
|
||||
{
|
||||
|
@ -308,7 +319,7 @@ gimp_gradient_box_new (GimpContainer *container,
|
|||
NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
return gradient_box_new (container, context, spacing,
|
||||
return gradient_box_new (container, context, label, spacing,
|
||||
GIMP_VIEW_TYPE_LIST, GIMP_VIEW_SIZE_LARGE,
|
||||
reverse_prop);
|
||||
}
|
||||
|
@ -316,6 +327,7 @@ gimp_gradient_box_new (GimpContainer *container,
|
|||
GtkWidget *
|
||||
gimp_prop_gradient_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop,
|
||||
|
@ -333,7 +345,7 @@ gimp_prop_gradient_box_new (GimpContainer *container,
|
|||
view_size_prop, &view_size,
|
||||
NULL);
|
||||
|
||||
return view_props_connect (gradient_box_new (container, context, spacing,
|
||||
return view_props_connect (gradient_box_new (container, context, label, spacing,
|
||||
view_type, view_size,
|
||||
reverse_prop),
|
||||
context,
|
||||
|
@ -346,6 +358,7 @@ gimp_prop_gradient_box_new (GimpContainer *container,
|
|||
static GtkWidget *
|
||||
palette_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
GimpViewType view_type,
|
||||
GimpViewSize view_size)
|
||||
|
@ -353,7 +366,7 @@ palette_box_new (GimpContainer *container,
|
|||
if (! container)
|
||||
container = gimp_data_factory_get_container (context->gimp->palette_factory);
|
||||
|
||||
return gimp_viewable_box_new (container, context, spacing,
|
||||
return gimp_viewable_box_new (container, context, label, spacing,
|
||||
view_type, GIMP_VIEW_SIZE_MEDIUM, view_size,
|
||||
"gimp-palette-list|gimp-palette-grid",
|
||||
GIMP_STOCK_PALETTE,
|
||||
|
@ -363,19 +376,21 @@ palette_box_new (GimpContainer *container,
|
|||
GtkWidget *
|
||||
gimp_palette_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
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 palette_box_new (container, context, spacing,
|
||||
return palette_box_new (container, context, label, spacing,
|
||||
GIMP_VIEW_TYPE_LIST, GIMP_VIEW_SIZE_MEDIUM);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_prop_palette_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop)
|
||||
|
@ -392,7 +407,7 @@ gimp_prop_palette_box_new (GimpContainer *container,
|
|||
view_size_prop, &view_size,
|
||||
NULL);
|
||||
|
||||
return view_props_connect (palette_box_new (container, context, spacing,
|
||||
return view_props_connect (palette_box_new (container, context, label, spacing,
|
||||
view_type, view_size),
|
||||
context,
|
||||
view_type_prop, view_size_prop);
|
||||
|
@ -404,6 +419,7 @@ gimp_prop_palette_box_new (GimpContainer *container,
|
|||
static GtkWidget *
|
||||
font_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
GimpViewType view_type,
|
||||
GimpViewSize view_size)
|
||||
|
@ -411,7 +427,7 @@ font_box_new (GimpContainer *container,
|
|||
if (! container)
|
||||
container = context->gimp->fonts;
|
||||
|
||||
return gimp_viewable_box_new (container, context, spacing,
|
||||
return gimp_viewable_box_new (container, context, label, spacing,
|
||||
view_type, GIMP_VIEW_SIZE_SMALL, view_size,
|
||||
"gimp-font-list|gimp-font-grid",
|
||||
GIMP_STOCK_FONT,
|
||||
|
@ -421,19 +437,21 @@ font_box_new (GimpContainer *container,
|
|||
GtkWidget *
|
||||
gimp_font_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
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 font_box_new (container, context, spacing,
|
||||
return font_box_new (container, context, label, spacing,
|
||||
GIMP_VIEW_TYPE_LIST, GIMP_VIEW_SIZE_SMALL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_prop_font_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop)
|
||||
|
@ -450,7 +468,7 @@ gimp_prop_font_box_new (GimpContainer *container,
|
|||
view_size_prop, &view_size,
|
||||
NULL);
|
||||
|
||||
return view_props_connect (font_box_new (container, context, spacing,
|
||||
return view_props_connect (font_box_new (container, context, label, spacing,
|
||||
view_type, view_size),
|
||||
context,
|
||||
view_type_prop, view_size_prop);
|
||||
|
@ -462,6 +480,7 @@ gimp_prop_font_box_new (GimpContainer *container,
|
|||
static GtkWidget *
|
||||
gimp_viewable_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
GimpViewType view_type,
|
||||
GimpViewType button_view_size,
|
||||
|
@ -472,6 +491,8 @@ gimp_viewable_box_new (GimpContainer *container,
|
|||
{
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *button;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *l;
|
||||
GtkWidget *entry;
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, spacing);
|
||||
|
@ -488,13 +509,25 @@ gimp_viewable_box_new (GimpContainer *container,
|
|||
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
if (label)
|
||||
{
|
||||
l = gtk_label_new_with_mnemonic (label);
|
||||
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), l, FALSE, FALSE, 0);
|
||||
gtk_widget_show (l);
|
||||
}
|
||||
|
||||
entry = gimp_container_entry_new (container, context, view_size, 1);
|
||||
|
||||
/* set a silly smally size request on the entry to disable
|
||||
* GtkEntry's minimal width of 150 pixels.
|
||||
*/
|
||||
gtk_widget_set_size_request (entry, 10, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), entry, label ? FALSE: TRUE, FALSE, 0);
|
||||
gtk_widget_show (entry);
|
||||
|
||||
return hbox;
|
||||
|
|
|
@ -21,36 +21,44 @@
|
|||
|
||||
GtkWidget * gimp_brush_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing);
|
||||
GtkWidget * gimp_prop_brush_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop);
|
||||
GtkWidget * gimp_dynamics_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing);
|
||||
GtkWidget * gimp_prop_dynamics_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop);
|
||||
|
||||
GtkWidget * gimp_pattern_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing);
|
||||
GtkWidget * gimp_prop_pattern_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop);
|
||||
|
||||
GtkWidget * gimp_gradient_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint scacing,
|
||||
const gchar *reverse_prop);
|
||||
GtkWidget * gimp_prop_gradient_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint scacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop,
|
||||
|
@ -58,18 +66,22 @@ GtkWidget * gimp_prop_gradient_box_new (GimpContainer *container,
|
|||
|
||||
GtkWidget * gimp_palette_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing);
|
||||
GtkWidget * gimp_prop_palette_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop);
|
||||
|
||||
GtkWidget * gimp_font_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing);
|
||||
GtkWidget * gimp_prop_font_box_new (GimpContainer *container,
|
||||
GimpContext *context,
|
||||
const gchar *label,
|
||||
gint spacing,
|
||||
const gchar *view_type_prop,
|
||||
const gchar *view_size_prop);
|
||||
|
|
Loading…
Reference in New Issue