Draw popup confirm/cancel rows with one helper

popup_buttons_draw takes its labels, tooltips and enabled state as a struct. Three hand-written rows use it.
This commit is contained in:
shweet committed 2026-11-22 18:48:58 -05:00
1 parent 8d3ebf2329
commit a9177b13d0
9 files changed
+50 -62

No files matched your search

+4 -3
View File
@@ -529,9 +529,10 @@ static void animations_merge_popup_update(Panel& panel, AnimationsPanel& animati
ImGui::Checkbox(localize.get(LABEL_DELETE_ANIMATIONS_AFTER), &settings.mergeIsDeleteAnimationsAfter);
ImGui::EndChild();
auto result =
popup_buttons_draw(manager, localize.get(LABEL_MERGE),
!animation_merge_indices_get(document, mergeSelection, mergeReference).empty(), LABEL_CLOSE);
auto result = popup_buttons_draw(
manager, {.confirm = LABEL_MERGE,
.cancel = LABEL_CLOSE,
.isConfirmEnabled = !animation_merge_indices_get(document, mergeSelection, mergeReference).empty()});
if (result == PopupButton::CONFIRM)
command_push(
panel, [options = AnimationMergeOptions{.selection = mergeSelection,