Move Group/Ungroup actions to Edit menu

This commit is contained in:
Bruno Herbelin
2022-10-15 11:51:16 +02:00
parent 2fc52e673f
commit 7e13c1b22a
2 changed files with 21 additions and 18 deletions

View File

@@ -916,6 +916,14 @@ void UserInterface::showMenuEdit()
const char *clipboard = ImGui::GetClipboardText();
bool has_clipboard = (clipboard != nullptr && strlen(clipboard) > 0 && SessionLoader::isClipboard(clipboard));
// UNDO
if ( ImGui::MenuItem( MENU_UNDO, SHORTCUT_UNDO) )
Action::manager().undo();
if ( ImGui::MenuItem( MENU_REDO, SHORTCUT_REDO) )
Action::manager().redo();
// EDIT
ImGui::Separator();
if (ImGui::MenuItem( MENU_CUT, SHORTCUT_CUT, false, has_selection)) {
std::string copied_text = Mixer::selection().clipboard();
if (!copied_text.empty()) {
@@ -938,11 +946,19 @@ void UserInterface::showMenuEdit()
Mixer::manager().view()->selectAll();
navigator.hidePannel();
}
// GROUP
ImGui::Separator();
if ( ImGui::MenuItem( MENU_UNDO, SHORTCUT_UNDO) )
Action::manager().undo();
if ( ImGui::MenuItem( MENU_REDO, SHORTCUT_REDO) )
Action::manager().redo();
if (ImGuiToolkit::MenuItemIcon(11, 2, " Group active sources", false, Mixer::manager().numSource() > 0)) {
// create a new group session with only active sources
Mixer::manager().groupAll( true );
// switch pannel to show first source (created)
navigator.showPannelSource(0);
}
if (ImGuiToolkit::MenuItemIcon(7, 2, " Expand groups", false, Mixer::manager().numSource() > 0)) {
// create a new group session with all sources
Mixer::manager().ungroupAll();
}
}
void UserInterface::showMenuFile()
@@ -985,19 +1001,6 @@ void UserInterface::showMenuFile()
ImGui::MenuItem( MENU_SAVE_ON_EXIT, nullptr, &Settings::application.recentSessions.save_on_exit);
// GROUP
ImGui::Separator();
if (ImGuiToolkit::MenuItemIcon(11, 2, " Group active sources", false, Mixer::manager().numSource() > 0)) {
// create a new group session with only active sources
Mixer::manager().groupAll( true );
// switch pannel to show first source (created)
navigator.showPannelSource(0);
}
if (ImGuiToolkit::MenuItemIcon(7, 2, " Expand groups", false, Mixer::manager().numSource() > 0)) {
// create a new group session with all sources
Mixer::manager().ungroupAll();
}
// HELP AND QUIT
ImGui::Separator();
if (ImGui::MenuItem( IMGUI_TITLE_HELP, SHORTCUT_HELP))

View File

@@ -24,7 +24,7 @@
#define IMGUI_TITLE_MEDIAPLAYER ICON_FA_PLAY_CIRCLE " Player"
#define IMGUI_TITLE_TIMER ICON_FA_CLOCK " Timer"
#define IMGUI_TITLE_INPUT_MAPPING ICON_FA_HAND_PAPER " Inputs Mapping"
#define IMGUI_TITLE_INPUT_MAPPING ICON_FA_HAND_PAPER " Input Mapping"
#define IMGUI_TITLE_HELP ICON_FA_LIFE_RING " Help"
#define IMGUI_TITLE_TOOLBOX ICON_FA_HAMSA " Guru Toolbox"
#define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Shader Editor"