From f54ff424a0f92bd099057db500e41a6f29a6ee8d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 25 Feb 2008 20:09:19 +0100 Subject: [PATCH] check widgets position --- client.c | 1 - widget.c | 32 +++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/client.c b/client.c index c3994eb9..31d31a91 100644 --- a/client.c +++ b/client.c @@ -35,7 +35,6 @@ #include "xutil.h" #include "layouts/floating.h" - extern AwesomeConf globalconf; /** Load windows properties, restoring client's tag diff --git a/widget.c b/widget.c index c36af93e..c0137de8 100644 --- a/widget.c +++ b/widget.c @@ -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