mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
Update UI update and TransitionView to match WorkspaceWindows clear
Enter Workspace Clear mode when switching to Transition view (instead of specific hack). Do not render all windows when in Clear workspace mode.
This commit is contained in:
@@ -456,7 +456,7 @@ void ImGuiVisitor::visit (Source& s)
|
||||
ImGuiToolkit::Indication("in Workspace",11, 16);
|
||||
|
||||
// Inform on link
|
||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.f * ImGui::GetFrameHeightWithSpacing()) );
|
||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.1f * ImGui::GetFrameHeightWithSpacing()) );
|
||||
if (s.mixingGroup() != nullptr) {
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_LINK, "Linked")){
|
||||
Mixer::selection().clear();
|
||||
|
||||
@@ -154,7 +154,6 @@ void Settings::Save(uint64_t runtime)
|
||||
|
||||
// Transition
|
||||
XMLElement *TransitionNode = xmlDoc.NewElement( "Transition" );
|
||||
TransitionNode->SetAttribute("hide_windows", application.transition.hide_windows);
|
||||
TransitionNode->SetAttribute("cross_fade", application.transition.cross_fade);
|
||||
TransitionNode->SetAttribute("duration", application.transition.duration);
|
||||
TransitionNode->SetAttribute("profile", application.transition.profile);
|
||||
@@ -416,7 +415,6 @@ void Settings::Load()
|
||||
// Transition
|
||||
XMLElement * transitionnode = pRoot->FirstChildElement("Transition");
|
||||
if (transitionnode != nullptr) {
|
||||
transitionnode->QueryBoolAttribute("hide_windows", &application.transition.hide_windows);
|
||||
transitionnode->QueryBoolAttribute("cross_fade", &application.transition.cross_fade);
|
||||
transitionnode->QueryFloatAttribute("duration", &application.transition.duration);
|
||||
transitionnode->QueryIntAttribute("profile", &application.transition.profile);
|
||||
|
||||
@@ -122,13 +122,11 @@ struct History
|
||||
struct TransitionConfig
|
||||
{
|
||||
bool cross_fade;
|
||||
bool hide_windows;
|
||||
float duration;
|
||||
int profile;
|
||||
|
||||
TransitionConfig() {
|
||||
cross_fade = true;
|
||||
hide_windows = true;
|
||||
duration = 1.f;
|
||||
profile = 0;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,9 @@ void UserInterface::handleKeyboard()
|
||||
navigator.togglePannelNew();
|
||||
// button esc
|
||||
else if (ImGui::IsKeyPressed( GLFW_KEY_ESCAPE )) {
|
||||
// hide pannel
|
||||
navigator.hidePannel();
|
||||
// toggle clear workspace
|
||||
WorkspaceWindow::toggleClearRestoreWorkspace();
|
||||
}
|
||||
else if (ImGui::IsKeyPressed( GLFW_KEY_END )) {
|
||||
@@ -780,40 +782,41 @@ void UserInterface::Render()
|
||||
sourcecontrol.Update();
|
||||
timercontrol.Update();
|
||||
|
||||
// warning modal dialog
|
||||
// warnings and notifications
|
||||
Log::Render(&Settings::application.widget.logs);
|
||||
|
||||
// clear view mode in Transition view
|
||||
if ( !Settings::application.transition.hide_windows || Settings::application.current_view < View::TRANSITION) {
|
||||
// Output controller
|
||||
if (outputcontrol.Visible())
|
||||
outputcontrol.Render();
|
||||
|
||||
// Source controller
|
||||
if (sourcecontrol.Visible())
|
||||
sourcecontrol.Render();
|
||||
|
||||
// Timer controller
|
||||
if (timercontrol.Visible())
|
||||
timercontrol.Render();
|
||||
|
||||
// Notes
|
||||
RenderNotes();
|
||||
|
||||
// Navigator
|
||||
if (show_view_navigator > 0)
|
||||
target_view_navigator = RenderViewNavigator( &show_view_navigator );
|
||||
|
||||
// All other windows are simply not rendered if workspace is clear
|
||||
if ( !WorkspaceWindow::clear()) {
|
||||
// windows
|
||||
if (Settings::application.widget.toolbox)
|
||||
toolbox.Render();
|
||||
if (Settings::application.widget.shader_editor)
|
||||
RenderShaderEditor();
|
||||
if (Settings::application.widget.help)
|
||||
helpwindow.Render();
|
||||
if (Settings::application.widget.toolbox)
|
||||
toolbox.Render();
|
||||
if (Settings::application.widget.logs)
|
||||
Log::ShowLogWindow(&Settings::application.widget.logs);
|
||||
if (Settings::application.widget.help)
|
||||
sessiontoolbox.Render();
|
||||
|
||||
// Output controller
|
||||
if (outputcontrol.Visible())
|
||||
outputcontrol.Render();
|
||||
|
||||
// Source controller
|
||||
if (sourcecontrol.Visible())
|
||||
sourcecontrol.Render();
|
||||
|
||||
// Timer controller
|
||||
if (timercontrol.Visible())
|
||||
timercontrol.Render();
|
||||
|
||||
// Notes
|
||||
RenderNotes();
|
||||
|
||||
// dialogs
|
||||
if (show_view_navigator > 0)
|
||||
target_view_navigator = RenderViewNavigator( &show_view_navigator );
|
||||
// About
|
||||
if (show_vimix_about)
|
||||
RenderAbout(&show_vimix_about);
|
||||
if (show_imgui_about)
|
||||
@@ -1392,7 +1395,7 @@ void UserInterface::showPannel(int id)
|
||||
void UserInterface::RenderNotes()
|
||||
{
|
||||
Session *se = Mixer::manager().session();
|
||||
if (se!=nullptr) {
|
||||
if (se!=nullptr && se->beginNotes() != se->endNotes()) {
|
||||
|
||||
ImVec4 color = ImGui::GetStyle().Colors[ImGuiCol_ResizeGripHovered];
|
||||
color.w = 0.35f;
|
||||
@@ -5182,6 +5185,8 @@ void Navigator::RenderMainPannelVimix()
|
||||
// open on double clic
|
||||
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left) /*|| file_selected == it*/) {
|
||||
Mixer::manager().open( *it, Settings::application.smooth_transition );
|
||||
if (Settings::application.smooth_transition)
|
||||
WorkspaceWindow::clearWorkspace();
|
||||
done = true;
|
||||
}
|
||||
else
|
||||
@@ -5254,6 +5259,8 @@ void Navigator::RenderMainPannelVimix()
|
||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_top.y));
|
||||
if ( ImGuiToolkit::IconButton( ICON_FA_FILE " +" )) {
|
||||
Mixer::manager().close(Settings::application.smooth_transition );
|
||||
if (Settings::application.smooth_transition)
|
||||
WorkspaceWindow::clearWorkspace();
|
||||
hidePannel();
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
@@ -5880,26 +5887,31 @@ void Navigator::RenderTransitionPannel()
|
||||
ImGui::Text("Transition");
|
||||
ImGui::PopFont();
|
||||
|
||||
// Session menu
|
||||
ImGui::SetCursorPosY(width_);
|
||||
ImGui::Text("Behavior");
|
||||
ImGuiToolkit::ButtonSwitch( ICON_FA_RANDOM " Cross fading", &Settings::application.transition.cross_fade);
|
||||
ImGuiToolkit::ButtonSwitch( ICON_FA_CLOUD_SUN " Clear view", &Settings::application.transition.hide_windows);
|
||||
|
||||
// Transition options
|
||||
ImGuiToolkit::Spacing();
|
||||
ImGui::Text("Animation");
|
||||
if (ImGuiToolkit::ButtonIcon(4, 13)) Settings::application.transition.duration = 1.f;
|
||||
ImGui::Text("Transition");
|
||||
if (ImGuiToolkit::IconButton(0, 8)) Settings::application.transition.cross_fade = true;
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
int mode = Settings::application.transition.cross_fade ? 0 : 1;
|
||||
if (ImGui::Combo("Fading", &mode, "Cross fading\0Fade to black\0") )
|
||||
Settings::application.transition.cross_fade = mode < 1;
|
||||
if (ImGuiToolkit::IconButton(4, 13)) Settings::application.transition.duration = 1.f;
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
ImGui::SliderFloat("Duration", &Settings::application.transition.duration, TRANSITION_MIN_DURATION, TRANSITION_MAX_DURATION, "%.1f s");
|
||||
if (ImGuiToolkit::ButtonIcon(9, 1)) Settings::application.transition.profile = 0;
|
||||
if (ImGuiToolkit::IconButton(9, 1)) Settings::application.transition.profile = 0;
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
ImGui::Combo("Curve", &Settings::application.transition.profile, "Linear\0Quadratic\0");
|
||||
|
||||
// specific transition actions
|
||||
ImGui::Text(" ");
|
||||
ImGuiToolkit::Spacing();
|
||||
ImGui::Text("Actions");
|
||||
if ( ImGui::Button( ICON_FA_TIMES " Cancel ", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ){
|
||||
TransitionView *tv = static_cast<TransitionView *>(Mixer::manager().view(View::TRANSITION));
|
||||
if (tv) tv->cancel();
|
||||
}
|
||||
if ( ImGui::Button( ICON_FA_PLAY " Play ", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ){
|
||||
TransitionView *tv = static_cast<TransitionView *>(Mixer::manager().view(View::TRANSITION));
|
||||
if (tv) tv->play(false);
|
||||
|
||||
@@ -213,6 +213,7 @@ public:
|
||||
WorkspaceWindow(const char* name);
|
||||
|
||||
// global access to Workspace control
|
||||
static bool clear() { return clear_workspace_enabled; }
|
||||
static void toggleClearRestoreWorkspace();
|
||||
static void clearWorkspace();
|
||||
static void restoreWorkspace(bool instantaneous = false);
|
||||
@@ -410,7 +411,7 @@ protected:
|
||||
SourceController sourcecontrol;
|
||||
OutputPreview outputcontrol;
|
||||
TimerMetronome timercontrol;
|
||||
HelperToolbox sessiontoolbox;
|
||||
HelperToolbox helpwindow;
|
||||
|
||||
void showMenuFile();
|
||||
void showMenuEdit();
|
||||
|
||||
Reference in New Issue
Block a user