]> Dogcows Code - chaz/tint2/blobdiff - src/panel.c
merge battery applet from Sebastian Reichel
[chaz/tint2] / src / panel.c
index adccfea88b60786d63be9c564c33ba85d8c8416f..3a8bb8fb6c74997c1c402e812d400cecfc57d310 100644 (file)
@@ -71,6 +71,8 @@ void init_panel()
                // add childs
           if (p->clock.area.on_screen)
                        p->area.list = g_slist_append(p->area.list, &p->clock);
+               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
                        p->area.list = g_slist_append(p->area.list, &systray);
@@ -180,6 +182,8 @@ 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);
+       if (panel->battery.area.on_screen && panel->battery.area.width)
+               taskbar_width -= (panel->battery.area.width + panel->area.paddingx);
    // 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.022143 seconds and 4 git commands to generate.