mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-20 14:49:59 +01:00
BugFix Display of current source in workspace
Current source outline should not be shown in Geometry view if not in current workspace. Added possibility to switch workspace in source panel.
This commit is contained in:
@@ -240,7 +240,7 @@ void GeometryView::draw()
|
|||||||
scene.accept(draw_overlays);
|
scene.accept(draw_overlays);
|
||||||
|
|
||||||
// 4. Draw control overlays of current source on top (if selected)
|
// 4. Draw control overlays of current source on top (if selected)
|
||||||
if (s != nullptr) {
|
if (s != nullptr && s->workspace() == Settings::application.current_workspace) {
|
||||||
DrawVisitor dv(s->overlays_[mode_], projection);
|
DrawVisitor dv(s->overlays_[mode_], projection);
|
||||||
scene.accept(dv);
|
scene.accept(dv);
|
||||||
// Always restore current source after draw
|
// Always restore current source after draw
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#include "Mixer.h"
|
#include "Mixer.h"
|
||||||
#include "MixingGroup.h"
|
#include "MixingGroup.h"
|
||||||
#include "ActionManager.h"
|
#include "ActionManager.h"
|
||||||
|
#include "Mixer.h"
|
||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "ImGuiToolkit.h"
|
#include "ImGuiToolkit.h"
|
||||||
@@ -493,26 +494,36 @@ void ImGuiVisitor::visit (Source& s)
|
|||||||
else
|
else
|
||||||
ImGuiToolkit::Indication("Inactive", ICON_FA_SNOWFLAKE);
|
ImGuiToolkit::Indication("Inactive", ICON_FA_SNOWFLAKE);
|
||||||
|
|
||||||
// Inform on workspace
|
|
||||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + ImGui::GetFrameHeightWithSpacing()) );
|
|
||||||
if (s.workspace() == Source::BACKGROUND)
|
|
||||||
ImGuiToolkit::Indication("in Background",10, 16);
|
|
||||||
else if (s.workspace() == Source::FOREGROUND)
|
|
||||||
ImGuiToolkit::Indication("in Foreground",12, 16);
|
|
||||||
else
|
|
||||||
ImGuiToolkit::Indication("in Workspace",11, 16);
|
|
||||||
|
|
||||||
// Inform on link
|
// Inform on link
|
||||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.1f * ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + ImGui::GetFrameHeightWithSpacing()) );
|
||||||
if (s.mixingGroup() != nullptr) {
|
if (s.mixingGroup() != nullptr) {
|
||||||
if (ImGuiToolkit::IconButton(ICON_FA_LINK, "Linked")){
|
if (ImGuiToolkit::IconButton(ICON_FA_LINK, "Linked")){
|
||||||
Mixer::selection().clear();
|
Mixer::selection().clear();
|
||||||
Mixer::selection().add( s.mixingGroup()->getCopy() );
|
Mixer::selection().add( s.mixingGroup()->getCopy() );
|
||||||
|
UserInterface::manager().setView(View::MIXING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ImGuiToolkit::Indication("not Linked", ICON_FA_UNLINK);
|
ImGuiToolkit::Indication("not Linked", ICON_FA_UNLINK);
|
||||||
|
|
||||||
|
// Inform on workspace
|
||||||
|
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.1f * ImGui::GetFrameHeightWithSpacing()) );
|
||||||
|
static std::map< int, std::pair<int, std::string> > workspaces_ {
|
||||||
|
{ Source::BACKGROUND, {10, "in Background"}},
|
||||||
|
{ Source::STAGE, {11, "in Workspace"}},
|
||||||
|
{ Source::FOREGROUND, {12, "in Foreground"}}
|
||||||
|
};
|
||||||
|
// in Geometry view, offer to switch current workspace to the source workspace
|
||||||
|
if (Settings::application.current_view == View::GEOMETRY) {
|
||||||
|
if (ImGuiToolkit::IconButton( workspaces_[s.workspace()].first, 16, workspaces_[s.workspace()].second.c_str())) {
|
||||||
|
Settings::application.current_workspace=s.workspace();
|
||||||
|
Mixer::manager().setCurrentSource(s.id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// otherwise in other views, just draw in indicator
|
||||||
|
else
|
||||||
|
ImGuiToolkit::Indication(workspaces_[s.workspace()].second.c_str(), workspaces_[s.workspace()].first, 16);
|
||||||
|
|
||||||
// locking
|
// locking
|
||||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 3.f * ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 3.f * ImGui::GetFrameHeightWithSpacing()) );
|
||||||
const char *tooltip[2] = {"Unlocked", "Locked"};
|
const char *tooltip[2] = {"Unlocked", "Locked"};
|
||||||
|
|||||||
Reference in New Issue
Block a user