This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository e16.

View the commit online.

commit de581414db2c357a6d322ffe0799937de0004c40
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Mon Sep 18 15:28:38 2023 +0200

    menus: Limit menu item text width
    
    E.g. when a window title is rediculously long, the window list could
    become rediculously wide.
    The width is now rather arbitrarily limited to a third of the screen
    width.
    
    Reported by Milan Maljković.
---
 src/menus.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/menus.c b/src/menus.c
index 247db649..8d0e2446 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -696,7 +696,7 @@ MenuAddItem(Menu * m, MenuItem * item)
 static void
 MenuRealize(Menu * m)
 {
-   int                 i, maxh, maxw, nmaxy;
+   int                 i, maxh, maxw, nmaxy, maxtw;
    int                 maxx1, maxx2, w, h, x, y, r, mmw, mmh;
    char               *s;
    EImage             *im;
@@ -720,6 +720,7 @@ MenuRealize(Menu * m)
      }
 
    maxh = maxw = 0;
+   maxtw = WinGetW(VROOT) / 3;
    maxx1 = 0;
    maxx2 = 0;
    has_i = 0;
@@ -746,6 +747,8 @@ MenuRealize(Menu * m)
 		      17);
 	     if (h > maxh)
 		maxh = h;
+	     if (w > maxtw)
+		w = maxtw;
 	     if (w > maxx1)
 		maxx1 = w;
 	     m->items[i]->text_w = w;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to