libgimpwidgets: implement GtkWidget::style_updated() instead of style_set()

This commit is contained in:
Michael Natterer 2010-12-21 09:32:10 +01:00
parent 1264285cff
commit f689ef7b16
4 changed files with 19 additions and 26 deletions

View File

@ -54,8 +54,7 @@
#define DEFAULT_TAB_ICON_SIZE GTK_ICON_SIZE_BUTTON
static void gimp_color_notebook_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gimp_color_notebook_style_updated (GtkWidget *widget);
static void gimp_color_notebook_togg_visible (GimpColorSelector *selector,
gboolean visible);
@ -113,7 +112,7 @@ gimp_color_notebook_class_init (GimpColorNotebookClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
widget_class->style_set = gimp_color_notebook_style_set;
widget_class->style_updated = gimp_color_notebook_style_updated;
selector_class->name = "Notebook";
selector_class->help_id = "gimp-colorselector-notebook";
@ -187,16 +186,14 @@ gimp_color_notebook_init (GimpColorNotebook *notebook)
}
static void
gimp_color_notebook_style_set (GtkWidget *widget,
GtkStyle *prev_style)
gimp_color_notebook_style_updated (GtkWidget *widget)
{
GimpColorNotebook *notebook = GIMP_COLOR_NOTEBOOK (widget);
GList *list;
gint tab_border;
GtkIconSize icon_size;
if (GTK_WIDGET_CLASS (parent_class)->style_set)
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
gtk_widget_style_get (widget,
"tab-border", &tab_border,

View File

@ -56,8 +56,7 @@ static void gimp_frame_get_preferred_height (GtkWidget *widget,
gint *natural_height);
static void gimp_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gimp_frame_style_set (GtkWidget *widget,
GtkStyle *previous);
static void gimp_frame_style_updated (GtkWidget *widget);
static gboolean gimp_frame_draw (GtkWidget *widget,
cairo_t *cr);
static void gimp_frame_child_allocate (GtkFrame *frame,
@ -80,7 +79,7 @@ gimp_frame_class_init (GimpFrameClass *klass)
widget_class->get_preferred_width = gimp_frame_get_preferred_width;
widget_class->get_preferred_height = gimp_frame_get_preferred_height;
widget_class->size_allocate = gimp_frame_size_allocate;
widget_class->style_set = gimp_frame_style_set;
widget_class->style_updated = gimp_frame_style_updated;
widget_class->draw = gimp_frame_draw;
gtk_widget_class_install_style_property (widget_class,
@ -250,9 +249,10 @@ gimp_frame_child_allocate (GtkFrame *frame,
}
static void
gimp_frame_style_set (GtkWidget *widget,
GtkStyle *previous)
gimp_frame_style_updated (GtkWidget *widget)
{
GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
/* font changes invalidate the indentation */
g_object_set_data (G_OBJECT (widget), GIMP_FRAME_INDENT_KEY, NULL);

View File

@ -136,8 +136,7 @@ static void gimp_ruler_get_preferred_width (GtkWidget *widget,
static void gimp_ruler_get_preferred_height (GtkWidget *widget,
gint *minimum_height,
gint *natural_height);
static void gimp_ruler_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gimp_ruler_style_updated (GtkWidget *widget);
static gboolean gimp_ruler_motion_notify (GtkWidget *widget,
GdkEventMotion *event);
static gboolean gimp_ruler_draw (GtkWidget *widget,
@ -179,7 +178,7 @@ gimp_ruler_class_init (GimpRulerClass *klass)
widget_class->get_preferred_width = gimp_ruler_get_preferred_width;
widget_class->get_preferred_height = gimp_ruler_get_preferred_height;
widget_class->size_allocate = gimp_ruler_size_allocate;
widget_class->style_set = gimp_ruler_style_set;
widget_class->style_updated = gimp_ruler_style_updated;
widget_class->motion_notify_event = gimp_ruler_motion_notify;
widget_class->draw = gimp_ruler_draw;
@ -954,12 +953,11 @@ gimp_ruler_get_preferred_height (GtkWidget *widget,
}
static void
gimp_ruler_style_set (GtkWidget *widget,
GtkStyle *prev_style)
gimp_ruler_style_updated (GtkWidget *widget)
{
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (widget);
GTK_WIDGET_CLASS (gimp_ruler_parent_class)->style_set (widget, prev_style);
GTK_WIDGET_CLASS (gimp_ruler_parent_class)->style_updated (widget);
gtk_widget_style_get (widget,
"font-scale", &priv->font_scale,

View File

@ -40,10 +40,9 @@
**/
static void gimp_unit_combo_box_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gimp_unit_combo_box_popup_shown (GtkWidget *widget,
const GParamSpec *pspec);
static void gimp_unit_combo_box_style_updated (GtkWidget *widget);
static void gimp_unit_combo_box_popup_shown (GtkWidget *widget,
const GParamSpec *pspec);
G_DEFINE_TYPE (GimpUnitComboBox, gimp_unit_combo_box, GTK_TYPE_COMBO_BOX)
@ -56,7 +55,7 @@ gimp_unit_combo_box_class_init (GimpUnitComboBoxClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
widget_class->style_set = gimp_unit_combo_box_style_set;
widget_class->style_updated = gimp_unit_combo_box_style_updated;
gtk_widget_class_install_style_property (widget_class,
g_param_spec_double ("label-scale",
@ -86,14 +85,13 @@ gimp_unit_combo_box_init (GimpUnitComboBox *combo)
}
static void
gimp_unit_combo_box_style_set (GtkWidget *widget,
GtkStyle *prev_style)
gimp_unit_combo_box_style_updated (GtkWidget *widget)
{
GtkCellLayout *layout;
GtkCellRenderer *cell;
gdouble scale;
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
gtk_widget_style_get (widget, "label-scale", &scale, NULL);