From f7c90945a7e7ef0dddfd3244877b5eb3bb6568f2 Mon Sep 17 00:00:00 2001 From: shweet Date: Sun, 22 Nov 2026 18:50:55 -0500 Subject: [PATCH] Give the generate-regions popup the shared confirm/cancel row --- src/ui/taskbar.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ui/taskbar.cpp b/src/ui/taskbar.cpp index 298b3e5..997f097 100644 --- a/src/ui/taskbar.cpp +++ b/src/ui/taskbar.cpp @@ -1,4 +1,5 @@ #include "ui/taskbar.h" +#include "ui/panel.h" #include #include @@ -256,8 +257,8 @@ void Taskbar::update(Manager& manager, Settings& settings, Resources& resources, input_text_string(localize.get(LABEL_FORMAT), &settings.generateRegionNameFormat); ImGui::Checkbox(localize.get(LABEL_MAP_FRAMES_TO_REGIONS), &isGenerateRegionsMapFrames); - auto widgetSize = widget_size_with_row_get(2); - if (ImGui::Button(localize.get(LABEL_GENERATE), widgetSize)) + auto result = popup_buttons_draw(manager, {.confirm = LABEL_GENERATE}); + if (result == PopupButton::CONFIRM) { std::set animationIndices; if (generateRegionsTarget == GENERATE_REGIONS_TARGET_ALL) @@ -284,12 +285,8 @@ void Taskbar::update(Manager& manager, Settings& settings, Resources& resources, queuedMapping); }); }}); - generateRegionsPopup.close(); } - - ImGui::SameLine(); - - if (ImGui::Button(localize.get(BASIC_CANCEL), widgetSize)) + if (result != PopupButton::NONE) generateRegionsPopup.close(); } ImGui::EndPopup();