about summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2013-05-02 19:33:17 +0000
committerokan <okan>2013-05-02 19:33:17 +0000
commit9de81f3d2e0810f27740b32a2a81d8729eedae4a (patch)
tree28f31606790ccd932dc941936245d4080498a87c
parentbb56bf4c4b97d0141792cc99a8a31531424476c5 (diff)
downloadcwm-9de81f3d2e0810f27740b32a2a81d8729eedae4a.tar.gz
cwm-9de81f3d2e0810f27740b32a2a81d8729eedae4a.tar.xz
cwm-9de81f3d2e0810f27740b32a2a81d8729eedae4a.zip
get rid of cc->name in the resize box and make dimensions more readable.
-rw-r--r--mousefunc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/mousefunc.c b/mousefunc.c
index 5f01df2..e43fd1b 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -50,25 +50,20 @@ static void
 mousefunc_sweep_draw(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = cc->sc;
-	char			 asize[10]; /* fits "nnnnxnnnn\0" */
-	int			 width, width_size, width_name, height;
+	char			 asize[14]; /* fits " nnnn x nnnn \0" */
 
-	(void)snprintf(asize, sizeof(asize), "%dx%d",
+	(void)snprintf(asize, sizeof(asize), " %4d x %-4d ",
 	    (cc->geom.w - cc->hint.basew) / cc->hint.incw,
 	    (cc->geom.h - cc->hint.baseh) / cc->hint.inch);
-	width_size = font_width(sc->xftfont, asize, strlen(asize)) + 4;
-	width_name = font_width(sc->xftfont, cc->name, strlen(cc->name)) + 4;
-	width = MAX(width_size, width_name);
-	height = sc->xftfont->height + 1;
 
 	XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
-	XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0, width, height * 2);
+	XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0,
+	    font_width(sc->xftfont, asize, strlen(asize)), sc->xftfont->height);
 	XMapWindow(X_Dpy, sc->menuwin);
 	XClearWindow(X_Dpy, sc->menuwin);
-	font_draw(sc, cc->name, strlen(cc->name), sc->menuwin, 0,
-	    2, sc->xftfont->ascent + 1);
-	font_draw(sc, asize, strlen(asize), sc->menuwin, 0,
-	    width / 2 - width_size / 2, height + sc->xftfont->ascent + 1);
+
+	font_draw(sc, asize, strlen(asize), sc->menuwin, 0, 0,
+	    sc->xftfont->ascent + 1);
 }
 
 void