libgimpwidgets: add GimpColorSelectorClass::icon_name
and deprecate its stock_id.
This commit is contained in:
@ -212,7 +212,7 @@ gimp_color_editor_init (GimpColorEditor *editor)
|
||||
gtk_box_pack_start (GTK_BOX (editor->hbox), button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
image = gtk_image_new_from_icon_name (selector_class->stock_id,
|
||||
image = gtk_image_new_from_icon_name (selector_class->icon_name,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
gtk_container_add (GTK_CONTAINER (button), image);
|
||||
gtk_widget_show (image);
|
||||
|
@ -58,7 +58,7 @@ gimp_color_selector_palette_class_init (GimpColorSelectorPaletteClass *klass)
|
||||
|
||||
selector_class->name = _("Palette");
|
||||
selector_class->help_id = "gimp-colorselector-palette";
|
||||
selector_class->stock_id = GIMP_STOCK_PALETTE;
|
||||
selector_class->icon_name = GIMP_STOCK_PALETTE;
|
||||
selector_class->set_color = gimp_color_selector_palette_set_color;
|
||||
selector_class->set_config = gimp_color_selector_palette_set_config;
|
||||
}
|
||||
|
@ -203,7 +203,8 @@ gimp_color_notebook_style_set (GtkWidget *widget,
|
||||
|
||||
selector_class = GIMP_COLOR_SELECTOR_GET_CLASS (list->data);
|
||||
|
||||
image = gtk_image_new_from_icon_name (selector_class->stock_id, icon_size);
|
||||
image = gtk_image_new_from_icon_name (selector_class->icon_name,
|
||||
icon_size);
|
||||
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook->notebook),
|
||||
GTK_WIDGET (list->data),
|
||||
@ -392,7 +393,7 @@ gimp_color_notebook_add_page (GimpColorNotebook *notebook,
|
||||
|
||||
menu_widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
|
||||
|
||||
image = gtk_image_new_from_icon_name (selector_class->stock_id,
|
||||
image = gtk_image_new_from_icon_name (selector_class->icon_name,
|
||||
GTK_ICON_SIZE_MENU);
|
||||
gtk_box_pack_start (GTK_BOX (menu_widget), image, FALSE, FALSE, 0);
|
||||
gtk_widget_show (image);
|
||||
@ -401,7 +402,7 @@ gimp_color_notebook_add_page (GimpColorNotebook *notebook,
|
||||
gtk_box_pack_start (GTK_BOX (menu_widget), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
image = gtk_image_new_from_icon_name (selector_class->stock_id,
|
||||
image = gtk_image_new_from_icon_name (selector_class->icon_name,
|
||||
DEFAULT_TAB_ICON_SIZE);
|
||||
|
||||
gtk_notebook_append_page_menu (GTK_NOTEBOOK (notebook->notebook),
|
||||
|
@ -108,7 +108,7 @@ gimp_color_scales_class_init (GimpColorScalesClass *klass)
|
||||
|
||||
selector_class->name = _("Scales");
|
||||
selector_class->help_id = "gimp-colorselector-scales";
|
||||
selector_class->stock_id = GIMP_STOCK_TOOL_OPTIONS;
|
||||
selector_class->icon_name = GIMP_STOCK_TOOL_OPTIONS;
|
||||
selector_class->set_toggles_visible = gimp_color_scales_togg_visible;
|
||||
selector_class->set_toggles_sensitive = gimp_color_scales_togg_sensitive;
|
||||
selector_class->set_show_alpha = gimp_color_scales_set_show_alpha;
|
||||
|
@ -238,7 +238,7 @@ gimp_color_select_class_init (GimpColorSelectClass *klass)
|
||||
|
||||
selector_class->name = "GIMP";
|
||||
selector_class->help_id = "gimp-colorselector-gimp";
|
||||
selector_class->stock_id = GIMP_STOCK_WILBER;
|
||||
selector_class->icon_name = GIMP_STOCK_WILBER;
|
||||
selector_class->set_toggles_visible = gimp_color_select_togg_visible;
|
||||
selector_class->set_toggles_sensitive = gimp_color_select_togg_sensitive;
|
||||
selector_class->set_color = gimp_color_select_set_color;
|
||||
|
@ -96,7 +96,7 @@ gimp_color_selector_class_init (GimpColorSelectorClass *klass)
|
||||
|
||||
klass->name = "Unnamed";
|
||||
klass->help_id = NULL;
|
||||
klass->stock_id = GTK_STOCK_SELECT_COLOR;
|
||||
klass->icon_name = GTK_STOCK_SELECT_COLOR;
|
||||
|
||||
klass->set_toggles_visible = NULL;
|
||||
klass->set_toggles_sensitive = NULL;
|
||||
|
@ -82,7 +82,11 @@ struct _GimpColorSelectorClass
|
||||
|
||||
const gchar *name;
|
||||
const gchar *help_id;
|
||||
#ifdef GIMP_DISABLE_DEPRECATED
|
||||
gpointer deprecated_stock_id;
|
||||
#else
|
||||
const gchar *stock_id;
|
||||
#endif
|
||||
|
||||
/* virtual functions */
|
||||
void (* set_toggles_visible) (GimpColorSelector *selector,
|
||||
@ -108,8 +112,10 @@ struct _GimpColorSelectorClass
|
||||
void (* set_config) (GimpColorSelector *selector,
|
||||
GimpColorConfig *config);
|
||||
|
||||
/* icon name */
|
||||
const gchar *icon_name;
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (* _gimp_reserved2) (void);
|
||||
void (* _gimp_reserved3) (void);
|
||||
void (* _gimp_reserved4) (void);
|
||||
};
|
||||
|
@ -117,7 +117,7 @@ colorsel_cmyk_class_init (ColorselCmykClass *klass)
|
||||
|
||||
selector_class->name = _("CMYK");
|
||||
selector_class->help_id = "gimp-colorselector-cmyk";
|
||||
selector_class->stock_id = GTK_STOCK_PRINT; /* FIXME */
|
||||
selector_class->icon_name = GTK_STOCK_PRINT; /* FIXME */
|
||||
selector_class->set_color = colorsel_cmyk_set_color;
|
||||
selector_class->set_config = colorsel_cmyk_set_config;
|
||||
}
|
||||
|
@ -115,9 +115,9 @@ colorsel_water_class_init (ColorselWaterClass *klass)
|
||||
{
|
||||
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
||||
|
||||
selector_class->name = _("Watercolor");
|
||||
selector_class->help_id = "gimp-colorselector-watercolor";
|
||||
selector_class->stock_id = GIMP_STOCK_TOOL_PAINTBRUSH;
|
||||
selector_class->name = _("Watercolor");
|
||||
selector_class->help_id = "gimp-colorselector-watercolor";
|
||||
selector_class->icon_name = GIMP_STOCK_TOOL_PAINTBRUSH;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -101,7 +101,7 @@ colorsel_wheel_class_init (ColorselWheelClass *klass)
|
||||
|
||||
selector_class->name = _("Wheel");
|
||||
selector_class->help_id = "gimp-colorselector-triangle";
|
||||
selector_class->stock_id = GIMP_STOCK_COLOR_TRIANGLE;
|
||||
selector_class->icon_name = GIMP_STOCK_COLOR_TRIANGLE;
|
||||
selector_class->set_color = colorsel_wheel_set_color;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user