Updating branch refs/heads/master
         to 5eb8024cf1b28922dda6109d43032a1a4aefa20e (commit)
       from d7b2f5287ecb9e7da2ee33faf86656fc18b0a14e (commit)

commit 5eb8024cf1b28922dda6109d43032a1a4aefa20e
Author: Eric Koegel <[email protected]>
Date:   Thu Dec 12 12:46:43 2013 +0300

    Tabwin list mode relative label width
    
    The width of the application label in the tabwin window while in
    list mode is now relative to the number of columns displays. This
    is scaled to the width of the smallest monitor attached. Now there's
    space for more label info when there are fewer columns and it properly
    displays all the windows when there are lots of them open.
    
    Signed-off-by: Simon Steinbeiss <[email protected]>

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

diff --git a/src/tabwin.c b/src/tabwin.c
index 4d6f887..545e749 100644
--- a/src/tabwin.c
+++ b/src/tabwin.c
@@ -435,7 +435,7 @@ 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, app_label_height;
+    int packpos, monitor_width, monitor_height, app_label_height, label_width;
     Tabwin *t;
     PangoLayout *layout;
     gint icon_size = WIN_ICON_SIZE;
@@ -495,10 +495,12 @@ createWindowlist (ScreenInfo *screen_info, TabwinWidget 
*tbw)
         }
         else
         {
+            label_width = monitor_width / (tbw->grid_cols + 1);
+
             if (icon_size < app_label_height)
-                gtk_widget_set_size_request (GTK_WIDGET (window_button), 
icon_size+256, app_label_height+8);
+                gtk_widget_set_size_request (GTK_WIDGET (window_button), 
label_width, app_label_height+8);
             else
-                gtk_widget_set_size_request (GTK_WIDGET (window_button), 
icon_size+256, icon_size+8);
+                gtk_widget_set_size_request (GTK_WIDGET (window_button), 
label_width, icon_size+8);
             buttonbox = gtk_hbox_new (FALSE, 6);
             buttonlabel = gtk_label_new (c->name);
             gtk_misc_set_alignment (GTK_MISC (buttonlabel), 0, 0.5);
_______________________________________________
Xfce4-commits mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to