Double-clicking a palette color to open the palette now requires a time of less than 0.5 seconds between clicks
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@803 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
14
buttons.c
14
buttons.c
@@ -274,12 +274,22 @@ void Button_Pal_right_fast(void)
|
||||
//-------------------- item de la forecolor dans le menu --------------------
|
||||
void Button_Select_forecolor(void)
|
||||
{
|
||||
static long time_click = 0;
|
||||
long time_previous;
|
||||
|
||||
int color=Pick_color_in_palette();
|
||||
|
||||
time_previous = time_click;
|
||||
time_click = SDL_GetTicks();
|
||||
|
||||
if (color == Fore_color)
|
||||
{
|
||||
// Open palette window
|
||||
Button_Palette();
|
||||
// Check if it's a double-click
|
||||
if (time_click - time_previous < 500)
|
||||
{
|
||||
// Open palette window
|
||||
Button_Palette();
|
||||
}
|
||||
}
|
||||
else if (color!=-1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user