[gtk+] Use gtk_style_context_get_font() in GtkSpinButton
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use gtk_style_context_get_font() in GtkSpinButton
- Date: Fri, 24 Dec 2010 19:21:08 +0000 (UTC)
commit 0f0512aee3f18d4a160a87ec1ad9934aa459cbe1
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Dec 24 20:16:22 2010 +0100
Use gtk_style_context_get_font() in GtkSpinButton
gtk/gtkspinbutton.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 38dbde0..492aeae 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -693,7 +693,7 @@ gtk_spin_button_get_preferred_width (GtkWidget *widget,
if (gtk_entry_get_width_chars (entry) < 0)
{
PangoContext *context;
- PangoFontDescription *font_desc;
+ const PangoFontDescription *font_desc;
PangoFontMetrics *metrics;
gint width;
gint w;
@@ -710,10 +710,7 @@ gtk_spin_button_get_preferred_width (GtkWidget *widget,
"focus-line-width", &focus_width,
NULL);
- /* FIXME: update to get_font_desc */
- gtk_style_context_get (style_context, 0,
- "font", &font_desc,
- NULL);
+ font_desc = gtk_style_context_get_font (style_context, 0);
context = gtk_widget_get_pango_context (widget);
metrics = pango_context_get_metrics (context, font_desc,
@@ -2301,16 +2298,14 @@ gtk_spin_button_get_wrap (GtkSpinButton *spin_button)
static gint
spin_button_get_arrow_size (GtkSpinButton *spin_button)
{
- PangoFontDescription *font_desc;
+ const PangoFontDescription *font_desc;
GtkStyleContext *context;
gint size;
gint arrow_size;
/* FIXME: use getter */
context = gtk_widget_get_style_context (GTK_WIDGET (spin_button));
- gtk_style_context_get (context, 0,
- "font", &font_desc,
- NULL);
+ font_desc = gtk_style_context_get_font (context, 0);
size = pango_font_description_get_size (font_desc);
arrow_size = MAX (PANGO_PIXELS (size), MIN_ARROW_WIDTH);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]