check widgets position

This commit is contained in:
Julien Danjou 2008-02-25 20:09:19 +01:00
parent 960d870b0b
commit f54ff424a0
2 changed files with 25 additions and 8 deletions

View File

@ -35,7 +35,6 @@
#include "xutil.h"
#include "layouts/floating.h"
extern AwesomeConf globalconf;
/** Load windows properties, restoring client's tag

View File

@ -32,18 +32,36 @@ void
widget_calculate_alignments(Widget *widget)
{
for(; widget && widget->alignment != AlignFlex; widget = widget->next)
if(widget->alignment == AlignAuto)
{
switch(widget->alignment)
{
case AlignCenter:
warn("widgets cannot be center aligned\n");
case AlignAuto:
widget->alignment = AlignLeft;
break;
default:
break;
}
}
if(widget)
for(widget = widget->next; widget; widget = widget->next)
{
if(widget->alignment == AlignFlex)
warn("Multiple flex widgets in panel -"
" ignoring flex for all but the first.");
if(widget->alignment == AlignAuto)
switch(widget->alignment)
{
case AlignFlex:
warn("multiple flex widgets in panel -"
" ignoring flex for all but the first.\n");
widget->alignment = AlignRight;
}
break;
case AlignCenter:
warn("widgets cannot be center aligned\n");
case AlignAuto:
widget->alignment = AlignRight;
break;
default:
break;
}
}
int