commit cf551b7ab2083bfbdc4882949531bdcb07b48005
parent 772cc1d9aeac6a847e5e619db347edb55b5b2b43
Author: Christoph Lohmann <20h@r-36.net>
Date:   Mon, 12 Sep 2011 15:30:50 +0200
Adding fat finger mode.
Diffstat:
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -8,4 +8,5 @@ static const char *highlightbgcolor = "#bbbbbb";
 static const char *highlightfgcolor = "#000000";
 
 static float widthscaling = 1.5;
+static float heightscaling = 2.0;
 
diff --git a/thingmenu.1 b/thingmenu.1
@@ -16,7 +16,8 @@
 .Op Fl ww Ar width
 .Op Fl wx Ar x position
 .Op Fl wy Ar y position
-.Op Fl ws Ar width scaling
+.Op Fl ws Ar widthscaling
+.Op Fl hs Ar heightscaling
 .Op Fl -
 .Ar label0 cmd0 [label1 cmd1 ...]
 .Ek
@@ -78,7 +79,10 @@ Define the absolute x position.
 Define the absolute y position.
 .
 .It Fl ws
-Define the width scaling ws.
+Define the width scaling.
+.
+.It Fl hs
+Define the height scaling.
 .
 .El
 .
diff --git a/thingmenu.c b/thingmenu.c
@@ -407,9 +407,9 @@ setup(void)
 	}
 	if (wh == 0) {
 		if (horizontal) {
-			wh = dc.font.height * 2;
+			wh = dc.font.height * heightscaling;
 		} else {
-			wh = nentries * (dc.font.height * 2);
+			wh = nentries * dc.font.height * heightscaling;
 		}
 	}
 	if (wy == 0)
@@ -519,7 +519,8 @@ void
 usage(char *argv0)
 {
 	fprintf(stderr, "usage: %s [-hxso] [-wh height] [-ww width] "
-			"[-wx x position] [-wy y position] [--] "
+			"[-wx x position] [-wy y position] [-ws widthscaling] "
+			"[-hs heightscaling] [--] "
 			"label0 cmd0 [label1 cmd1 ...]\n", argv0);
 	exit(1);
 }
@@ -540,7 +541,6 @@ main(int argc, char *argv[])
 	for (; argv[i]; i++) {
 		if (argv[i][0] != '-')
 			break;
-
 		if (argv[i][1] == '-') {
 			i++;
 			break;
@@ -548,7 +548,15 @@ main(int argc, char *argv[])
 
 		switch (argv[i][1]) {
 		case 'h':
-			usage(argv[0]);
+			switch ((i >= argc - 1)? 0 : argv[i][2]) {
+			case 's':
+				heightscaling = atof(argv[i+1]);
+				i++;
+				break;
+			default:
+				usage(argv[0]);
+			}
+			break;
 		case 'o':
 			horizontal = True;
 			break;