summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index ec229b86..b31b3c08 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -91,6 +91,17 @@ void init_Widget(iWidget *d) {
91 iZap(d->padding); 91 iZap(d->padding);
92} 92}
93 93
94static void visualOffsetAnimation_Widget_(void *ptr) {
95 iWidget *d = ptr;
96 postRefresh_App();
97 if (!isFinished_Anim(&d->visualOffset)) {
98 addTicker_App(visualOffsetAnimation_Widget_, ptr);
99 }
100 else {
101 setFlags_Widget(d, visualOffset_WidgetFlag, iFalse);
102 }
103}
104
94void deinit_Widget(iWidget *d) { 105void deinit_Widget(iWidget *d) {
95 releaseChildren_Widget(d); 106 releaseChildren_Widget(d);
96#if !defined (NDEBUG) 107#if !defined (NDEBUG)
@@ -101,6 +112,9 @@ void deinit_Widget(iWidget *d) {
101 if (d->flags & keepOnTop_WidgetFlag) { 112 if (d->flags & keepOnTop_WidgetFlag) {
102 removeAll_PtrArray(onTop_RootData_(), d); 113 removeAll_PtrArray(onTop_RootData_(), d);
103 } 114 }
115 if (d->flags & visualOffset_WidgetFlag) {
116 removeTicker_App(visualOffsetAnimation_Widget_, d);
117 }
104 widgetDestroyed_Touch(d); 118 widgetDestroyed_Touch(d);
105} 119}
106 120
@@ -191,17 +205,6 @@ void setPadding_Widget(iWidget *d, int left, int top, int right, int bottom) {
191 d->padding[3] = bottom; 205 d->padding[3] = bottom;
192} 206}
193 207
194static void visualOffsetAnimation_Widget_(void *ptr) {
195 iWidget *d = ptr;
196 postRefresh_App();
197 if (!isFinished_Anim(&d->visualOffset)) {
198 addTicker_App(visualOffsetAnimation_Widget_, ptr);
199 }
200 else {
201 setFlags_Widget(d, visualOffset_WidgetFlag, iFalse);
202 }
203}
204
205void setVisualOffset_Widget(iWidget *d, int value, uint32_t span, int animFlags) { 208void setVisualOffset_Widget(iWidget *d, int value, uint32_t span, int animFlags) {
206 setFlags_Widget(d, visualOffset_WidgetFlag, iTrue); 209 setFlags_Widget(d, visualOffset_WidgetFlag, iTrue);
207 if (span == 0) { 210 if (span == 0) {