[Xfce4-commits] <xfwm4:ochosi/tabwin> Tabwin list mode relative label width

Simon Steinbeiss noreply at xfce.org
Thu Dec 12 11:12:01 CET 2013


Updating branch refs/heads/ochosi/tabwin
         to ba64c3ab91dd6512dd7e3e06f3d119bdfaacd1b5 (commit)
       from 43c4cbe83ceb9e1e9deb416e785871fe9ebbdf52 (commit)

commit ba64c3ab91dd6512dd7e3e06f3d119bdfaacd1b5
Author: Eric Koegel <eric.koegel at gmail.com>
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 <simon.steinbeiss at elfenbeinturm.at>

 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);


More information about the Xfce4-commits mailing list