From 30c946afb1268aaa343658850cebb70470cd0bc7 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sat, 19 Jul 2003 01:43:51 +0000 Subject: [PATCH] save some space by showing the stock_id instead of the colorselector's 2003-07-19 Sven Neumann * libgimpwidgets/gimpcolornotebook.c: save some space by showing the stock_id instead of the colorselector's name. * libgimpwidgets/gimpcolorselect.c * modules/colorsel_cmyk.c * modules/colorsel_triangle.c * modules/colorsel_water.c: removed now unused mnemonics. * app/widgets/gimpcoloreditor.c: no need to strip mnemonics from the name here any longer. --- ChangeLog | 13 +++++++++++++ app/widgets/gimpcoloreditor.c | 27 +++------------------------ libgimpwidgets/gimpcolornotebook.c | 30 +++++++++++++++++++++--------- libgimpwidgets/gimpcolorselect.c | 2 +- modules/colorsel_cmyk.c | 4 ++-- modules/colorsel_triangle.c | 2 +- modules/colorsel_water.c | 2 +- 7 files changed, 42 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84370ed909..3dc4cc97d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-07-19 Sven Neumann + + * libgimpwidgets/gimpcolornotebook.c: save some space by showing + the stock_id instead of the colorselector's name. + + * libgimpwidgets/gimpcolorselect.c + * modules/colorsel_cmyk.c + * modules/colorsel_triangle.c + * modules/colorsel_water.c: removed now unused mnemonics. + + * app/widgets/gimpcoloreditor.c: no need to strip mnemonics from + the name here any longer. + 2003-07-18 Sven Neumann * app/gui/info-window.c: show CMYK color values. diff --git a/app/widgets/gimpcoloreditor.c b/app/widgets/gimpcoloreditor.c index 53675ebd9d..e7367f2d7b 100644 --- a/app/widgets/gimpcoloreditor.c +++ b/app/widgets/gimpcoloreditor.c @@ -179,30 +179,9 @@ gimp_color_editor_init (GimpColorEditor *editor) gtk_container_add (GTK_CONTAINER (button), image); gtk_widget_show (image); - if (selector_class->name) - { - gchar *stripped_name; - gchar *p, *q; - - stripped_name = g_strdup (selector_class->name); - - p = q = stripped_name; - - while (*q) - { - if (*q == '_') - q++; - else - *p++ = *q++; - } - - *p = '\0'; - - gimp_help_set_help_data (button, stripped_name, - selector_class->help_page); - - g_free (stripped_name); - } + gimp_help_set_help_data (button, + selector_class->name, + selector_class->help_page); g_object_set_data (G_OBJECT (button), "selector", selector); diff --git a/libgimpwidgets/gimpcolornotebook.c b/libgimpwidgets/gimpcolornotebook.c index 8e4c7dc4c8..b523828c41 100644 --- a/libgimpwidgets/gimpcolornotebook.c +++ b/libgimpwidgets/gimpcolornotebook.c @@ -123,12 +123,11 @@ gimp_color_notebook_class_init (GimpColorNotebookClass *klass) static void gimp_color_notebook_init (GimpColorNotebook *notebook) { - GimpColorSelector *selector; - GtkWidget *page; - GtkWidget *label; - GType *selector_types; - gint n_selector_types; - gint i; + GimpColorSelector *selector; + GimpColorSelectorClass *selector_class; + GType *selector_types; + gint n_selector_types; + gint i; selector = GIMP_COLOR_SELECTOR (notebook); @@ -136,11 +135,14 @@ gimp_color_notebook_init (GimpColorNotebook *notebook) gtk_box_pack_start (GTK_BOX (notebook), notebook->notebook, TRUE, TRUE, 0); gtk_widget_show (notebook->notebook); + gtk_notebook_popup_enable (GTK_NOTEBOOK (notebook->notebook)); + g_signal_connect (notebook->notebook, "switch_page", G_CALLBACK (gimp_color_notebook_switch_page), notebook); - selector_types = g_type_children (GIMP_TYPE_COLOR_SELECTOR, &n_selector_types); + selector_types = g_type_children (GIMP_TYPE_COLOR_SELECTOR, + &n_selector_types); if (n_selector_types == 2) { @@ -150,6 +152,9 @@ gimp_color_notebook_init (GimpColorNotebook *notebook) for (i = 0; i < n_selector_types; i++) { + GtkWidget *page; + GtkWidget *image; + /* skip ourselves */ if (g_type_is_a (selector_types[i], GIMP_TYPE_COLOR_NOTEBOOK)) continue; @@ -166,11 +171,18 @@ gimp_color_notebook_init (GimpColorNotebook *notebook) if (! page) continue; + selector_class = GIMP_COLOR_SELECTOR_GET_CLASS (page); + gimp_color_selector_set_show_alpha (GIMP_COLOR_SELECTOR (page), FALSE); - label = gtk_label_new_with_mnemonic (GIMP_COLOR_SELECTOR_GET_CLASS (page)->name); + image = gtk_image_new_from_stock (selector_class->stock_id, + GTK_ICON_SIZE_BUTTON); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook->notebook), page, label); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook->notebook), + page, image); + + gtk_notebook_set_menu_label_text (GTK_NOTEBOOK (notebook->notebook), + page, selector_class->name); if (! notebook->cur_page) notebook->cur_page = GIMP_COLOR_SELECTOR (page); diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c index 0b9b9d3022..f5b0b4d0e2 100644 --- a/libgimpwidgets/gimpcolorselect.c +++ b/libgimpwidgets/gimpcolorselect.c @@ -260,7 +260,7 @@ gimp_color_select_class_init (GimpColorSelectClass *klass) object_class->finalize = gimp_color_select_finalize; - selector_class->name = "GI_MP"; + selector_class->name = "GIMP"; selector_class->help_page = "built_in.html"; selector_class->stock_id = GIMP_STOCK_WILBER; selector_class->set_toggles_visible = gimp_color_select_togg_visible; diff --git a/modules/colorsel_cmyk.c b/modules/colorsel_cmyk.c index fbf3ac5b75..5c09d27c8c 100644 --- a/modules/colorsel_cmyk.c +++ b/modules/colorsel_cmyk.c @@ -69,7 +69,7 @@ static const GimpModuleInfo colorsel_cmyk_info = GIMP_MODULE_ABI_VERSION, N_("CMYK color selector"), "Sven Neumann ", - "v0.1", + "v0.2", "(c) 2003, released under the GPL", "July 2003" }; @@ -126,7 +126,7 @@ colorsel_cmyk_class_init (ColorselCmykClass *klass) selector_class = GIMP_COLOR_SELECTOR_CLASS (klass); - selector_class->name = _("_CMYK"); + selector_class->name = _("CMYK"); selector_class->help_page = "cmyk.html"; selector_class->stock_id = GTK_STOCK_PRINT; /* FIXME */ selector_class->set_color = colorsel_cmyk_set_color; diff --git a/modules/colorsel_triangle.c b/modules/colorsel_triangle.c index 0f111e63a0..fb19444d5a 100644 --- a/modules/colorsel_triangle.c +++ b/modules/colorsel_triangle.c @@ -179,7 +179,7 @@ colorsel_triangle_class_init (ColorselTriangleClass *klass) object_class->finalize = colorsel_triangle_finalize; - selector_class->name = _("_Triangle"); + selector_class->name = _("Triangle"); selector_class->help_page = "triangle.html"; selector_class->stock_id = GIMP_STOCK_COLOR_TRIANGLE; selector_class->set_color = colorsel_triangle_set_color; diff --git a/modules/colorsel_water.c b/modules/colorsel_water.c index f967ac5921..8101c2f284 100644 --- a/modules/colorsel_water.c +++ b/modules/colorsel_water.c @@ -173,7 +173,7 @@ colorsel_water_class_init (ColorselWaterClass *klass) object_class->finalize = colorsel_water_finalize; - selector_class->name = _("_Watercolor"); + selector_class->name = _("Watercolor"); selector_class->help_page = "watercolor.html"; selector_class->stock_id = GIMP_STOCK_TOOL_PAINTBRUSH; selector_class->set_color = colorsel_water_set_color;