diff options
author | Benjamin Otte <otte@redhat.com> | 2012-12-06 02:54:18 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-12-06 02:57:18 +0100 |
commit | 82a61069200f72dd23cb82ff6d7877e1bf43beb3 (patch) | |
tree | 3e488c353d4dbecacbdf07fb32aa5301062f5ced /gtk/gtkswitch.c | |
parent | 1b1f4da5c7051bbdf29541e3b4d4b3a6e6f9b720 (diff) | |
download | gtk+-82a61069200f72dd23cb82ff6d7877e1bf43beb3.tar.gz |
switch: Remove hack to change text size
The same effect can now be achieved via
.switch { font-size: smaller; }
so there is no need to hardcode things.
Diffstat (limited to 'gtk/gtkswitch.c')
-rw-r--r-- | gtk/gtkswitch.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index 9b560cb098..d2e575d471 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -524,15 +524,12 @@ gtk_switch_draw (GtkWidget *widget, GtkStyleContext *context; GdkRectangle handle; PangoLayout *layout; - PangoFontDescription *desc; - const PangoFontDescription *style_desc; PangoRectangle rect; gint label_x, label_y; GtkBorder padding; GtkStateFlags state; gint focus_width, focus_pad; gint x, y, width, height; - gint font_size, style_font_size; gtk_widget_style_get (widget, "focus-line-width", &focus_width, @@ -585,20 +582,6 @@ gtk_switch_draw (GtkWidget *widget, */ layout = gtk_widget_create_pango_layout (widget, C_("switch", "ON")); - /* FIXME: this should be really done in the theme, but overriding font size - * from it doesn't currently work. So we have to hardcode this here and - * below for the "OFF" label. - */ - desc = pango_font_description_new (); - - style_desc = gtk_style_context_get_font (context, state); - style_font_size = pango_font_description_get_size (style_desc); - font_size = MAX (style_font_size - 1 * PANGO_SCALE, ceil (style_font_size * PANGO_SCALE_SMALL)); - - pango_font_description_set_size (desc, font_size); - - pango_layout_set_font_description (layout, desc); - pango_layout_get_extents (layout, NULL, &rect); pango_extents_to_pixels (&rect, NULL); @@ -613,7 +596,6 @@ gtk_switch_draw (GtkWidget *widget, * glyphs then use WHITE CIRCLE (U+25CB) as the text for the state */ layout = gtk_widget_create_pango_layout (widget, C_("switch", "OFF")); - pango_layout_set_font_description (layout, desc); pango_layout_get_extents (layout, NULL, &rect); pango_extents_to_pixels (&rect, NULL); @@ -636,8 +618,6 @@ gtk_switch_draw (GtkWidget *widget, gtk_switch_paint_handle (widget, cr, &handle); - pango_font_description_free (desc); - return FALSE; } |