better geometry calculations and stuff
authorDana Jansens <danakj@orodu.net>
Mon, 11 Jun 2007 03:37:25 +0000 (03:37 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 11 Jun 2007 03:37:25 +0000 (03:37 +0000)
gui.c

diff --git a/gui.c b/gui.c
index f12d0ef..3d1f9be 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -22,8 +22,9 @@ static RrColor      *focused_text_color;
 
 /* you can edit these */
 #define MAX_TASK_WIDTH 500
+#define HEIGHT (24 + sc->theme->obwidth)
 #define PADDING 2
-#define ICON_SIZE ((tb->drawh)-(4*PADDING))
+#define ICON_SIZE (HEIGHT - sc->theme->obwidth - PADDING*2)
 #define ICON_SPACE (ICON_SIZE + PADDING*2)
 
 static void set_icon_geometry(screen *sc, taskbar *tb, task *tk);
@@ -146,7 +147,7 @@ void gui_create_taskbar(screen *sc, taskbar *tb)
 
     /* XXX make this stuff conigurable */
     tb->w = sc->width * 0.7;
-    tb->h = 28;
+    tb->h = HEIGHT;
 
     tb->x = (sc->width - tb->w) / 2;
     tb->y = sc->height - tb->h;
@@ -235,14 +236,14 @@ void gui_draw_task(screen *sc, taskbar *tb, task *tk, int redraw)
 
     if (i) {
         RrTextureRGBA *d = &a_icon->texture[0].data.rgba;
+        icon_space = ICON_SPACE;
         a_icon->surface.parent = b;
-        a_icon->surface.parentx = PADDING;
-        a_icon->surface.parenty = PADDING;
+        a_icon->surface.parentx = (icon_space - ICON_SIZE) / 2;
+        a_icon->surface.parenty = (tb->drawh - ICON_SIZE) / 2;
         d->width = i->width;
         d->height = i->height;
         d->alpha = tk->iconified ? 0x70 : tk->shaded ? 0xB0 : 0xff;
         d->data = i->data;
-        icon_space = ICON_SPACE;
     }
 
     a->surface.parent = b;