Pressing quit checks for close popup, and close popup has scroll bar
This commit is contained in:
parent
f362f02967
commit
5143557e78
1 changed files with 41 additions and 31 deletions
|
|
@ -448,7 +448,7 @@ void Toolbar::close_popup_gui() {
|
|||
});
|
||||
CLAY_AUTO_ID({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_FIT(0), .height = CLAY_SIZING_FIT(0) },
|
||||
.sizing = {.width = CLAY_SIZING_FIT(0), .height = CLAY_SIZING_FIT(0, 600) },
|
||||
.padding = CLAY_PADDING_ALL(io->theme->padding1),
|
||||
.childGap = io->theme->childGap1,
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_TOP},
|
||||
|
|
@ -461,8 +461,15 @@ void Toolbar::close_popup_gui() {
|
|||
gui.obstructing_window();
|
||||
gui.push_id("Close single file popup gui");
|
||||
gui.text_label("Files may contain unsaved changes");
|
||||
gui.scroll_bar_area("close file popup gui scroll area", false, [&](float, float, float &) {
|
||||
CLAY_AUTO_ID({
|
||||
.layout = {
|
||||
.childGap = io->theme->childGap1,
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_TOP},
|
||||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
}
|
||||
}) {
|
||||
size_t i = 0;
|
||||
gui.push_id("File list");
|
||||
for(auto& [w, setToSave] : closePopupData.worldsToClose) {
|
||||
auto wLock = w.lock();
|
||||
CLAY_AUTO_ID({
|
||||
|
|
@ -493,7 +500,8 @@ void Toolbar::close_popup_gui() {
|
|||
}
|
||||
++i;
|
||||
}
|
||||
gui.pop_id();
|
||||
}
|
||||
});
|
||||
if(gui.text_button_wide("Save", "Save")) {
|
||||
for(auto& [w, setToSave] : closePopupData.worldsToClose) {
|
||||
auto wLock = w.lock();
|
||||
|
|
@ -726,8 +734,10 @@ void Toolbar::top_toolbar() {
|
|||
optionsMenuType = ABOUT_MENU;
|
||||
}
|
||||
#ifndef __EMSCRIPTEN__
|
||||
if(gui.text_button_left_transparent("quit button", "Quit"))
|
||||
if(gui.text_button_left_transparent("quit button", "Quit")) {
|
||||
if(main.app_close_requested())
|
||||
main.setToQuit = true;
|
||||
}
|
||||
#endif
|
||||
if(io->mouse.leftClick && !menuPopUpJustOpen)
|
||||
menuPopUpOpen = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue