all repos — tint2 @ 2c805222125f0a463d65869a5fe4f293eac11ac7

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

cleanup

git-svn-id: http://tint2.googlecode.com/svn/trunk@81 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

2c805222125f0a463d65869a5fe4f293eac11ac7

parent

a081c0a57d71f510e33c97673a417a0223354375

3 files changed, 19 insertions(+), 19 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,3 +1,6 @@

+2009-05-31 +- fixed issue 86 : padding bug + 2009-05-31 - fixed issue 87 and 88 : battery detection
M src/panel.csrc/panel.c

@@ -174,11 +174,6 @@ {

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 @@ // 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); - 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; } }