Distribute size correctly between taskbars when center alignment is used and there is only one visible taskbar (Fixes issue #691)
This commit is contained in:
parent
ee92fac10e
commit
427afc61b5
1 changed files with 6 additions and 0 deletions
|
@ -528,6 +528,8 @@ gboolean resize_panel(void *obj)
|
||||||
}
|
}
|
||||||
} else if (taskbar_alignment == ALIGN_CENTER) {
|
} else if (taskbar_alignment == ALIGN_CENTER) {
|
||||||
slack /= 2;
|
slack /= 2;
|
||||||
|
Taskbar *left_taskbar = NULL;
|
||||||
|
Taskbar *right_taskbar = NULL;
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
for (int i = 0; i < panel->num_desktops; i++) {
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
Taskbar *taskbar = &panel->taskbar[i];
|
||||||
if (!taskbar->area.on_screen)
|
if (!taskbar->area.on_screen)
|
||||||
|
@ -537,6 +539,7 @@ gboolean resize_panel(void *obj)
|
||||||
else
|
else
|
||||||
taskbar->area.height += slack;
|
taskbar->area.height += slack;
|
||||||
taskbar->area.alignment = ALIGN_RIGHT;
|
taskbar->area.alignment = ALIGN_RIGHT;
|
||||||
|
left_taskbar = taskbar;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (int i = panel->num_desktops - 1; i >= 0; i--) {
|
for (int i = panel->num_desktops - 1; i >= 0; i--) {
|
||||||
|
@ -548,8 +551,11 @@ gboolean resize_panel(void *obj)
|
||||||
else
|
else
|
||||||
taskbar->area.height += slack;
|
taskbar->area.height += slack;
|
||||||
taskbar->area.alignment = ALIGN_LEFT;
|
taskbar->area.alignment = ALIGN_LEFT;
|
||||||
|
right_taskbar = taskbar;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (left_taskbar == right_taskbar)
|
||||||
|
left_taskbar->area.alignment = ALIGN_CENTER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No tasks => expand the first visible taskbar
|
// No tasks => expand the first visible taskbar
|
||||||
|
|
Loading…
Reference in a new issue