[gtk+] Make GtkRecentChooser use GtkStyleContext



commit 81eb953206f3e121f4e175bf233ddf45dda06f94
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jan 4 02:11:12 2011 +0100

    Make GtkRecentChooser use GtkStyleContext

 gtk/gtkrecentchooserdefault.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkrecentchooserdefault.c b/gtk/gtkrecentchooserdefault.c
index 8fba866..84fe199 100644
--- a/gtk/gtkrecentchooserdefault.c
+++ b/gtk/gtkrecentchooserdefault.c
@@ -936,11 +936,15 @@ set_default_size (GtkRecentChooserDefault *impl)
   gint monitor_num;
   GtkRequisition req;
   GdkRectangle monitor;
+  GtkStyleContext *context;
+  GtkStateFlags state;
 
   widget = GTK_WIDGET (impl);
+  context = gtk_widget_get_style_context (widget);
+  state = gtk_widget_get_state_flags (widget);
 
   /* Size based on characters and the icon size */
-  font_size = pango_font_description_get_size (gtk_widget_get_style (widget)->font_desc);
+  font_size = pango_font_description_get_size (gtk_style_context_get_font (context, state));
   font_size = PANGO_PIXELS (font_size);
 
   width = impl->icon_size + font_size * NUM_CHARS;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]