[hackers] [wmii] [menu] Make the input width wide enough to hold its contents. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Thu, 16 Oct 2008 20:52:43 +0000 (UTC)

changeset: 2378:9bd488c0141e
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Oct 16 16:52:42 2008 -0400
files: cmd/menu/menu.c
description:
[menu] Make the input width wide enough to hold its contents.

diff -r 9b29b22043d5 -r 9bd488c0141e cmd/menu/menu.c
--- a/cmd/menu/menu.c Thu Oct 16 16:48:25 2008 -0400
+++ b/cmd/menu/menu.c Thu Oct 16 16:52:42 2008 -0400
@@ -127,7 +127,8 @@
         r2 = r;
 
         pad = (font->height & ~1);
- inputw = min(Dx(r) / 3, maxwidth) + pad;
+ inputw = min(Dx(r) / 3, maxwidth);
+ inputw = max(inputw, textwidth(font, input.string)) + pad;
         itemoff = inputw + 2 * ltwidth;
         end = Dx(r) - ltwidth;
 
Received on Thu Oct 16 2008 - 20:52:43 UTC

This archive was generated by hypermail 2.2.0 : Thu Oct 16 2008 - 21:00:09 UTC