Commit d753ee57 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

don't create the recent settings menu if the tool did not set a config

2008-02-18  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpimagemaptool.c (gimp_image_map_tool_initialize):
	don't create the recent settings menu if the tool did not set a
	config object.

	* app/tools/gimpgegltool.[ch]: pack the operation's settings in a
	frame and add a label when there is no operation selected.


svn path=/trunk/; revision=24907
parent 62015aec
2008-02-18 Michael Natterer <mitch@gimp.org>
* app/tools/gimpimagemaptool.c (gimp_image_map_tool_initialize):
don't create the recent settings menu if the tool did not set a
config object.
* app/tools/gimpgegltool.[ch]: pack the operation's settings in a
frame and add a label when there is no operation selected.
2008-02-16 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
......
......@@ -278,10 +278,18 @@ gimp_gegl_tool_dialog (GimpImageMapTool *image_map_tool)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
/* The options vbox */
tool->options_box = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (image_map_tool->main_vbox), tool->options_box,
tool->options_frame = gimp_frame_new (_("Operation Settings"));
gtk_box_pack_start (GTK_BOX (image_map_tool->main_vbox), tool->options_frame,
FALSE, FALSE, 0);
gtk_widget_show (tool->options_box);
gtk_widget_show (tool->options_frame);
tool->options_table = gtk_label_new ("Select an operation from the list above");
gimp_label_set_attributes (GTK_LABEL (tool->options_table),
PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
-1);
gtk_misc_set_padding (GTK_MISC (tool->options_table), 0, 4);
gtk_container_add (GTK_CONTAINER (tool->options_frame), tool->options_table);
gtk_widget_show (tool->options_table);
}
static void
......@@ -660,7 +668,7 @@ gimp_gegl_tool_operation_changed (GtkWidget *widget,
if (tool->options_table)
{
gtk_container_remove (GTK_CONTAINER (tool->options_box),
gtk_container_remove (GTK_CONTAINER (tool->options_frame),
tool->options_table);
tool->options_table = NULL;
}
......@@ -675,8 +683,8 @@ gimp_gegl_tool_operation_changed (GtkWidget *widget,
gimp_prop_table_new (G_OBJECT (tool->config),
G_TYPE_FROM_INSTANCE (tool->config),
GIMP_CONTEXT (GIMP_TOOL_GET_OPTIONS (tool)));
gtk_box_pack_start (GTK_BOX (tool->options_box), tool->options_table,
FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (tool->options_frame),
tool->options_table);
gtk_widget_show (tool->options_table);
}
......
......@@ -43,7 +43,7 @@ struct _GimpGeglTool
/* dialog */
GtkWidget *operation_combo;
GtkWidget *options_box;
GtkWidget *options_frame;
GtkWidget *options_table;
};
......
......@@ -289,9 +289,6 @@ gimp_image_map_tool_initialize (GimpTool *tool,
GimpImageMapToolClass *klass;
GtkWidget *shell;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *combo;
GtkWidget *toggle;
const gchar *stock_id;
......@@ -324,26 +321,34 @@ gimp_image_map_tool_initialize (GimpTool *tool,
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (shell)->vbox), vbox);
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (image_map_tool->main_vbox), hbox,
FALSE, FALSE, 0);
gtk_widget_show (hbox);
label = gtk_label_new (_("Recent Settings:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
combo = gimp_container_combo_box_new (klass->recent_settings,
GIMP_CONTEXT (tool_info->tool_options),
16, 0);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);
gimp_help_set_help_data (combo, _("Pick a setting from the list"), NULL);
g_signal_connect_after (combo, "select-item",
G_CALLBACK (gimp_image_map_tool_recent_selected),
image_map_tool);
if (image_map_tool->config)
{
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *combo;
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (image_map_tool->main_vbox), hbox,
FALSE, FALSE, 0);
gtk_widget_show (hbox);
label = gtk_label_new (_("Recent Settings:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
combo = gimp_container_combo_box_new (klass->recent_settings,
GIMP_CONTEXT (tool_info->tool_options),
16, 0);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);
gimp_help_set_help_data (combo, _("Pick a setting from the list"),
NULL);
g_signal_connect_after (combo, "select-item",
G_CALLBACK (gimp_image_map_tool_recent_selected),
image_map_tool);
}
/* The preview toggle */
toggle = gimp_prop_check_button_new (G_OBJECT (tool_info->tool_options),
......
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