=> 69541c037e67635787b334b326a4850f1703a763
[1mdiff --git a/src/ui/indicatorwidget.c b/src/ui/indicatorwidget.c[m [1mindex bc0bd0fa..e16550ff 100644[m [1m--- a/src/ui/indicatorwidget.c[m [1m+++ b/src/ui/indicatorwidget.c[m [36m@@ -28,32 +28,7 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m [m #include[m [m [31m-static int timerId_; /* common timer for all indicators */[m [31m-static int animCount_; /* number of animating indicators */[m [31m-[m [31m-static uint32_t postRefresh_(uint32_t interval, void *context) {[m [31m- iUnused(context);[m [31m- postRefresh_App();[m [31m- return interval;[m [31m-}[m [31m-[m [31m-static void startTimer_(void) {[m [31m- animCount_++;[m [31m- if (!timerId_) {[m [31m- timerId_ = SDL_AddTimer(1000 / 60, postRefresh_, NULL);[m [31m- }[m [31m-}[m [31m-[m [31m-static void stopTimer_(void) {[m [31m- iAssert(animCount_ > 0);[m [31m- if (--animCount_ == 0) {[m [31m- iAssert(timerId_);[m [31m- SDL_RemoveTimer(timerId_);[m [31m- timerId_ = 0;[m [31m- }[m [31m-}[m [31m-[m [31m-struct Impl_IndicatorWidget{[m [32m+[m[32mstruct Impl_IndicatorWidget {[m iWidget widget;[m iAnim pos;[m };[m [36m@@ -64,6 +39,14 @@[m [miLocalDef iBool isActive_IndicatorWidget_(const iIndicatorWidget *d) {[m return isSelected_Widget(d);[m }[m [m [32m+[m[32mstatic void animate_IndicatorWidget_(void *ptr) {[m [32m+[m[32m iIndicatorWidget *d = ptr;[m [32m+[m[32m if (!isFinished_Anim(&d->pos)) {[m [32m+[m[32m addTickerRoot_App(animate_IndicatorWidget_, d->widget.root, ptr);[m [32m+[m[32m }[m [32m+[m[32m postRefresh_App();[m [32m+[m[32m}[m [32m+[m static void setActive_IndicatorWidget_(iIndicatorWidget *d, iBool set) {[m setFlags_Widget(as_Widget(d), selected_WidgetFlag, set);[m }[m [36m@@ -75,22 +58,8 @@[m [mvoid init_IndicatorWidget(iIndicatorWidget *d) {[m setFlags_Widget(w, unhittable_WidgetFlag, iTrue);[m }[m [m [31m-static void startTimer_IndicatorWidget_(iIndicatorWidget *d) {[m [31m- if (!isActive_IndicatorWidget_(d)) {[m [31m- startTimer_();[m [31m- setActive_IndicatorWidget_(d, iTrue);[m [31m- }[m [31m-}[m [31m-[m [31m-static void stopTimer_IndicatorWidget_(iIndicatorWidget *d) {[m [31m- if (isActive_IndicatorWidget_(d)) {[m [31m- stopTimer_();[m [31m- setActive_IndicatorWidget_(d, iFalse);[m [31m- }[m [31m-}[m [31m-[m void deinit_IndicatorWidget(iIndicatorWidget *d) {[m [31m- stopTimer_IndicatorWidget_(d);[m [32m+[m[32m removeTicker_App(animate_IndicatorWidget_, d);[m }[m [m static iBool isCompleted_IndicatorWidget_(const iIndicatorWidget *d) {[m [36m@@ -116,12 +85,7 @@[m [mvoid draw_IndicatorWidget_(const iIndicatorWidget *d) {[m [m iBool processEvent_IndicatorWidget_(iIndicatorWidget *d, const SDL_Event *ev) {[m iWidget *w = &d->widget;[m [31m- if (ev->type == SDL_USEREVENT && ev->user.code == refresh_UserEventCode) {[m [31m- if (isFinished_Anim(&d->pos)) {[m [31m- stopTimer_IndicatorWidget_(d);[m [31m- }[m [31m- }[m [31m- else if (isCommand_SDLEvent(ev)) {[m [32m+[m[32m if (isCommand_SDLEvent(ev)) {[m const char *cmd = command_UserEvent(ev);[m if (startsWith_CStr(cmd, "document.request.")) {[m if (pointerLabel_Command(cmd, "doc") == parent_Widget(w)) {[m [36m@@ -130,23 +94,23 @@[m [miBool processEvent_IndicatorWidget_(iIndicatorWidget *d, const SDL_Event *ev) {[m setValue_Anim(&d->pos, 0, 0);[m setValue_Anim(&d->pos, 0.75f, 4000);[m setFlags_Anim(&d->pos, easeOut_AnimFlag, iTrue);[m [31m- startTimer_IndicatorWidget_(d);[m [32m+[m[32m animate_IndicatorWidget_(d);[m }[m else if (equal_Command(cmd, "finished")) {[m if (value_Anim(&d->pos) > 0.01f) {[m setValue_Anim(&d->pos, 1.0f, 250);[m setFlags_Anim(&d->pos, easeOut_AnimFlag, iFalse);[m [31m- startTimer_IndicatorWidget_(d);[m [32m+[m[32m animate_IndicatorWidget_(d);[m }[m else {[m setValue_Anim(&d->pos, 0, 0);[m [31m- stopTimer_IndicatorWidget_(d);[m [32m+[m[32m animate_IndicatorWidget_(d);[m refresh_Widget(d);[m }[m }[m else if (equal_Command(cmd, "cancelled")) {[m setValue_Anim(&d->pos, 0, 0);[m [31m- stopTimer_IndicatorWidget_(d);[m [32m+[m[32m animate_IndicatorWidget_(d);[m refresh_Widget(d);[m }[m }[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).