Open dialog scroll buttons auto-repeat now

Had an unwanted SDL_RemoveTimer call in a dumb place. :/
This commit is contained in:
Bill Kendrick 2022-04-18 22:19:24 -07:00
parent 0aab76291b
commit f0c2c8b5bc
2 changed files with 4 additions and 11 deletions

View file

@ -131,9 +131,8 @@ http://www.tuxpaint.org/
* Other Improvements: * Other Improvements:
------------------- -------------------
* The up & down scroll buttons now auto-repeat if you click/tap and * The up & down scroll buttons now auto-repeat if you click/tap and
hold them in the "Tools" section, [WIP] the "Open" dialog, hold them in the "Tools" section, and "Open", "New", and "Slideshow"
the "New" dialog, and the "Slideshow" dialog. dialogs. (For https://sourceforge.net/p/tuxpaint/feature-requests/173/)
For https://sourceforge.net/p/tuxpaint/feature-requests/173/
Bill Kendrick <bill@newbreedsoftware.com> Bill Kendrick <bill@newbreedsoftware.com>
* Localization Updates: * Localization Updates:

View file

@ -16140,13 +16140,13 @@ static int do_open(void)
scrolling_dialog = 1; scrolling_dialog = 1;
SDL_InitSubSystem(SDL_INIT_TIMER); SDL_InitSubSystem(SDL_INIT_TIMER);
scrolltimer_dialog = scrolltimer_dialog =
SDL_AddTimer(1/*REPEAT_SPEED*/, scrolltimer_dialog_callback, (void *)&scrolltimer_dialog_event); SDL_AddTimer(REPEAT_SPEED, scrolltimer_dialog_callback, (void *)&scrolltimer_dialog_event);
} }
else else
{ {
DEBUG_PRINTF("Continuing scrolling\n"); DEBUG_PRINTF("Continuing scrolling\n");
scrolltimer_dialog = scrolltimer_dialog =
SDL_AddTimer(1/*REPEAT_SPEED / 3*/, scrolltimer_dialog_callback, (void *)&scrolltimer_dialog_event); SDL_AddTimer(REPEAT_SPEED / 3, scrolltimer_dialog_callback, (void *)&scrolltimer_dialog_event);
} }
} }
} }
@ -16315,12 +16315,6 @@ static int do_open(void)
handle_joybuttonupdown(event, oldpos_x, oldpos_y); handle_joybuttonupdown(event, oldpos_x, oldpos_y);
} /* while (SDL_PollEvent(&event)) */ } /* while (SDL_PollEvent(&event)) */
if (scrolltimer_dialog != NULL)
{
SDL_RemoveTimer(scrolltimer_dialog);
scrolltimer_dialog = NULL;
}
if (motioner | hatmotioner) if (motioner | hatmotioner)
handle_motioners(oldpos_x, oldpos_y, motioner, hatmotioner, old_hat_ticks, val_x, val_y, valhat_x, handle_motioners(oldpos_x, oldpos_y, motioner, hatmotioner, old_hat_ticks, val_x, val_y, valhat_x,
valhat_y); valhat_y);