diff --git a/ImGuiToolkit.cpp b/ImGuiToolkit.cpp index 7643770..16e44c4 100644 --- a/ImGuiToolkit.cpp +++ b/ImGuiToolkit.cpp @@ -135,6 +135,12 @@ bool ImGuiToolkit::ButtonSwitch(const char* label, bool* toggle, const char* sho return ret; } +/// used icons +/// 0 2, 1 7, 1 13, 1 16, 2 1, 2 13, 3 1, 3 13, 4 2, 4 12, 4 16, 5 2, 5 8, 5 16, +/// 6 2, 6 4, 6 6, 6 9, 6 13, 6 16, 7 0, 7 9, 7 14, 7 16, 8 1, 8 9, 8 12, 8 13, 8 16, +/// 9 2, 9 3, 9 12, 9 13, 9 16, 10 15, 11 3, 11 5, 11 16, 12 4, 12 5, 12 7, 12 14, +/// 13 4, 13 5, 14 16, 15 1, 15 6, 15 12, 15 16, 16 1, 16 5, 16 7, 16 10, 16 16, 17 6, +/// 18 1, 18 5, 18 12, 18 13, 18 15, 19 6, 19 12, void ImGuiToolkit::Icon(int i, int j, bool enabled) { diff --git a/ImGuiVisitor.cpp b/ImGuiVisitor.cpp index 13cda0a..25a37c3 100644 --- a/ImGuiVisitor.cpp +++ b/ImGuiVisitor.cpp @@ -774,8 +774,10 @@ void ImGuiVisitor::visit (DelayFilter& f) void ImGuiVisitor::visit (ImageFilter& f) { - if (ImGuiToolkit::IconButton(16, 10)) { - Settings::application.widget.shader_editor = true; + // Selection of Algorithm + if (ImGuiToolkit::IconButton(1, 4)) { + FilteringProgram target; + f.setProgram( target ); } ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); @@ -789,20 +791,23 @@ void ImGuiVisitor::visit (ImageFilter& f) } ImGui::EndCombo(); } - ImGui::SameLine(); + ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::Text("Algorithm"); + // List of parameters std::map filter_parameters = f.program().parameters(); FilteringProgram target = f.program(); for (auto param = filter_parameters.begin(); param != filter_parameters.end(); ++param) { - if (ImGuiToolkit::IconButton(12, 14)) { - target.setParameter(param->first, 0.f); + ImGui::PushID( param->first.c_str() ); + float v = param->second; + if (ImGuiToolkit::IconButton(11, 11)) { + v = 0.f; + target.setParameter(param->first, v); f.setProgram( target ); } ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - float v = param->second; if (ImGui::SliderFloat( param->first.c_str(), &v, 0.f, 1.f, "%.2f")) { target.setParameter(param->first, v); f.setProgram( target ); @@ -813,8 +818,14 @@ void ImGuiVisitor::visit (ImageFilter& f) // oss << "Delay " << std::setprecision(3) << d << " s"; // Action::manager().store(oss.str()); } - + ImGui::PopID(); } + + // Open Editor + if ( ImGui::Button( ICON_FA_CODE " Edit", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) + Settings::application.widget.shader_editor = true; + ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Code"); } void ImGuiVisitor::visit (CloneSource& s) diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index 8658019..6d1dcd8 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -964,6 +964,14 @@ void UserInterface::showMenuFile() selectOpenFilename(); if (ImGui::MenuItem( MENU_REOPEN_FILE, SHORTCUT_REOPEN_FILE, false, currentfileopen)) Mixer::manager().load( currentfilename ); + + if (sessionimportdialog && ImGui::MenuItem( ICON_FA_FILE_EXPORT " Import" )) { + // launch file dialog to open a session file + sessionimportdialog->open(); + // close pannel to select file + navigator.hidePannel(); + } + if (ImGui::MenuItem( MENU_SAVE_FILE, SHORTCUT_SAVE_FILE, false, currentfileopen)) { if (saveOrSaveAs()) navigator.hidePannel(); @@ -973,20 +981,15 @@ void UserInterface::showMenuFile() ImGui::MenuItem( MENU_SAVE_ON_EXIT, nullptr, &Settings::application.recentSessions.save_on_exit); - // IMPORT AND GROUP + // GROUP ImGui::Separator(); - if (sessionimportdialog && ImGui::MenuItem( ICON_FA_SIGN_OUT_ALT " Import sources" )) { - // launch file dialog to open a session file - sessionimportdialog->open(); - // close pannel to select file - navigator.hidePannel(); - } - if (ImGui::MenuItem( ICON_FA_SIGN_IN_ALT " Group all sources", nullptr, false, Mixer::manager().numSource() > 0)) { + if (ImGuiToolkit::MenuItemIcon(11, 2, "Group all sources", false, Mixer::manager().numSource() > 0)) { // create a new group session with all sources Mixer::manager().groupAll(); // switch pannel to show first source (created) navigator.showPannelSource(0); } + // TODO : FLATTEN (import all sources from all groups) // HELP AND QUIT ImGui::Separator();