[Xfce4-commits] <xfwm4:ochosi/tabwin> Account for custom font sizes in the tabwin label
Simon Steinbeiss
noreply at xfce.org
Mon Dec 2 15:16:02 CET 2013
Updating branch refs/heads/ochosi/tabwin
to 7199f04e2164e84efc14990098056a289167dd41 (commit)
from 4d7b5dc6fb070774ee464f6549d15c809f260412 (commit)
commit 7199f04e2164e84efc14990098056a289167dd41
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