Allow Windows Close (X) in more popup dialogs

- Settings
- Skins
- Copy Page
- Resolution
- Gradients
- Brush Effects
- Brush menu
- Effects
- Help / About
- Statistics
- Palette
- Palette Historgram
- 2nd palette menu
This commit is contained in:
Thomas Bernard 2019-02-01 01:09:50 +01:00
parent 79621855f9
commit e72bb8cab1
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
3 changed files with 18 additions and 18 deletions

View File

@ -1164,7 +1164,7 @@ void Button_Settings(int btn)
else if (Is_shortcut(Key,0x100+BUTTON_SETTINGS)) else if (Is_shortcut(Key,0x100+BUTTON_SETTINGS))
clicked_button=4; clicked_button=4;
} }
while ( (clicked_button!=4) && (Key!=KEY_RETURN) ); while ( (clicked_button!=4) && (Key!=KEY_RETURN) && !Quit_is_required);
// Checks on change // Checks on change
if (Config.Show_hidden_directories!=selected_config.Show_hidden_directories if (Config.Show_hidden_directories!=selected_config.Show_hidden_directories
@ -1490,7 +1490,7 @@ void Button_Skins(int btn)
break; break;
} }
} }
while ( (clicked_button!=1) && (clicked_button !=6) && (Key != KEY_ESCAPE)); while ( (clicked_button!=1) && (clicked_button !=6) && (Key != KEY_ESCAPE) && !Quit_is_required);
if(clicked_button == 1) if(clicked_button == 1)
{ {
@ -1708,7 +1708,7 @@ void Button_Copy_page(int btn)
else if (Is_shortcut(Key,0x200+BUTTON_PAGE)) else if (Is_shortcut(Key,0x200+BUTTON_PAGE))
clicked_button=6; clicked_button=6;
} }
while (clicked_button<=0); while (clicked_button<=0 && !Quit_is_required);
Close_window(); Close_window();
Display_cursor(); Display_cursor();
@ -2174,7 +2174,7 @@ void Button_Resolution(int btn)
} }
} }
while ((clicked_button!=1) && (clicked_button!=2)); while ((clicked_button!=1) && (clicked_button!=2) && !Quit_is_required);
Close_window(); Close_window();
@ -2823,7 +2823,7 @@ void Button_Gradients(int btn)
} }
} }
} }
while (clicked_button!=6 && clicked_button!=7); while (clicked_button!=6 && clicked_button!=7 && !Quit_is_required);
Close_window(); Close_window();
// The Grad rect operation uses the same button as Grad menu. // The Grad rect operation uses the same button as Grad menu.
@ -4042,7 +4042,7 @@ void Button_Brush_FX(int btn)
clicked_button=1; clicked_button=1;
} }
} }
while (clicked_button<=0); while (clicked_button<=0 && Quit_is_required);
Close_window(); Close_window();
Unselect_button(btn); Unselect_button(btn);
@ -4500,7 +4500,7 @@ void Button_Airbrush_menu(int btn)
} }
} }
} }
while ( (clicked_button!=1) && (clicked_button!=2) ); while ( (clicked_button!=1) && (clicked_button!=2) && !Quit_is_required);
Close_window(); Close_window();
@ -4695,7 +4695,7 @@ void Button_Effects(int btn)
do do
{ {
clicked_button=Window_clicked_button(); clicked_button = Window_clicked_button();
if (Key==KEY_ESC || Is_shortcut(Key,0x100+BUTTON_EFFECTS)) if (Key==KEY_ESC || Is_shortcut(Key,0x100+BUTTON_EFFECTS))
{ {
@ -4958,9 +4958,9 @@ void Button_Effects(int btn)
Display_cursor(); Display_cursor();
} }
} }
while (clicked_button!=11); while (clicked_button!=11 && !Quit_is_required);
if (exit_by_close_button) if (exit_by_close_button || Quit_is_required)
Close_window(); Close_window();
else else
Hide_cursor(); Hide_cursor();

View File

@ -768,7 +768,7 @@ void Window_help(int section, const char *sub_section)
if (Is_shortcut(Key,0x100+BUTTON_HELP)) if (Is_shortcut(Key,0x100+BUTTON_HELP))
clicked_button=1; clicked_button=1;
} }
while ((clicked_button!=1) && (Key!=KEY_RETURN)); while ((clicked_button!=1) && (Key!=KEY_RETURN) && !Quit_is_required);
Key=0; Key=0;
Close_window(); Close_window();
@ -1057,7 +1057,7 @@ void Button_Stats(int btn)
if (Is_shortcut(Key,0x200+BUTTON_HELP)) if (Is_shortcut(Key,0x200+BUTTON_HELP))
clicked_button=1; clicked_button=1;
} }
while ( (clicked_button!=1) && (Key!=KEY_RETURN) ); while ( (clicked_button!=1) && (Key!=KEY_RETURN) && !Quit_is_required);
if(Key==KEY_RETURN)Key=0; if(Key==KEY_RETURN)Key=0;

View File

@ -1036,7 +1036,7 @@ int Window_Histogram(unsigned char block_start, unsigned char block_end, dword*
if (Key == KEY_ESC) if (Key == KEY_ESC)
clicked_button=1; clicked_button=1;
} while( clicked_button < 1); } while( clicked_button < 1 && !Quit_is_required);
Close_window(); Close_window();
if (clicked_button==2) if (clicked_button==2)
@ -1269,7 +1269,7 @@ void Button_Palette(int btn)
old_mouse_x=Mouse_X; old_mouse_x=Mouse_X;
old_mouse_y=Mouse_Y; old_mouse_y=Mouse_Y;
old_mouse_k=Mouse_K; old_mouse_k=Mouse_K;
clicked_button=Window_clicked_button(); clicked_button = Window_clicked_button();
switch (clicked_button) switch (clicked_button)
{ {
@ -2832,7 +2832,7 @@ void Button_Palette(int btn)
} }
} }
} }
while ((clicked_button!=13) && (clicked_button!=14)); while ((clicked_button!=13) && (clicked_button!=14) && !Quit_is_required);
if (clicked_button==14) // Sortie par OK if (clicked_button==14) // Sortie par OK
{ {
@ -2862,7 +2862,7 @@ void Button_Palette(int btn)
Display_cursor(); Display_cursor();
if (clicked_button==13) // Sortie par CANCEL if (clicked_button==13 || Quit_is_required) // CANCEL was clicked
{ {
Set_palette(Main.palette); Set_palette(Main.palette);
if (image_is_backed_up) if (image_is_backed_up)
@ -3009,7 +3009,7 @@ void Button_Secondary_palette(int btn)
break; break;
} }
} }
while (clicked_button!=1 && clicked_button!=2 && clicked_button!=3 && clicked_button!=4); while ((clicked_button <= 0 || clicked_button >= 5) && !Quit_is_required);
// We need to get the sliders positions before closing the window, because they will be freed. // We need to get the sliders positions before closing the window, because they will be freed.
palette_cols=256-columns_slider->Position; palette_cols=256-columns_slider->Position;
@ -3021,7 +3021,7 @@ void Button_Secondary_palette(int btn)
Unselect_button(BUTTON_PALETTE); Unselect_button(BUTTON_PALETTE);
Display_cursor(); Display_cursor();
if (clicked_button==4) // Cancel if (clicked_button==4 || Quit_is_required) // Cancel
return; return;
if (palette_vertical != Config.Palette_vertical) if (palette_vertical != Config.Palette_vertical)