From 50bda1bad222082488d3d9bc9fe1d0fb3867e974 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 7 Jul 2014 12:51:41 +0200 Subject: Replace GtkStyle usages with GtkStyleContext This makes evolution depend on theme-defined named colors, namely: theme_bg_color theme_base_color theme_fg_color theme_text_color theme_selected_bg_color theme_selected_fg_color theme_unfocused_selected_bg_color theme_unfocused_selected_fg_color If it's not defined, then a fallback color is used, in the worse case one of the fallbacks defined in evolution itself. --- modules/mail/e-mail-shell-sidebar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c index d4c9e2d954..e0e12a081b 100644 --- a/modules/mail/e-mail-shell-sidebar.c +++ b/modules/mail/e-mail-shell-sidebar.c @@ -264,7 +264,7 @@ mail_shell_sidebar_get_preferred_width (GtkWidget *widget, EMailShellSidebar *sidebar; PangoLayout *layout; PangoRectangle ink_rect; - GtkStyle *style; + GtkBorder padding; gint border; gint sidebar_width; gint screen_width; @@ -280,12 +280,12 @@ mail_shell_sidebar_get_preferred_width (GtkWidget *widget, pango_layout_get_pixel_extents (layout, &ink_rect, NULL); g_object_unref (layout); - style = gtk_widget_get_style (widget); + gtk_style_context_get_padding (gtk_widget_get_style_context (widget), 0, &padding); screen_width = guess_screen_width (sidebar); /* Thickness of frame shadow plus some slack for padding. */ - border = 2 * style->xthickness + 4; + border = 2 * padding.left + 4; sidebar_width = ink_rect.width + border; sidebar_width = MIN (sidebar_width, screen_width / 4); *minimum_width = *natural_width = MAX (*natural_width, sidebar_width); -- cgit v1.2.3