Give the generate-regions popup the shared confirm/cancel row

This commit is contained in:
shweet committed 2026-11-22 18:51:06 -05:00
1 parent 14e9668bab
commit f7c90945a7
1 file changed
+4 -7
+4 -7
View File
@@ -1,4 +1,5 @@
#include "ui/taskbar.h" #include "ui/taskbar.h"
#include "ui/panel.h"
#include <filesystem> #include <filesystem>
#include <format> #include <format>
@@ -256,8 +257,8 @@ void Taskbar::update(Manager& manager, Settings& settings, Resources& resources,
input_text_string(localize.get(LABEL_FORMAT), &settings.generateRegionNameFormat); input_text_string(localize.get(LABEL_FORMAT), &settings.generateRegionNameFormat);
ImGui::Checkbox(localize.get(LABEL_MAP_FRAMES_TO_REGIONS), &isGenerateRegionsMapFrames); ImGui::Checkbox(localize.get(LABEL_MAP_FRAMES_TO_REGIONS), &isGenerateRegionsMapFrames);
auto widgetSize = widget_size_with_row_get(2); auto result = popup_buttons_draw(manager, {.confirm = LABEL_GENERATE});
if (ImGui::Button(localize.get(LABEL_GENERATE), widgetSize)) if (result == PopupButton::CONFIRM)
{ {
std::set<int> animationIndices; std::set<int> animationIndices;
if (generateRegionsTarget == GENERATE_REGIONS_TARGET_ALL) if (generateRegionsTarget == GENERATE_REGIONS_TARGET_ALL)
@@ -284,12 +285,8 @@ void Taskbar::update(Manager& manager, Settings& settings, Resources& resources,
queuedMapping); queuedMapping);
}); });
}}); }});
generateRegionsPopup.close();
} }
if (result != PopupButton::NONE)
ImGui::SameLine();
if (ImGui::Button(localize.get(BASIC_CANCEL), widgetSize))
generateRegionsPopup.close(); generateRegionsPopup.close();
} }
ImGui::EndPopup(); ImGui::EndPopup();