diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-08 12:25:17 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-08 12:25:53 +0200 |
commit | d961d957e26f5c0c1b2603a9a0d98305147c15fb (patch) | |
tree | 5a2caecc01918c8f54afb68c5bbd121a89740c11 /src/ui/widget.h | |
parent | 2fb1f5bed356520bc0b668f2a8ffef6c8d0318d2 (diff) |
Fine-tuning touch behavior
Avoid mouse motion events to prevent spurious hover states in the UI.
Diffstat (limited to 'src/ui/widget.h')
-rw-r--r-- | src/ui/widget.h | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/src/ui/widget.h b/src/ui/widget.h index 602e86cb..1229ba7f 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h | |||
@@ -195,18 +195,18 @@ iLocalDef iWidget *parent_Widget(const iAnyObject *d) { | |||
195 | return NULL; | 195 | return NULL; |
196 | } | 196 | } |
197 | 197 | ||
198 | iBool isVisible_Widget (const iAnyObject *); | 198 | iBool isVisible_Widget (const iAnyObject *); |
199 | iBool isDisabled_Widget (const iAnyObject *); | 199 | iBool isDisabled_Widget (const iAnyObject *); |
200 | iBool isFocused_Widget (const iAnyObject *); | 200 | iBool isFocused_Widget (const iAnyObject *); |
201 | iBool isHover_Widget (const iAnyObject *); | 201 | iBool isHover_Widget (const iAnyObject *); |
202 | iBool isSelected_Widget (const iAnyObject *); | 202 | iBool isSelected_Widget (const iAnyObject *); |
203 | iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd); | 203 | iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd); |
204 | iBool hasParent_Widget (const iWidget *d, const iWidget *someParent); | 204 | iBool hasParent_Widget (const iWidget *d, const iWidget *someParent); |
205 | void setId_Widget (iWidget *, const char *id); | 205 | void setId_Widget (iWidget *, const char *id); |
206 | void setFlags_Widget (iWidget *, int64_t flags, iBool set); | 206 | void setFlags_Widget (iWidget *, int64_t flags, iBool set); |
207 | void setPos_Widget (iWidget *, iInt2 pos); | 207 | void setPos_Widget (iWidget *, iInt2 pos); |
208 | void setSize_Widget (iWidget *, iInt2 size); | 208 | void setSize_Widget (iWidget *, iInt2 size); |
209 | void setPadding_Widget (iWidget *, int left, int top, int right, int bottom); | 209 | void setPadding_Widget (iWidget *, int left, int top, int right, int bottom); |
210 | iLocalDef void setPadding1_Widget (iWidget *d, int padding) { setPadding_Widget(d, padding, padding, padding, padding); } | 210 | iLocalDef void setPadding1_Widget (iWidget *d, int padding) { setPadding_Widget(d, padding, padding, padding, padding); } |
211 | void setVisualOffset_Widget (iWidget *d, int value, uint32_t span, int animFlags); | 211 | void setVisualOffset_Widget (iWidget *d, int value, uint32_t span, int animFlags); |
212 | void setBackgroundColor_Widget (iWidget *, int bgColor); | 212 | void setBackgroundColor_Widget (iWidget *, int bgColor); |
@@ -217,22 +217,24 @@ iAny * addChildPos_Widget (iWidget *, iAnyObject *child, enum iWidgetA | |||
217 | iAny * addChildFlags_Widget (iWidget *, iAnyObject *child, int64_t childFlags); /* holds a ref */ | 217 | iAny * addChildFlags_Widget (iWidget *, iAnyObject *child, int64_t childFlags); /* holds a ref */ |
218 | iAny * insertChildAfter_Widget (iWidget *, iAnyObject *child, size_t afterIndex); | 218 | iAny * insertChildAfter_Widget (iWidget *, iAnyObject *child, size_t afterIndex); |
219 | iAny * insertChildAfterFlags_Widget(iWidget *, iAnyObject *child, size_t afterIndex, int64_t childFlags); | 219 | iAny * insertChildAfterFlags_Widget(iWidget *, iAnyObject *child, size_t afterIndex, int64_t childFlags); |
220 | iAny * removeChild_Widget (iWidget *, iAnyObject *child); /* returns a ref */ | 220 | iAny * removeChild_Widget (iWidget *, iAnyObject *child); /* returns a ref */ |
221 | iAny * child_Widget (iWidget *, size_t index); /* O(n) */ | 221 | iAny * child_Widget (iWidget *, size_t index); /* O(n) */ |
222 | size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n) */ | 222 | size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n) */ |
223 | void arrange_Widget (iWidget *); | 223 | void arrange_Widget (iWidget *); |
224 | iBool dispatchEvent_Widget(iWidget *, const SDL_Event *); | 224 | iBool dispatchEvent_Widget (iWidget *, const SDL_Event *); |
225 | iBool processEvent_Widget (iWidget *, const SDL_Event *); | 225 | iBool processEvent_Widget (iWidget *, const SDL_Event *); |
226 | void postCommand_Widget (const iAnyObject *, const char *cmd, ...); | 226 | void postCommand_Widget (const iAnyObject *, const char *cmd, ...); |
227 | void refresh_Widget (const iAnyObject *); | 227 | void refresh_Widget (const iAnyObject *); |
228 | |||
229 | void setFocus_Widget (iWidget *); | ||
230 | iWidget *focus_Widget (void); | ||
231 | iWidget *hover_Widget (void); | ||
232 | void unhover_Widget (void); | ||
233 | void setMouseGrab_Widget (iWidget *); | ||
234 | iWidget *mouseGrab_Widget (void); | ||
235 | iBool hasVisibleChildOnTop_Widget(const iWidget *parent); | ||
236 | void printTree_Widget (const iWidget *); | ||
237 | 228 | ||
238 | iBool equalWidget_Command (const char *cmd, const iWidget *widget, const char *checkCommand); | 229 | iBool equalWidget_Command (const char *cmd, const iWidget *widget, const char *checkCommand); |
230 | |||
231 | void setFocus_Widget (iWidget *); | ||
232 | iWidget * focus_Widget (void); | ||
233 | void setHover_Widget (iWidget *); | ||
234 | iWidget * hover_Widget (void); | ||
235 | void unhover_Widget (void); | ||
236 | void setMouseGrab_Widget (iWidget *); | ||
237 | iWidget * mouseGrab_Widget (void); | ||
238 | iBool hasVisibleChildOnTop_Widget | ||
239 | (const iWidget *parent); | ||
240 | void printTree_Widget (const iWidget *); | ||