]> Pileus Git - ~andy/gtk/commitdiff
fontbutton: Properly display absolute sizes
authorBenjamin Otte <otte@redhat.com>
Thu, 22 Sep 2011 19:35:25 +0000 (21:35 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 22 Sep 2011 19:44:06 +0000 (21:44 +0200)
Display them the same way as Pango does.

gtk/gtkfontbutton.c

index f7d65efb95059b7827e67dfd5a599cba3f86624a..21d64850f0ed2212af87c0730dc22b6c7f5dbc72 100644 (file)
@@ -1183,8 +1183,10 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
 
   if (font_button->priv->show_size) 
     {
-      gchar *size = g_strdup_printf ("%g",
-                                     pango_font_description_get_size (priv->font_desc) / (double)PANGO_SCALE);
+      /* mirror Pango, which doesn't translate this either */
+      gchar *size = g_strdup_printf ("%g%s",
+                                     pango_font_description_get_size (priv->font_desc) / (double)PANGO_SCALE,
+                                     pango_font_description_get_size_is_absolute (priv->font_desc) ? "px" : "");
       
       gtk_label_set_text (GTK_LABEL (font_button->priv->size_label), size);