wibox: Always resize, otherwise your wiboxes are too large or small when the workarea changes.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Maarten Maathuis 2008-12-06 23:24:12 +01:00 committed by Julien Danjou
parent 7453098cf5
commit 2ab78b847d
1 changed files with 7 additions and 8 deletions

15
wibox.c
View File

@ -360,11 +360,13 @@ wibox_position_update(wibox_t *wibox)
} }
} }
/* The "length" of a wibox is always chosen to be the optimal size (non-floating).
* The "width" of a wibox is kept if it exists.
*/
switch(wibox->position) switch(wibox->position)
{ {
case Right: case Right:
wingeom.height = wibox->sw.geometry.height > 0 ? wingeom.height = area.height - 2 * wibox->sw.border.width;
wibox->sw.geometry.height : area.height - 2 * wibox->sw.border.width;
wingeom.width = wibox->sw.geometry.width > 0 ? wibox->sw.geometry.width : 1.5 * globalconf.font->height; wingeom.width = wibox->sw.geometry.width > 0 ? wibox->sw.geometry.width : 1.5 * globalconf.font->height;
wingeom.x = area.x + area.width - wingeom.width - 2 * wibox->sw.border.width; wingeom.x = area.x + area.width - wingeom.width - 2 * wibox->sw.border.width;
switch(wibox->align) switch(wibox->align)
@ -381,8 +383,7 @@ wibox_position_update(wibox_t *wibox)
} }
break; break;
case Left: case Left:
wingeom.height = wibox->sw.geometry.height > 0 ? wingeom.height = area.height - 2 * wibox->sw.border.width;
wibox->sw.geometry.height : area.height - 2 * wibox->sw.border.width;
wingeom.width = wibox->sw.geometry.width > 0 ? wibox->sw.geometry.width : 1.5 * globalconf.font->height; wingeom.width = wibox->sw.geometry.width > 0 ? wibox->sw.geometry.width : 1.5 * globalconf.font->height;
wingeom.x = area.x; wingeom.x = area.x;
switch(wibox->align) switch(wibox->align)
@ -399,8 +400,7 @@ wibox_position_update(wibox_t *wibox)
break; break;
case Bottom: case Bottom:
wingeom.height = wibox->sw.geometry.height > 0 ? wibox->sw.geometry.height : 1.5 * globalconf.font->height; wingeom.height = wibox->sw.geometry.height > 0 ? wibox->sw.geometry.height : 1.5 * globalconf.font->height;
wingeom.width = wibox->sw.geometry.width > 0 ? wingeom.width = area.width - 2 * wibox->sw.border.width;
wibox->sw.geometry.width : area.width - 2 * wibox->sw.border.width;
wingeom.y = (area.y + area.height) - wingeom.height - 2 * wibox->sw.border.width; wingeom.y = (area.y + area.height) - wingeom.height - 2 * wibox->sw.border.width;
wingeom.x = area.x; wingeom.x = area.x;
switch(wibox->align) switch(wibox->align)
@ -417,8 +417,7 @@ wibox_position_update(wibox_t *wibox)
break; break;
case Top: case Top:
wingeom.height = wibox->sw.geometry.height > 0 ? wibox->sw.geometry.height : 1.5 * globalconf.font->height; wingeom.height = wibox->sw.geometry.height > 0 ? wibox->sw.geometry.height : 1.5 * globalconf.font->height;
wingeom.width = wibox->sw.geometry.width > 0 ? wingeom.width = area.width - 2 * wibox->sw.border.width;
wibox->sw.geometry.width : area.width - 2 * wibox->sw.border.width;
wingeom.x = area.x; wingeom.x = area.x;
wingeom.y = area.y; wingeom.y = area.y;
switch(wibox->align) switch(wibox->align)