[Xfce4-commits] <xfwm4:master> Account for custom font sizes in the tabwin label

Nick Schermer noreply at xfce.org
Sun Feb 23 21:10:22 CET 2014


Updating branch refs/heads/master
         to 3503b8e6cffd83d7198b18d7af747c7f903b477e (commit)
       from 23326d090735ea9adf09eb28ee7525280b77e4b0 (commit)

commit 3503b8e6cffd83d7198b18d7af747c7f903b477e
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Dec 2 08:29:53 2013 +0300

    Account for custom font sizes in the tabwin label
    
    Signed-off-by: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>

 src/tabwin.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/tabwin.c b/src/tabwin.c
index e8713b8..237b44e 100644
--- a/src/tabwin.c
+++ b/src/tabwin.c
@@ -414,8 +414,9 @@ createWindowlist (ScreenInfo *screen_info, TabwinWidget *tbw)
     Client *c;
     GList *client_list;
     GtkWidget *windowlist, *icon, *selected, *window_button, *buttonbox, *buttonlabel, *selected_label;
-    int packpos, monitor_width, monitor_height;
+    int packpos, monitor_width, monitor_height, app_label_height;
     Tabwin *t;
+    PangoLayout *layout;
     gint icon_size = WIN_ICON_SIZE;
 
     TRACE ("entering createWindowlist");
@@ -460,7 +461,12 @@ createWindowlist (ScreenInfo *screen_info, TabwinWidget *tbw)
 
         if (screen_info->params->cycle_tabwin_mode == STANDARD_ICON_GRID)
         {
-            gtk_widget_set_size_request (GTK_WIDGET (window_button), icon_size+24, icon_size+24);
+            /* We need to account for changes to the font size in the user's
+             * appearance theme and gtkrc settings */
+            layout = gtk_widget_create_pango_layout (GTK_WIDGET (tbw), "");
+            pango_layout_get_pixel_size (layout, NULL, &app_label_height);
+
+            gtk_widget_set_size_request (GTK_WIDGET (window_button), icon_size+24, icon_size+app_label_height+8);
             buttonbox = gtk_vbox_new (FALSE, 0);
             buttonlabel = gtk_label_new ("");
             gtk_misc_set_alignment (GTK_MISC (buttonlabel), 0.5, 1.0);


More information about the Xfce4-commits mailing list