diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/labelwidget.c | 6 | ||||
-rw-r--r-- | src/ui/widget.c | 16 | ||||
-rw-r--r-- | src/ui/widget.h | 1 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index 28f43173..f23091d8 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c | |||
@@ -51,7 +51,13 @@ static iBool checkModifiers_(int have, int req) { | |||
51 | } | 51 | } |
52 | 52 | ||
53 | static void trigger_LabelWidget_(const iLabelWidget *d) { | 53 | static void trigger_LabelWidget_(const iLabelWidget *d) { |
54 | const iWidget *w = constAs_Widget(d); | ||
54 | postCommand_Widget(&d->widget, "%s", cstr_String(&d->command)); | 55 | postCommand_Widget(&d->widget, "%s", cstr_String(&d->command)); |
56 | if (flags_Widget(w) & radio_WidgetFlag) { | ||
57 | iForEach(ObjectList, i, children_Widget(w->parent)) { | ||
58 | setFlags_Widget(i.object, selected_WidgetFlag, d == i.object); | ||
59 | } | ||
60 | } | ||
55 | } | 61 | } |
56 | 62 | ||
57 | static iBool processEvent_LabelWidget_(iLabelWidget *d, const SDL_Event *ev) { | 63 | static iBool processEvent_LabelWidget_(iLabelWidget *d, const SDL_Event *ev) { |
diff --git a/src/ui/widget.c b/src/ui/widget.c index d218d7ee..459c2ae1 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -124,13 +124,15 @@ int64_t flags_Widget(const iWidget *d) { | |||
124 | } | 124 | } |
125 | 125 | ||
126 | void setFlags_Widget(iWidget *d, int64_t flags, iBool set) { | 126 | void setFlags_Widget(iWidget *d, int64_t flags, iBool set) { |
127 | iChangeFlags(d->flags, flags, set); | 127 | if (d) { |
128 | if (flags & keepOnTop_WidgetFlag) { | 128 | iChangeFlags(d->flags, flags, set); |
129 | if (set) { | 129 | if (flags & keepOnTop_WidgetFlag) { |
130 | pushBack_PtrArray(onTop_RootData_(), d); | 130 | if (set) { |
131 | } | 131 | pushBack_PtrArray(onTop_RootData_(), d); |
132 | else { | 132 | } |
133 | removeOne_PtrArray(onTop_RootData_(), d); | 133 | else { |
134 | removeOne_PtrArray(onTop_RootData_(), d); | ||
135 | } | ||
134 | } | 136 | } |
135 | } | 137 | } |
136 | } | 138 | } |
diff --git a/src/ui/widget.h b/src/ui/widget.h index a2be30e9..f39612ed 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h | |||
@@ -59,6 +59,7 @@ enum iWidgetFlag { | |||
59 | tight_WidgetFlag = iBit(13), /* smaller padding */ | 59 | tight_WidgetFlag = iBit(13), /* smaller padding */ |
60 | keepOnTop_WidgetFlag = iBit(14), /* gets events first; drawn last */ | 60 | keepOnTop_WidgetFlag = iBit(14), /* gets events first; drawn last */ |
61 | mouseModal_WidgetFlag = iBit(15), /* eats all unprocessed mouse events */ | 61 | mouseModal_WidgetFlag = iBit(15), /* eats all unprocessed mouse events */ |
62 | radio_WidgetFlag = iBit(16), /* select on click; deselect siblings */ | ||
62 | /* arrangement */ | 63 | /* arrangement */ |
63 | fixedPosition_WidgetFlag = iBit(17), | 64 | fixedPosition_WidgetFlag = iBit(17), |
64 | arrangeHorizontal_WidgetFlag = iBit(18), /* arrange children horizontally */ | 65 | arrangeHorizontal_WidgetFlag = iBit(18), /* arrange children horizontally */ |