app: use a spin scale for the brush size (have to limit size to 1000 temporarily)

This commit is contained in:
Mikael Magnusson 2010-11-02 12:16:19 +01:00 committed by Michael Natterer
parent 8f991c5950
commit 90e525ca09
3 changed files with 38 additions and 24 deletions

View File

@ -138,7 +138,7 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_SIZE,
"brush-size", _("Brush Size"),
1.0, 10000.0, DEFAULT_BRUSH_SIZE,
1.0, 1000.0, DEFAULT_BRUSH_SIZE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_ASPECT_RATIO,

View File

@ -122,6 +122,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
{
GtkObject *adj;
GtkWidget *hbox;
button = gimp_prop_brush_box_new (NULL, GIMP_CONTEXT (tool_options),
_("Brush"), 2,
@ -142,18 +143,22 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (button);
table_row++;
adj = gimp_prop_scale_entry_new (config, "brush-size",
GTK_TABLE (table), 0, table_row++,
_("Size:"),
0.01, 0.1, 2,
FALSE, 0.0, 0.0);
gimp_scale_entry_set_logarithmic (adj, TRUE);
hbox = gtk_hbox_new (FALSE, 2);
gtk_table_attach (GTK_TABLE (table), hbox,
0, 3, table_row, table_row + 1,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
gtk_widget_show (hbox);
table_row++;
scale = gimp_prop_spin_scale_new (config, "brush-size",
_("Size"),
0.01, 1.0, 2);
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
gtk_widget_show (scale);
button = gimp_stock_button_new (GTK_STOCK_REFRESH, _("Reset size"));
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
"", 0.0, 0.5,
button, 2, FALSE);
button = gimp_stock_button_new (GTK_STOCK_REFRESH, NULL);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (gimp_paint_options_gui_reset_size),
@ -178,7 +183,6 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
table_row++;
}
if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
{
frame = fade_options_gui (options, tool_type);

View File

@ -184,24 +184,34 @@ gimp_stock_button_new (const gchar *stock_id,
const gchar *label)
{
GtkWidget *button;
GtkWidget *hbox;
GtkWidget *image;
GtkWidget *lab;
button = gtk_button_new ();
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (button), hbox);
gtk_widget_show (hbox);
if (label)
{
GtkWidget *hbox;
GtkWidget *lab;
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (button), hbox);
gtk_widget_show (hbox);
lab = gtk_label_new_with_mnemonic (label);
gtk_label_set_mnemonic_widget (GTK_LABEL (lab), button);
gtk_box_pack_start (GTK_BOX (hbox), lab, TRUE, TRUE, 0);
gtk_widget_show (lab);
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
lab = gtk_label_new_with_mnemonic (label);
gtk_label_set_mnemonic_widget (GTK_LABEL (lab), button);
gtk_box_pack_start (GTK_BOX (hbox), lab, TRUE, TRUE, 0);
gtk_widget_show (lab);
}
else
{
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
}
return button;
}