Commit ac20627c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

add tooltips to all hue partition radio buttons.

2006-05-18  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimphuesaturationtool.c: add tooltips to all hue
	partition radio buttons.

	* app/tools/gimptextoptions.[ch]
	* app/tools/gimpvectoroptions.[ch]: add the widgets that are
	needed by the tools as members to the options structs instead of
	attaching them with g_object_set_data().

	* app/tools/gimptexttool.c
	* app/tools/gimpvectortool.c: access the struct members instead of
	using g_object_get_data().
parent 160f04c4
2006-05-18 Michael Natterer <mitch@gimp.org>
* app/tools/gimphuesaturationtool.c: add tooltips to all hue
partition radio buttons.
* app/tools/gimptextoptions.[ch]
* app/tools/gimpvectoroptions.[ch]: add the widgets that are
needed by the tools as members to the options structs instead of
attaching them with g_object_set_data().
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c: access the struct members instead of
using g_object_get_data().
2006-05-17 Kevin Cozens <kcozens@cvs.gnome.org>
* configure.in: Added quotes in two AM_CONDITIONAL lines to avoid
......
......@@ -220,6 +220,7 @@ gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool)
const struct
{
const gchar *label;
const gchar *tooltip;
gint label_col;
gint label_row;
gint frame_col;
......@@ -227,13 +228,13 @@ gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool)
}
hue_partition_table[] =
{
{ N_("M_aster"), 2, 3, 0, 0 },
{ N_("_R"), 2, 1, 2, 0 },
{ N_("_Y"), 1, 2, 0, 2 },
{ N_("_G"), 1, 4, 0, 4 },
{ N_("_C"), 2, 5, 2, 6 },
{ N_("_B"), 3, 4, 4, 4 },
{ N_("_M"), 3, 2, 4, 2 }
{ N_("M_aster"), N_("Adjust all colors"), 2, 3, 0, 0 },
{ N_("_R"), N_("Red"), 2, 1, 2, 0 },
{ N_("_Y"), N_("Yellow"), 1, 2, 0, 2 },
{ N_("_G"), N_("Green"), 1, 4, 0, 4 },
{ N_("_C"), N_("Cyan"), 2, 5, 2, 6 },
{ N_("_B"), N_("Blue"), 3, 4, 4, 4 },
{ N_("_M"), N_("Magenta"), 3, 2, 4, 2 }
};
frame = gimp_frame_new (_("Select Primary Color to Adjust"));
......@@ -258,7 +259,7 @@ gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool)
gtk_container_add (GTK_CONTAINER (abox), table);
/* the radio buttons for hue partitions */
for (i = 0; i < 7; i++)
for (i = 0; i < G_N_ELEMENTS (hue_partition_table); i++)
{
button = gtk_radio_button_new_with_mnemonic (group,
gettext (hue_partition_table[i].label));
......@@ -266,11 +267,12 @@ gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool)
g_object_set_data (G_OBJECT (button), "hue_partition",
GINT_TO_POINTER (i));
gimp_help_set_help_data (button,
gettext (hue_partition_table[i].tooltip),
NULL);
if (i == 0)
{
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gimp_help_set_help_data (button, _("Adjust all colors"), NULL);
}
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gtk_table_attach (GTK_TABLE (table), button,
hue_partition_table[i].label_col,
......
......@@ -178,7 +178,9 @@ gimp_text_options_class_init (GimpTextOptionsClass *klass)
static void
gimp_text_options_init (GimpTextOptions *options)
{
options->size_entry = NULL;
options->size_entry = NULL;
options->to_vectors_button = NULL;
options->along_vectors_button = NULL;
}
static void
......@@ -404,22 +406,20 @@ gimp_text_options_connect_text (GimpTextOptions *options,
GtkWidget *
gimp_text_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GimpTextOptions *options = GIMP_TEXT_OPTIONS (tool_options);
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *auto_button;
GtkWidget *entry;
GtkWidget *box;
GtkWidget *spinbutton;
gint row = 0;
GObject *config = G_OBJECT (tool_options);
GimpTextOptions *options = GIMP_TEXT_OPTIONS (tool_options);
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *auto_button;
GtkWidget *entry;
GtkWidget *box;
GtkWidget *spinbutton;
gint row = 0;
vbox = gimp_tool_options_gui (tool_options);
g_object_set_data (G_OBJECT (tool_options), "tool-options-vbox", vbox);
table = gtk_table_new (10, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
......@@ -439,7 +439,7 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
_("Size:"), 0.0, 0.5,
entry, 2, FALSE);
options->size_entry = GIMP_SIZE_ENTRY (entry);
options->size_entry = entry;
button = gimp_prop_check_button_new (config, "hinting", _("Hinting"));
gtk_table_attach (GTK_TABLE (table), button, 0, 3, row, row + 1,
......@@ -497,16 +497,14 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
gtk_widget_set_sensitive (button, FALSE);
gtk_widget_show (button);
g_object_set_data (G_OBJECT (tool_options),
"gimp-text-to-vectors", button);
options->to_vectors_button = button;
button = gtk_button_new_with_label (_("Text along Path"));
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_set_sensitive (button, FALSE);
gtk_widget_show (button);
g_object_set_data (G_OBJECT (tool_options),
"gimp-text-to-vectors-warped", button);
options->along_vectors_button = button;
return vbox;
}
......
......@@ -53,7 +53,10 @@ struct _GimpTextOptions
GimpViewType font_view_type;
GimpViewSize font_view_size;
GimpSizeEntry *size_entry;
/* options gui */
GtkWidget *size_entry;
GtkWidget *to_vectors_button;
GtkWidget *along_vectors_button;
};
......
......@@ -328,12 +328,8 @@ gimp_text_tool_connect (GimpTextTool *text_tool,
if (text_tool->text != text)
{
GimpTextOptions *options;
GtkWidget *button;
GtkWidget *button2;
options = GIMP_TEXT_OPTIONS (tool->tool_info->tool_options);
button = g_object_get_data (G_OBJECT (options), "gimp-text-to-vectors");
button2 = g_object_get_data (G_OBJECT (options), "gimp-text-to-vectors-warped");
if (text_tool->text)
{
......@@ -344,18 +340,19 @@ gimp_text_tool_connect (GimpTextTool *text_tool,
if (text_tool->pending)
gimp_text_tool_apply (text_tool);
if (button)
if (options->to_vectors_button)
{
gtk_widget_set_sensitive (button, FALSE);
g_signal_handlers_disconnect_by_func (button,
gtk_widget_set_sensitive (options->to_vectors_button, FALSE);
g_signal_handlers_disconnect_by_func (options->to_vectors_button,
gimp_text_tool_create_vectors,
text_tool);
}
if (button2)
if (options->along_vectors_button)
{
gtk_widget_set_sensitive (button2, FALSE);
g_signal_handlers_disconnect_by_func (button2,
gtk_widget_set_sensitive (options->along_vectors_button,
FALSE);
g_signal_handlers_disconnect_by_func (options->along_vectors_button,
gimp_text_tool_create_vectors_warped,
text_tool);
}
......@@ -380,20 +377,20 @@ gimp_text_tool_connect (GimpTextTool *text_tool,
G_CALLBACK (gimp_text_tool_text_notify),
text_tool);
if (button)
if (options->to_vectors_button)
{
g_signal_connect_swapped (button, "clicked",
g_signal_connect_swapped (options->to_vectors_button, "clicked",
G_CALLBACK (gimp_text_tool_create_vectors),
text_tool);
gtk_widget_set_sensitive (button, TRUE);
gtk_widget_set_sensitive (options->to_vectors_button, TRUE);
}
if (button2)
if (options->along_vectors_button)
{
g_signal_connect_swapped (button2, "clicked",
g_signal_connect_swapped (options->along_vectors_button, "clicked",
G_CALLBACK (gimp_text_tool_create_vectors_warped),
text_tool);
gtk_widget_set_sensitive (button2, TRUE);
gtk_widget_set_sensitive (options->along_vectors_button, TRUE);
}
if (text_tool->editor)
......@@ -957,7 +954,7 @@ gimp_text_tool_set_image (GimpTextTool *text_tool,
text_tool, 0);
options = GIMP_TOOL (text_tool)->tool_info->tool_options;
gimp_size_entry_set_resolution (GIMP_TEXT_OPTIONS (options)->size_entry,
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (GIMP_TEXT_OPTIONS (options)->size_entry),
0, image->yresolution, FALSE);
}
}
......
......@@ -135,11 +135,12 @@ gimp_vector_options_get_property (GObject *object,
GtkWidget *
gimp_vector_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox;
GtkWidget *frame;
GtkWidget *button;
gchar *str;
GObject *config = G_OBJECT (tool_options);
GimpVectorOptions *options = GIMP_VECTOR_OPTIONS (tool_options);
GtkWidget *vbox;
GtkWidget *frame;
GtkWidget *button;
gchar *str;
vbox = gimp_tool_options_gui (tool_options);
......@@ -172,8 +173,7 @@ gimp_vector_options_gui (GimpToolOptions *tool_options)
g_free (str);
g_object_set_data (G_OBJECT (tool_options),
"gimp-vectors-to-selection", button);
options->to_selection_button = button;
button = gtk_button_new_with_label (_("Stroke Path"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
......@@ -181,8 +181,7 @@ gimp_vector_options_gui (GimpToolOptions *tool_options)
gimp_help_set_help_data (button, NULL, GIMP_HELP_PATH_STROKE);
gtk_widget_show (button);
g_object_set_data (G_OBJECT (tool_options),
"gimp-stroke-vectors", button);
options->stroke_button = button;
return vbox;
}
......@@ -40,6 +40,10 @@ struct _GimpVectorOptions
GimpVectorMode edit_mode;
gboolean polygonal;
/* options gui */
GtkWidget *to_selection_button;
GtkWidget *stroke_button;
};
......
......@@ -1480,8 +1480,6 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
GimpDrawTool *draw_tool;
GimpTool *tool;
GimpItem *item = NULL;
GtkWidget *stroke_button;
GtkWidget *sel_button;
GimpVectorOptions *options;
g_return_if_fail (GIMP_IS_VECTOR_TOOL (vector_tool));
......@@ -1505,11 +1503,6 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
gimp_draw_tool_stop (draw_tool);
}
stroke_button = g_object_get_data (G_OBJECT (options),
"gimp-stroke-vectors");
sel_button = g_object_get_data (G_OBJECT (options),
"gimp-vectors-to-selection");
if (vector_tool->vectors)
{
GimpImage *old_image;
......@@ -1533,21 +1526,21 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
vector_tool);
g_object_unref (vector_tool->vectors);
if (sel_button)
if (options->to_selection_button)
{
gtk_widget_set_sensitive (sel_button, FALSE);
g_signal_handlers_disconnect_by_func (sel_button,
gtk_widget_set_sensitive (options->to_selection_button, FALSE);
g_signal_handlers_disconnect_by_func (options->to_selection_button,
gimp_vector_tool_to_selection,
tool);
g_signal_handlers_disconnect_by_func (sel_button,
g_signal_handlers_disconnect_by_func (options->to_selection_button,
gimp_vector_tool_to_selection_extended,
tool);
}
if (stroke_button)
if (options->stroke_button)
{
gtk_widget_set_sensitive (stroke_button, FALSE);
g_signal_handlers_disconnect_by_func (stroke_button,
gtk_widget_set_sensitive (options->stroke_button, FALSE);
g_signal_handlers_disconnect_by_func (options->stroke_button,
gimp_vector_tool_stroke_vectors,
tool);
}
......@@ -1587,23 +1580,23 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
G_CALLBACK (gimp_vector_tool_vectors_thaw),
vector_tool, 0);
if (sel_button)
if (options->to_selection_button)
{
g_signal_connect_swapped (sel_button, "clicked",
g_signal_connect_swapped (options->to_selection_button, "clicked",
G_CALLBACK (gimp_vector_tool_to_selection),
tool);
g_signal_connect_swapped (sel_button, "extended-clicked",
g_signal_connect_swapped (options->to_selection_button, "extended-clicked",
G_CALLBACK (gimp_vector_tool_to_selection_extended),
tool);
gtk_widget_set_sensitive (sel_button, TRUE);
gtk_widget_set_sensitive (options->to_selection_button, TRUE);
}
if (stroke_button)
if (options->stroke_button)
{
g_signal_connect_swapped (stroke_button, "clicked",
g_signal_connect_swapped (options->stroke_button, "clicked",
G_CALLBACK (gimp_vector_tool_stroke_vectors),
tool);
gtk_widget_set_sensitive (stroke_button, TRUE);
gtk_widget_set_sensitive (options->stroke_button, TRUE);
}
if (! gimp_draw_tool_is_active (draw_tool))
......
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