summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-20 22:17:01 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-20 22:17:01 +0200
commit3b16b823d5840096402ec0bddc3d35f6028b75f6 (patch)
treef12049b85eed1afa9912e45d1911c7c1fb69c9fd /src/ui/widget.c
parent1ca771a41e430f866e3a3270f285fc9a7eacfc65 (diff)
Revising sidebar placement for phones
In portrait mode, phones have no room for sidebars so need to use a different widget arrangement.
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 0e020080..9320659c 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -763,7 +763,7 @@ size_t childIndex_Widget(const iWidget *d, const iAnyObject *child) {
763} 763}
764 764
765iAny *hitChild_Widget(const iWidget *d, iInt2 coord) { 765iAny *hitChild_Widget(const iWidget *d, iInt2 coord) {
766 if (d->flags & (unhittable_WidgetFlag | hidden_WidgetFlag)) { 766 if (d->flags & hidden_WidgetFlag) {
767 return NULL; 767 return NULL;
768 } 768 }
769 /* Check for on-top widgets first. */ 769 /* Check for on-top widgets first. */
@@ -773,14 +773,17 @@ iAny *hitChild_Widget(const iWidget *d, iInt2 coord) {
773 if (found) return found; 773 if (found) return found;
774 } 774 }
775 } 775 }
776 iForEach(ObjectList, i, d->children) { 776 iReverseForEach(ObjectList, i, d->children) {
777 const iWidget *child = constAs_Widget(i.object); 777 const iWidget *child = constAs_Widget(i.object);
778 if (~child->flags & keepOnTop_WidgetFlag) { 778 if (~child->flags & keepOnTop_WidgetFlag) {
779 iAny *found = hitChild_Widget(child, coord); 779 iAny *found = hitChild_Widget(child, coord);
780 if (found) return found; 780 if (found) return found;
781 } 781 }
782 } 782 }
783 if (contains_Widget(d, coord)) { 783 if (class_Widget(d) == &Class_Widget) {
784 return NULL; /* Plain widgets are not hittable. */
785 }
786 if (~d->flags & unhittable_WidgetFlag && contains_Widget(d, coord)) {
784 return iConstCast(iWidget *, d); 787 return iConstCast(iWidget *, d);
785 } 788 }
786 return NULL; 789 return NULL;