summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-29 16:53:39 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-29 16:53:39 +0300
commit5039199857ed0b1644a319d3cc514d63c3e3db45 (patch)
treee57e58592229e4bfed50ce12aa859ee07ee864c2 /src/ui/widget.c
parent190684240e303ad708e0522432849332011964f3 (diff)
Working on multiple UI roots
Added a menu for changing the split mode.
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 590dbe70..e4d92b35 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -225,6 +225,13 @@ void setCommandHandler_Widget(iWidget *d, iBool (*handler)(iWidget *, const char
225 d->commandHandler = handler; 225 d->commandHandler = handler;
226} 226}
227 227
228void setRoot_Widget(iWidget *d, iRoot *root) {
229 d->root = root;
230 iForEach(ObjectList, i, d->children) {
231 setRoot_Widget(i.object, root);
232 }
233}
234
228static int numExpandingChildren_Widget_(const iWidget *d) { 235static int numExpandingChildren_Widget_(const iWidget *d) {
229 int count = 0; 236 int count = 0;
230 iConstForEach(ObjectList, i, d->children) { 237 iConstForEach(ObjectList, i, d->children) {
@@ -749,7 +756,8 @@ iLocalDef iBool isMouseEvent_(const SDL_Event *ev) {
749static iBool filterEvent_Widget_(const iWidget *d, const SDL_Event *ev) { 756static iBool filterEvent_Widget_(const iWidget *d, const SDL_Event *ev) {
750 const iBool isKey = isKeyboardEvent_(ev); 757 const iBool isKey = isKeyboardEvent_(ev);
751 const iBool isMouse = isMouseEvent_(ev); 758 const iBool isMouse = isMouseEvent_(ev);
752 if (d->flags & disabled_WidgetFlag) { 759 if ((d->flags & disabled_WidgetFlag) || (d->flags & hidden_WidgetFlag &&
760 d->flags & disabledWhenHidden_WidgetFlag)) {
753 if (isKey || isMouse) return iFalse; 761 if (isKey || isMouse) return iFalse;
754 } 762 }
755 if (d->flags & hidden_WidgetFlag) { 763 if (d->flags & hidden_WidgetFlag) {