From c8089179f84a2cabd84a47a800aaadd9af8bd9b8 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 4 Dec 2020 09:04:49 +0200 Subject: Added a second sidebar; removed hover outline A sidebar on the right is a better solution than a kludgy non-interactive special-purpose outline that appears when hoving the mouse on the document scrollbar. --- src/ui/widget.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/ui/widget.c') diff --git a/src/ui/widget.c b/src/ui/widget.c index 4d50da38..f3e73ee7 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c @@ -263,10 +263,13 @@ void arrange_Widget(iWidget *d) { setFlags_Widget(d, wasCollapsed_WidgetFlag, iTrue); return; } - if (d->flags & moveToParentRightEdge_WidgetFlag) { + if (d->flags & moveToParentLeftEdge_WidgetFlag) { + d->rect.pos.x = d->padding[0]; + } + else if (d->flags & moveToParentRightEdge_WidgetFlag) { d->rect.pos.x = width_Rect(innerRect_Widget_(d->parent)) - width_Rect(d->rect); } - if (d->flags & centerHorizontal_WidgetFlag) { + else if (d->flags & centerHorizontal_WidgetFlag) { centerHorizontal_Widget_(d); } if (d->flags & resizeToParentWidth_WidgetFlag) { @@ -388,7 +391,8 @@ void arrange_Widget(iWidget *d) { continue; } if (d->flags & (arrangeHorizontal_WidgetFlag | arrangeVertical_WidgetFlag)) { - if (child->flags & moveToParentRightEdge_WidgetFlag) { + if (child->flags & + (moveToParentLeftEdge_WidgetFlag | moveToParentRightEdge_WidgetFlag)) { continue; /* Not part of the sequential arrangement .*/ } child->rect.pos = pos; @@ -422,7 +426,8 @@ void arrange_Widget(iWidget *d) { iForEach(ObjectList, j, d->children) { iWidget *child = as_Widget(j.object); if (child->flags & - (resizeToParentWidth_WidgetFlag | moveToParentRightEdge_WidgetFlag)) { + (resizeToParentWidth_WidgetFlag | moveToParentLeftEdge_WidgetFlag | + moveToParentRightEdge_WidgetFlag)) { arrange_Widget(child); } } -- cgit v1.2.3