]> Dogcows Code - chaz/tint2/blobdiff - src/panel.c
patch by Christian Ruppert, configure option for battery
[chaz/tint2] / src / panel.c
index 84d5ab9d8d4dac0e2a8d22a24c7ccb2f8f2640dc..825a382e64fb03da2accbaa1d8f924406f9a429e 100644 (file)
@@ -73,12 +73,13 @@ void init_panel()
                // add childs
           if (p->clock.area.on_screen)
                        p->area.list = g_slist_append(p->area.list, &p->clock);
+#ifdef ENABLE_BATTERY
                if (p->battery.area.on_screen)
                        p->area.list = g_slist_append(p->area.list, &p->battery);
-          if (systray.area.on_screen && i == 0) {
-               // systray only on first panel
+#endif
+       // systray only on first panel
+          if (systray.area.on_screen && i == 0)
                        p->area.list = g_slist_append(p->area.list, &systray);
-               }
 
                // detect panel size
                if (p->pourcentx)
@@ -115,6 +116,7 @@ void init_panel()
                else {
                        p->posy = server.monitor[p->monitor].y + server.monitor[p->monitor].height - p->area.height - p->marginy;
                }
+               //printf("posx %d, posy %d, width %d, height %d\n", p->posx, p->posy, p->area.width, p->area.height);
 
                // Catch some events
                XSetWindowAttributes att = { ParentRelative, 0L, 0, 0L, 0, 0, Always, 0L, 0L, False, ExposureMask|ButtonPressMask|ButtonReleaseMask, NoEventMask, False, 0, 0 };
@@ -178,8 +180,10 @@ void resize_panel(void *obj)
    taskbar_width = panel->area.width - (2 * panel->area.paddingxlr) - (2 * panel->area.pix.border.width);
    if (panel->clock.area.on_screen && panel->clock.area.width)
       taskbar_width -= (panel->clock.area.width + panel->area.paddingx);
+#ifdef ENABLE_BATTERY
        if (panel->battery.area.on_screen && panel->battery.area.width)
                taskbar_width -= (panel->battery.area.width + panel->area.paddingx);
+#endif
    // TODO : systray only on first panel. search better implementation !
    if (systray.area.on_screen && systray.area.width && panel == &panel1[0])
        taskbar_width -= (systray.area.width + panel->area.paddingx);
This page took 0.022693 seconds and 4 git commands to generate.