cleanup
git-svn-id: http://tint2.googlecode.com/svn/trunk@81 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
a081c0a57d
commit
2c80522212
3 changed files with 19 additions and 19 deletions
|
@ -1,3 +1,6 @@
|
|||
2009-05-31
|
||||
- fixed issue 86 : padding bug
|
||||
|
||||
2009-05-31
|
||||
- fixed issue 87 and 88 : battery detection
|
||||
|
||||
|
|
35
src/panel.c
35
src/panel.c
|
@ -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;
|
||||
for (i=0 ; i < panel->nb_desktop ; i++) {
|
||||
if ((i % taskbar_on_screen) == 0) {
|
||||
int i, posx;
|
||||
posx = panel->area.pix.border.width + panel->area.paddingxlr;
|
||||
modulo = modulo_width;
|
||||
}
|
||||
else posx += taskbar_width + panel->area.paddingx;
|
||||
|
||||
for (i=0 ; i < panel->nb_desktop ; i++) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
BIN
src/tint2
BIN
src/tint2
Binary file not shown.
Loading…
Reference in a new issue