rpms/gdm/devel gdm-2.24.0-fix-icon-scale.patch, NONE, 1.1 gdm.spec, 1.425, 1.426

Ray Strode rstrode at fedoraproject.org
Tue Sep 30 21:32:36 UTC 2008


Author: rstrode

Update of /cvs/pkgs/rpms/gdm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4323

Modified Files:
	gdm.spec 
Added Files:
	gdm-2.24.0-fix-icon-scale.patch 
Log Message:
- pull patch from upstream to scale face icons with fontsize


gdm-2.24.0-fix-icon-scale.patch:

--- NEW FILE gdm-2.24.0-fix-icon-scale.patch ---
diff -up gdm-2.24.0/gui/simple-greeter/gdm-user-chooser-widget.c.fix-icon-scale gdm-2.24.0/gui/simple-greeter/gdm-user-chooser-widget.c
--- gdm-2.24.0/gui/simple-greeter/gdm-user-chooser-widget.c.fix-icon-scale	2008-09-22 13:01:21.000000000 -0400
+++ gdm-2.24.0/gui/simple-greeter/gdm-user-chooser-widget.c	2008-09-30 17:31:00.000000000 -0400
@@ -51,7 +51,7 @@ enum {
 
 #define GDM_USER_CHOOSER_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_USER_CHOOSER_WIDGET, GdmUserChooserWidgetPrivate))
 
-#define ICON_SIZE 96
+#define MAX_ICON_SIZE 128
 
 struct GdmUserChooserWidgetPrivate
 {
@@ -83,6 +83,45 @@ static void     gdm_user_chooser_widget_
 
 G_DEFINE_TYPE (GdmUserChooserWidget, gdm_user_chooser_widget, GDM_TYPE_CHOOSER_WIDGET)
 
+static int
+get_font_height_for_widget (GtkWidget *widget)
+{
+        PangoFontMetrics *metrics;
+        PangoContext     *context;
+        int               ascent;
+        int               descent;
+        int               height;
+
+        gtk_widget_ensure_style (widget);
+        context = gtk_widget_get_pango_context (widget);
+        metrics = pango_context_get_metrics (context,
+                                             widget->style->font_desc,
+                                             pango_context_get_language (context));
+
+        ascent = pango_font_metrics_get_ascent (metrics);
+        descent = pango_font_metrics_get_descent (metrics);
+        height = PANGO_PIXELS (ascent + descent);
+        pango_font_metrics_unref (metrics);
+        return height;
+}
+
+static int
+get_icon_height_for_widget (GtkWidget *widget)
+{
+        int font_height;
+        int height;
+
+        font_height = get_font_height_for_widget (widget);
+        height = 3 * font_height;
+        if (height > MAX_ICON_SIZE) {
+                height = MAX_ICON_SIZE;
+        }
+
+        g_debug ("GdmUserChooserWidget: font height %d; using icon size %d", font_height, height);
+
+        return height;
+}
+
 static void
 add_user_other (GdmUserChooserWidget *widget)
 {
@@ -295,12 +334,14 @@ add_user (GdmUserChooserWidget *widget,
         GdkPixbuf    *pixbuf;
         char         *tooltip;
         gboolean      is_logged_in;
+        int           size;
 
         if (!widget->priv->show_normal_users) {
                 return;
         }
 
-        pixbuf = gdm_user_render_icon (user, ICON_SIZE);
+        size = get_icon_height_for_widget (widget);
+        pixbuf = gdm_user_render_icon (user, size);
         if (pixbuf == NULL && widget->priv->stock_person_pixbuf != NULL) {
                 pixbuf = g_object_ref (widget->priv->stock_person_pixbuf);
         }
@@ -537,10 +578,13 @@ static GdkPixbuf *
 get_stock_person_pixbuf (GdmUserChooserWidget *widget)
 {
         GdkPixbuf *pixbuf;
+        int        size;
+
+        size = get_icon_height_for_widget (widget);
 
         pixbuf = gtk_icon_theme_load_icon (widget->priv->icon_theme,
                                            DEFAULT_USER_ICON,
-                                           ICON_SIZE,
+                                           size,
                                            0,
                                            NULL);
 
@@ -551,10 +595,13 @@ static GdkPixbuf *
 get_logged_in_pixbuf (GdmUserChooserWidget *widget)
 {
         GdkPixbuf *pixbuf;
+        int        size;
+
+        size = get_icon_height_for_widget (widget);
 
         pixbuf = gtk_icon_theme_load_icon (widget->priv->icon_theme,
                                            "emblem-default",
-                                           ICON_SIZE / 3,
+                                           size / 3,
                                            0,
                                            NULL);
 


Index: gdm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gdm/devel/gdm.spec,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -r1.425 -r1.426
--- gdm.spec	30 Sep 2008 20:56:20 -0000	1.425
+++ gdm.spec	30 Sep 2008 21:32:05 -0000	1.426
@@ -91,6 +91,8 @@
 Patch7: gdm-2.23.92-filter-dupes-from-lang-list.patch
 Patch8: gdm-2.23.92-another-locale-fixup.patch
 Patch9: gdm-2.23.92-fix-crash.patch
+# Fix pulled from upstream
+Patch10: gdm-2.24.0-fix-icon-scale.patch
 
 # Fedora-specific
 Patch99: gdm-2.23.1-fedora-logo.patch
@@ -121,6 +123,7 @@
 %patch7 -p1 -b .filter-dupes-from-lang-list
 %patch8 -p1 -b .another-locale-fixup
 %patch9 -p1 -b .fix-crash
+%patch10 -p1 -b .fix-icon-scale
 
 %patch99 -p1 -b .fedora-logo
 
@@ -326,6 +329,7 @@
 * Tue Sep 30 2008 Ray Strode <rstrode at redhat.com> - 1:2.24.0-6
 - drop background priority change.  Choppyiness in -3 ended up
   being a bug in gnome-settings-daemon.
+- pull patch from upstream to scale face icons with fontsize
 
 * Thu Sep 25 2008 Matthias Clasen <mclasen at redhat.com> - 1:2.24.0-5
 - Require gnome-session




More information about the fedora-extras-commits mailing list