get rid of WINWIDTH/WINHEIGHT. mikasizes should still work
authorDana Jansens <danakj@orodu.net>
Thu, 7 Jun 2007 17:59:41 +0000 (17:59 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 7 Jun 2007 17:59:41 +0000 (17:59 +0000)
gui.c

diff --git a/gui.c b/gui.c
index 653e266..f49d017 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -27,15 +27,6 @@ static RrAppearance *a_icon;
 #define ICONWIDTH 16
 #define ICONHEIGHT 16
 
-/* XXX get this from the font - i think it should be user configurable, most
- panels provide an option for this */
-#define WINHEIGHT 24
-#ifndef MIKACHU
-#        define WINWIDTH sc->width
-#else
-int WINWIDTH = 827;
-#endif
-
 static void set_icon_geometry(screen *sc, taskbar *tb, task *tk);
 
 #define SURF(x) with->surface.x
@@ -140,10 +131,11 @@ void gui_create_taskbar(screen *sc, taskbar *tb)
 
     att.event_mask = ButtonPressMask;
 
+    /* XXX make the height conigurable */
     tb->x = 0;
-    tb->y = sc->height - WINHEIGHT;
-    tb->w = WINWIDTH;
-    tb->h = WINHEIGHT;
+    tb->y = sc->height - 24;
+    tb->w = sc->width;
+    tb->h = 24;
 
     tb->win = XCreateWindow(/* display  */ sc->dd,
                             /* parent   */ sc->root,
@@ -225,8 +217,8 @@ void gui_draw_task(screen *sc, taskbar *tb, task *tk, int redraw)
     a->texture[0].data.text.string = tk->name;
     b->surface.parentx = tk->pos_x;
 
-    RrPaintPixmap(b, tk->width, WINHEIGHT);
-    RrPaintPixmap(a, tk->width-3*PADDING-ICON_SIZE, WINHEIGHT);
+    RrPaintPixmap(b, tk->width, tb->h);
+    RrPaintPixmap(a, tk->width-3*PADDING-ICON_SIZE, tb->h);
 
     if (i) {
         RrPaintPixmap(a_icon, ICON_SIZE, ICON_SIZE);
@@ -235,9 +227,9 @@ void gui_draw_task(screen *sc, taskbar *tb, task *tk, int redraw)
     }
 
     XCopyArea(sc->dd, a->pixmap, b->pixmap, fore_gc, 0, 0,
-              tk->width-3*PADDING-ICON_SIZE, WINHEIGHT, ICON_SIZE+2*PADDING, 0);
+              tk->width-3*PADDING-ICON_SIZE, tb->h, ICON_SIZE+2*PADDING, 0);
     XCopyArea(sc->dd, b->pixmap, bgpixmap, fore_gc, 0, 0,
-              tk->width, WINHEIGHT, tk->pos_x, 0);
+              tk->width, tb->h, tk->pos_x, 0);
 
     a_icon->texture[1].type = RR_TEXTURE_NONE;
     XFreePixmap(sc->dd, a->pixmap);
@@ -262,13 +254,13 @@ void gui_draw_taskbar(screen *sc, taskbar *tb)
 #endif
 
     x = pager_size + 2;
-    width = WINWIDTH - (pager_size + GRILL_WIDTH);
+    width = tb->w - (pager_size + GRILL_WIDTH);
 #warning only rerender if width changed!
     if (bgpixmap) XFreePixmap(sc->dd, bgpixmap);
-    bgpixmap = XCreatePixmap(sc->dd, sc->root, WINWIDTH, WINHEIGHT, RrDepth(sc->rr));
+    bgpixmap = XCreatePixmap(sc->dd, sc->root, tb->w, tb->h, RrDepth(sc->rr));
 
-    XFreePixmap(sc->dd, RrPaintPixmap(background, WINWIDTH, WINHEIGHT));
-    XCopyArea(sc->dd, background->pixmap, bgpixmap, fore_gc, 0, 0, WINWIDTH, WINHEIGHT, 0, 0);
+    XFreePixmap(sc->dd, RrPaintPixmap(background, tb->w, tb->h));
+    XCopyArea(sc->dd, background->pixmap, bgpixmap, fore_gc, 0, 0, tb->w, tb->h, 0, 0);
 
     /* find the number of visible tasks */
     for (tk = tb->task_list; tk; tk = tk->next) {