mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 19:58:49 -05:00
Fix macro action paste happening in the wrong section
Instead of checking the cursor position at the time of the paste, it needed to be checked at the time of the context menu creation to ensure the segment gets pasted into the correct section
This commit is contained in:
@@ -1180,18 +1180,24 @@ static void setupCopyPasteContextMenuEnry(AdvSceneSwitcher *ss,
|
||||
[ss]() { ss->CopyMacroSegment(); });
|
||||
copy->setEnabled(!!segmentEdit);
|
||||
|
||||
bool pasteAsElseAction = true;
|
||||
const char *pasteText = "AdvSceneSwitcher.macroTab.segment.paste";
|
||||
if (MacroActionIsInClipboard()) {
|
||||
if (IsCursorInWidgetArea(ss->ui->macroActions)) {
|
||||
pasteAsElseAction = false;
|
||||
pasteText =
|
||||
"AdvSceneSwitcher.macroTab.segment.pasteAction";
|
||||
} else if (IsCursorInWidgetArea(ss->ui->macroElseActions)) {
|
||||
pasteAsElseAction = true;
|
||||
pasteText =
|
||||
"AdvSceneSwitcher.macroTab.segment.pasteElseAction";
|
||||
}
|
||||
}
|
||||
auto paste = menu.addAction(obs_module_text(pasteText), ss,
|
||||
[ss]() { ss->PasteMacroSegment(); });
|
||||
auto paste = menu.addAction(
|
||||
obs_module_text(pasteText), ss, [ss, pasteAsElseAction]() {
|
||||
SetCopySegmentTargetActionType(pasteAsElseAction);
|
||||
ss->PasteMacroSegment();
|
||||
});
|
||||
paste->setEnabled(MacroSegmentIsInClipboard());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user