]> Dogcows Code - chaz/tint2/commitdiff
cleanup
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 31 May 2009 20:36:16 +0000 (20:36 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 31 May 2009 20:36:16 +0000 (20:36 +0000)
ChangeLog
src/panel.c
src/tint2

index afc4a5e6a8d6d18a5fc5c6127f3f3c329cb2a68b..e3ae6e40758853e589085247b2e1e2a097f21084 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-05-31
+- fixed issue 86 : padding bug
+
 2009-05-31
 - fixed issue 87 and 88 : battery detection
 
index 3a8bb8fb6c74997c1c402e812d400cecfc57d310..7d0fa90488c9de043d131f8d8f6613938aa331e4 100644 (file)
@@ -174,11 +174,6 @@ void resize_panel(void *obj)
    Panel *panel = (Panel*)obj;
    int taskbar_width, modulo_width, taskbar_on_screen;
 
-//printf("resize_panel :  : posx et width des barres de taches\n");
-
-   if (panel_mode == MULTI_DESKTOP) taskbar_on_screen = panel->nb_desktop;
-   else taskbar_on_screen = 1;
-
    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);
@@ -188,29 +183,31 @@ void resize_panel(void *obj)
    if (systray.area.on_screen && systray.area.width && panel == &panel1[0])
        taskbar_width -= (systray.area.width + panel->area.paddingx);
 
-   taskbar_width = (taskbar_width - ((taskbar_on_screen-1) * panel->area.paddingx)) / taskbar_on_screen;
-
-   if (taskbar_on_screen > 1)
-      modulo_width = (taskbar_width - ((taskbar_on_screen-1) * panel->area.paddingx)) % taskbar_on_screen;
-   else
+   if (panel_mode == MULTI_DESKTOP) {
+               taskbar_on_screen = panel->nb_desktop;
+               int width = taskbar_width - ((taskbar_on_screen-1) * panel->area.paddingx);
+          taskbar_width = width / taskbar_on_screen;
+      modulo_width = width % taskbar_on_screen;
+       }
+   else {
+               taskbar_on_screen = 1;
       modulo_width = 0;
+       }
 
        // change posx and width for all taskbar
-   int i, modulo=0, posx=0;
+   int i, posx;
+       posx = panel->area.pix.border.width + panel->area.paddingxlr;
    for (i=0 ; i < panel->nb_desktop ; i++) {
-      if ((i % taskbar_on_screen) == 0) {
-         posx = panel->area.pix.border.width + panel->area.paddingxlr;
-         modulo = modulo_width;
-      }
-      else posx += taskbar_width + panel->area.paddingx;
-
       panel->taskbar[i].area.posx = posx;
       panel->taskbar[i].area.width = taskbar_width;
       panel->taskbar[i].area.resize = 1;
-      if (modulo) {
+      if (modulo_width) {
          panel->taskbar[i].area.width++;
-         modulo--;
+         modulo_width--;
       }
+               //printf("taskbar %d : posx %d, width, %d, posy %d\n", i, posx, panel->taskbar[i].area.width, posx + panel->taskbar[i].area.width);
+      if (panel_mode == MULTI_DESKTOP)
+       posx += panel->taskbar[i].area.width + panel->area.paddingx;
    }
 }
 
index b9e7d04d71ee303fa6a38a120ad8371e12180ea4..94f1e1f8b7921fe9e3d82821613624847717d391 100755 (executable)
Binary files a/src/tint2 and b/src/tint2 differ
This page took 0.027631 seconds and 4 git commands to generate.