[gtk+] Always chain up in ::style-updated
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Always chain up in ::style-updated
- Date: Mon, 7 Feb 2011 12:31:15 +0000 (UTC)
commit beb8c290d1c7a7b5307dfd9e4c446a91ad48a507
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 7 07:30:37 2011 -0500
Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
gtk/gtkassistant.c | 2 ++
gtk/gtkbutton.c | 2 ++
gtk/gtkcombobox.c | 2 ++
gtk/gtkdialog.c | 2 ++
gtk/gtkentry.c | 2 ++
gtk/gtkfontsel.c | 2 ++
gtk/gtkhandlebox.c | 2 ++
gtk/gtkiconview.c | 2 ++
gtk/gtkimage.c | 6 +-----
gtk/gtkinfobar.c | 2 ++
gtk/gtklabel.c | 2 ++
gtk/gtklinkbutton.c | 4 ++--
gtk/gtkmenu.c | 2 ++
gtk/gtkmessagedialog.c | 2 +-
gtk/gtktextview.c | 2 ++
gtk/gtktoolbar.c | 4 +++-
gtk/gtktoolbutton.c | 2 ++
gtk/gtktreeview.c | 2 ++
gtk/gtkviewport.c | 4 +++-
gtk/gtkwindow.c | 2 ++
20 files changed, 40 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 816e1e5..98628b7 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1123,6 +1123,8 @@ gtk_assistant_style_updated (GtkWidget *widget)
GtkAssistantPrivate *priv = assistant->priv;
GList *list;
+ GTK_WIDGET_CLASS (gtk_assistant_parent_class)->style_updated (widget);
+
list = priv->pages;
while (list)
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 9bc416e..3ae3e99 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1386,6 +1386,8 @@ gtk_button_style_updated (GtkWidget *widget)
{
GtkStyleContext *context;
+ GTK_WIDGET_CLASS (gtk_button_parent_class)->style_updated (widget);
+
context = gtk_widget_get_style_context (widget);
gtk_button_update_image_spacing (GTK_BUTTON (widget), context);
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 3501064..0727a36 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1347,6 +1347,8 @@ gtk_combo_box_style_updated (GtkWidget *widget)
GtkComboBoxPrivate *priv = combo_box->priv;
GtkWidget *child;
+ GTK_WIDGET_CLASS (gtk_combo_box_parent_class)->style_updated (widget);
+
gtk_combo_box_check_appearance (combo_box);
if (priv->tree_view && priv->cell_view)
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 2e8ddad..228aab3 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -508,6 +508,8 @@ gtk_dialog_map (GtkWidget *widget)
static void
gtk_dialog_style_updated (GtkWidget *widget)
{
+ GTK_WIDGET_CLASS (gtk_dialog_parent_class)->style_updated (widget);
+
update_spacings (GTK_DIALOG (widget));
}
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index c9f3e7b..886f59a 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -4468,6 +4468,8 @@ gtk_entry_style_updated (GtkWidget *widget)
gint focus_width;
gboolean interior_focus;
+ GTK_WIDGET_CLASS (gtk_entry_parent_class)->style_updated (widget);
+
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"interior-focus", &interior_focus,
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 0d66568..a88fbbe 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -656,6 +656,8 @@ gtk_font_selection_screen_changed (GtkWidget *widget,
static void
gtk_font_selection_style_updated (GtkWidget *widget)
{
+ GTK_WIDGET_CLASS (gtk_font_selection_parent_class)->style_updated (widget);
+
/* Maybe fonts where installed or removed... */
gtk_font_selection_reload_fonts (GTK_FONT_SELECTION (widget));
}
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index 5b8326b..422c97b 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -512,6 +512,8 @@ gtk_handle_box_style_updated (GtkWidget *widget)
GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
GtkHandleBoxPrivate *priv = hb->priv;
+ GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->style_updated (widget);
+
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
{
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 7e107da..b3d4768 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1479,6 +1479,8 @@ gtk_icon_view_state_flags_changed (GtkWidget *widget,
static void
gtk_icon_view_style_updated (GtkWidget *widget)
{
+ GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->style_updated (widget);
+
_gtk_icon_view_update_background (GTK_ICON_VIEW (widget));
gtk_widget_queue_resize (widget);
}
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 473bb3a..249223c 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -2002,13 +2002,9 @@ gtk_image_get_preferred_height (GtkWidget *widget,
static void
gtk_image_style_updated (GtkWidget *widget)
{
- GtkImage *image;
-
- image = GTK_IMAGE (widget);
-
GTK_WIDGET_CLASS (gtk_image_parent_class)->style_updated (widget);
- icon_theme_changed (image);
+ icon_theme_changed (GTK_IMAGE (widget));
}
static void
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index e031fa2..45ca5fe 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -495,6 +495,8 @@ gtk_info_bar_style_updated (GtkWidget *widget)
gint content_area_spacing;
gint content_area_border;
+ GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->style_updated (widget);
+
gtk_widget_style_get (widget,
"button-spacing", &button_spacing,
"action-area-border", &action_area_border,
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index a99f7a1..51fd17f 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3821,6 +3821,8 @@ gtk_label_style_updated (GtkWidget *widget)
{
GtkLabel *label = GTK_LABEL (widget);
+ GTK_WIDGET_CLASS (gtk_label_parent_class)->style_updated (widget);
+
/* We have to clear the layout, fonts etc. may have changed */
gtk_label_clear_layout (label);
gtk_label_invalidate_wrap_width (label);
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index fde6d27..2c76ade 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -366,9 +366,9 @@ gtk_link_button_add (GtkContainer *container,
static void
gtk_link_button_style_updated (GtkWidget *widget)
{
- GtkLinkButton *link_button = GTK_LINK_BUTTON (widget);
+ GTK_WIDGET_CLASS (gtk_link_button_parent_class)->style_updated (widget);
- set_link_color (link_button);
+ set_link_color (GTK_LINK_BUTTON (widget));
}
static void
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index c792b4e..d363009 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -2445,6 +2445,8 @@ gtk_menu_reorder_child (GtkMenu *menu,
static void
gtk_menu_style_updated (GtkWidget *widget)
{
+ GTK_WIDGET_CLASS (gtk_menu_parent_class)->style_updated (widget);
+
if (gtk_widget_get_realized (widget))
{
GtkMenu *menu = GTK_MENU (widget);
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index dfa3131..1455287 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -997,7 +997,7 @@ gtk_message_dialog_style_updated (GtkWidget *widget)
{
gtk_widget_style_get (widget, "message-border",
&border_width, NULL);
-
+
gtk_container_set_border_width (GTK_CONTAINER (parent),
MAX (0, border_width - 7));
}
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index e0f42ec..4345521 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -4143,6 +4143,8 @@ gtk_text_view_style_updated (GtkWidget *widget)
text_view = GTK_TEXT_VIEW (widget);
priv = text_view->priv;
+ GTK_WIDGET_CLASS (gtk_text_view_parent_class)->style_updated (widget);
+
if (gtk_widget_get_realized (widget))
{
gtk_text_view_set_background (text_view);
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 5421cf9..5fea923 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -1868,11 +1868,13 @@ gtk_toolbar_style_updated (GtkWidget *widget)
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
GtkToolbarPrivate *priv = toolbar->priv;
+ GTK_WIDGET_CLASS (gtk_toolbar_parent_class)->style_updated (widget);
+
priv->max_homogeneous_pixels = -1;
if (gtk_widget_get_realized (widget))
gtk_style_context_set_background (gtk_widget_get_style_context (widget),
- gtk_widget_get_window (widget));
+ gtk_widget_get_window (widget));
gtk_toolbar_update_button_relief (GTK_TOOLBAR (widget));
}
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 9d22e53..5a3bc46 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -808,6 +808,8 @@ gtk_tool_button_update_icon_spacing (GtkToolButton *button)
static void
gtk_tool_button_style_updated (GtkWidget *widget)
{
+ GTK_WIDGET_CLASS (parent_class)->style_updated (widget);
+
gtk_tool_button_update_icon_spacing (GTK_TOOL_BUTTON (widget));
}
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 637cae8..8fffa8e 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -8489,6 +8489,8 @@ gtk_tree_view_style_updated (GtkWidget *widget)
GList *list;
GtkTreeViewColumn *column;
+ GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->style_updated (widget);
+
if (gtk_widget_get_realized (widget))
{
GtkStyleContext *context;
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 09e9fd2..6d313d9 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -926,11 +926,13 @@ gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
static void
gtk_viewport_style_updated (GtkWidget *widget)
{
+ GTK_WIDGET_CLASS (gtk_viewport_parent_class)->style_updated (widget);
+
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
{
GtkStyleContext *context;
- GtkViewport *viewport = GTK_VIEWPORT (widget);
+ GtkViewport *viewport = GTK_VIEWPORT (widget);
GtkViewportPrivate *priv = viewport->priv;
context = gtk_widget_get_style_context (widget);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 7336d02..23a7de5 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5341,6 +5341,8 @@ gtk_window_style_updated (GtkWidget *widget)
GtkWindowPrivate *priv = window->priv;
GdkRectangle rect;
+ GTK_WIDGET_CLASS (gtk_window_parent_class)->style_updated (widget);
+
if (priv->grip_window != NULL && gtk_window_get_resize_grip_area (window, &rect))
{
gdk_window_move_resize (priv->grip_window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]