reduced default spacing.
2007-02-08 Sven Neumann <sven@gimp.org> * libgimpwidgets/gimpenumwidgets.c (gimp_enum_stock_box_new_with_range): reduced default spacing. * app/tools/gimpcurvestool.c (gimp_curves_tool_dialog): don't increase the box's spacing. * app/tools/gimprectangleoptions.c: added portrait/landscape buttons. * app/widgets/gimppropwidgets.c (gimp_prop_aspect_ratio_new): reduced default width of entry. Swap width and height when the aspect changes and fixed-aspect is chosen. svn path=/trunk/; revision=21873
This commit is contained in:

committed by
Sven Neumann

parent
938b316dae
commit
fbc67ff207
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
2007-02-08 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpwidgets/gimpenumwidgets.c
|
||||||
|
(gimp_enum_stock_box_new_with_range): reduced default spacing.
|
||||||
|
|
||||||
|
* app/tools/gimpcurvestool.c (gimp_curves_tool_dialog): don't
|
||||||
|
increase the box's spacing.
|
||||||
|
|
||||||
|
* app/tools/gimprectangleoptions.c: added portrait/landscape
|
||||||
|
buttons.
|
||||||
|
|
||||||
|
* app/widgets/gimppropwidgets.c (gimp_prop_aspect_ratio_new):
|
||||||
|
reduced default width of entry. Swap width and height when the
|
||||||
|
aspect changes and fixed-aspect is chosen.
|
||||||
|
|
||||||
2007-02-08 Sven Neumann <sven@gimp.org>
|
2007-02-08 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/tools/gimprectangleoptions.c
|
* app/tools/gimprectangleoptions.c
|
||||||
|
@ -718,7 +718,6 @@ gimp_curves_tool_dialog (GimpImageMapTool *image_map_tool)
|
|||||||
gimp_enum_stock_box_set_child_padding (hbox, padding, -1);
|
gimp_enum_stock_box_set_child_padding (hbox, padding, -1);
|
||||||
|
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
||||||
gtk_box_set_spacing (GTK_BOX (hbox), 4);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
||||||
gtk_widget_show (hbox);
|
gtk_widget_show (hbox);
|
||||||
|
@ -489,17 +489,19 @@ gimp_rectangle_options_gui (GimpToolOptions *tool_options)
|
|||||||
{
|
{
|
||||||
GimpRectangleOptionsPrivate *private;
|
GimpRectangleOptionsPrivate *private;
|
||||||
|
|
||||||
GObject *config = G_OBJECT (tool_options);
|
GObject *config = G_OBJECT (tool_options);
|
||||||
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
|
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *combo;
|
GtkWidget *combo;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
GtkWidget *entry;
|
GtkWidget *entry;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GtkWidget *vbox2;
|
GtkWidget *vbox2;
|
||||||
GtkWidget *frame;
|
GtkWidget *frame;
|
||||||
gint row;
|
GtkWidget *aspect;
|
||||||
|
GList *children;
|
||||||
|
gint row;
|
||||||
|
|
||||||
private = GIMP_RECTANGLE_OPTIONS_GET_PRIVATE (tool_options);
|
private = GIMP_RECTANGLE_OPTIONS_GET_PRIVATE (tool_options);
|
||||||
|
|
||||||
@ -599,15 +601,29 @@ gimp_rectangle_options_gui (GimpToolOptions *tool_options)
|
|||||||
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, row, row + 1);
|
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, row, row + 1);
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
|
hbox = gtk_hbox_new (FALSE, 0);
|
||||||
|
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 2, 5, row, row + 1);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
entry = gimp_prop_aspect_ratio_new (config,
|
entry = gimp_prop_aspect_ratio_new (config,
|
||||||
"aspect-numerator",
|
"aspect-numerator",
|
||||||
"aspect-denominator",
|
"aspect-denominator",
|
||||||
"fixed-aspect",
|
"fixed-aspect",
|
||||||
"width",
|
"width",
|
||||||
"height");
|
"height");
|
||||||
gtk_table_attach_defaults (GTK_TABLE (table), entry, 2, 5, row, row + 1);
|
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
|
aspect = gimp_prop_enum_stock_box_new (G_OBJECT (entry),
|
||||||
|
"aspect", "gimp", -1, -1);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), aspect, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (aspect);
|
||||||
|
|
||||||
|
/* hide "square" */
|
||||||
|
children = gtk_container_get_children (GTK_CONTAINER (aspect));
|
||||||
|
gtk_widget_hide (children->data);
|
||||||
|
g_list_free (children);
|
||||||
|
|
||||||
button = gimp_prop_check_button_new (config, "fixed-aspect", _("Fix"));
|
button = gimp_prop_check_button_new (config, "fixed-aspect", _("Fix"));
|
||||||
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (button);
|
||||||
@ -616,7 +632,7 @@ gimp_rectangle_options_gui (GimpToolOptions *tool_options)
|
|||||||
gtk_widget_show (table);
|
gtk_widget_show (table);
|
||||||
|
|
||||||
hbox = gtk_hbox_new (FALSE, 0);
|
hbox = gtk_hbox_new (FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 10);
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (hbox);
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
combo = gimp_prop_enum_combo_box_new (config, "guide", 0, 0);
|
combo = gimp_prop_enum_combo_box_new (config, "guide", 0, 0);
|
||||||
|
@ -562,7 +562,8 @@ static void gimp_prop_ratio_entry_notify (GObject *config,
|
|||||||
GParamSpec *param_spec,
|
GParamSpec *param_spec,
|
||||||
GtkEntry *entry);
|
GtkEntry *entry);
|
||||||
|
|
||||||
static void gimp_prop_aspect_ratio_flip (GtkWidget *widget,
|
static void gimp_prop_aspect_notify_aspect (GtkWidget *widget,
|
||||||
|
GParamSpec *param_spec,
|
||||||
AspectData *data);
|
AspectData *data);
|
||||||
static void gimp_prop_aspect_ratio_changed (GtkWidget *widget,
|
static void gimp_prop_aspect_ratio_changed (GtkWidget *widget,
|
||||||
AspectData *data);
|
AspectData *data);
|
||||||
@ -609,7 +610,7 @@ gimp_prop_aspect_ratio_new (GObject *config,
|
|||||||
aspect_data->height_property = height_property;
|
aspect_data->height_property = height_property;
|
||||||
|
|
||||||
entry = gimp_ratio_entry_new ();
|
entry = gimp_ratio_entry_new ();
|
||||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), 9);
|
gtk_entry_set_width_chars (GTK_ENTRY (entry), 7);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (entry),
|
g_object_set_data (G_OBJECT (entry),
|
||||||
"gimp-ratio-entry-aspect-data", aspect_data);
|
"gimp-ratio-entry-aspect-data", aspect_data);
|
||||||
@ -617,6 +618,9 @@ gimp_prop_aspect_ratio_new (GObject *config,
|
|||||||
gimp_ratio_entry_set_fraction (GIMP_RATIO_ENTRY (entry),
|
gimp_ratio_entry_set_fraction (GIMP_RATIO_ENTRY (entry),
|
||||||
numerator, denominator);
|
numerator, denominator);
|
||||||
|
|
||||||
|
g_signal_connect (entry, "notify::aspect",
|
||||||
|
G_CALLBACK (gimp_prop_aspect_notify_aspect),
|
||||||
|
aspect_data);
|
||||||
g_signal_connect (entry, "ratio-changed",
|
g_signal_connect (entry, "ratio-changed",
|
||||||
G_CALLBACK (gimp_prop_aspect_ratio_changed),
|
G_CALLBACK (gimp_prop_aspect_ratio_changed),
|
||||||
aspect_data);
|
aspect_data);
|
||||||
@ -651,13 +655,10 @@ gimp_prop_ratio_entry_notify (GObject *config,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_prop_aspect_ratio_flip (GtkWidget *widget,
|
gimp_prop_aspect_notify_aspect (GtkWidget *widget,
|
||||||
AspectData *data)
|
GParamSpec *param_spec,
|
||||||
|
AspectData *data)
|
||||||
{
|
{
|
||||||
gdouble numerator;
|
|
||||||
gdouble denominator;
|
|
||||||
gdouble height;
|
|
||||||
gdouble width;
|
|
||||||
gboolean fixed_aspect = FALSE;
|
gboolean fixed_aspect = FALSE;
|
||||||
|
|
||||||
if (data->fixed_aspect_property)
|
if (data->fixed_aspect_property)
|
||||||
@ -667,36 +668,23 @@ gimp_prop_aspect_ratio_flip (GtkWidget *widget,
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_get (data->config,
|
if (! fixed_aspect)
|
||||||
data->numerator_property, &numerator,
|
return;
|
||||||
data->denominator_property, &denominator,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (fixed_aspect)
|
if (data->width_property && data->height_property)
|
||||||
{
|
{
|
||||||
if (data->width_property && data->height_property)
|
gdouble height;
|
||||||
{
|
gdouble width;
|
||||||
g_object_get (data->config,
|
|
||||||
data->width_property, &width,
|
|
||||||
data->height_property, &height,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_set (data->config,
|
g_object_get (data->config,
|
||||||
data->numerator_property, denominator,
|
data->width_property, &width,
|
||||||
data->denominator_property, numerator,
|
data->height_property, &height,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (fixed_aspect)
|
g_object_set (data->config,
|
||||||
{
|
data->width_property, height,
|
||||||
if (data->width_property && data->height_property)
|
data->height_property, width,
|
||||||
{
|
NULL);
|
||||||
g_object_set (data->config,
|
|
||||||
data->width_property, height,
|
|
||||||
data->height_property, width,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ gimp_enum_stock_box_new_with_range (GType enum_type,
|
|||||||
|
|
||||||
enum_class = g_type_class_ref (enum_type);
|
enum_class = g_type_class_ref (enum_type);
|
||||||
|
|
||||||
hbox = gtk_hbox_new (FALSE, 2);
|
hbox = gtk_hbox_new (FALSE, 0);
|
||||||
g_object_weak_ref (G_OBJECT (hbox),
|
g_object_weak_ref (G_OBJECT (hbox),
|
||||||
(GWeakNotify) g_type_class_unref, enum_class);
|
(GWeakNotify) g_type_class_unref, enum_class);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user