mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +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);
|
ImGuiToolkit::Indication("in Workspace",11, 16);
|
||||||
|
|
||||||
// Inform on link
|
// 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 (s.mixingGroup() != nullptr) {
|
||||||
if (ImGuiToolkit::IconButton(ICON_FA_LINK, "Linked")){
|
if (ImGuiToolkit::IconButton(ICON_FA_LINK, "Linked")){
|
||||||
Mixer::selection().clear();
|
Mixer::selection().clear();
|
||||||
|
|||||||
@@ -154,7 +154,6 @@ void Settings::Save(uint64_t runtime)
|
|||||||
|
|
||||||
// Transition
|
// Transition
|
||||||
XMLElement *TransitionNode = xmlDoc.NewElement( "Transition" );
|
XMLElement *TransitionNode = xmlDoc.NewElement( "Transition" );
|
||||||
TransitionNode->SetAttribute("hide_windows", application.transition.hide_windows);
|
|
||||||
TransitionNode->SetAttribute("cross_fade", application.transition.cross_fade);
|
TransitionNode->SetAttribute("cross_fade", application.transition.cross_fade);
|
||||||
TransitionNode->SetAttribute("duration", application.transition.duration);
|
TransitionNode->SetAttribute("duration", application.transition.duration);
|
||||||
TransitionNode->SetAttribute("profile", application.transition.profile);
|
TransitionNode->SetAttribute("profile", application.transition.profile);
|
||||||
@@ -416,7 +415,6 @@ void Settings::Load()
|
|||||||
// Transition
|
// Transition
|
||||||
XMLElement * transitionnode = pRoot->FirstChildElement("Transition");
|
XMLElement * transitionnode = pRoot->FirstChildElement("Transition");
|
||||||
if (transitionnode != nullptr) {
|
if (transitionnode != nullptr) {
|
||||||
transitionnode->QueryBoolAttribute("hide_windows", &application.transition.hide_windows);
|
|
||||||
transitionnode->QueryBoolAttribute("cross_fade", &application.transition.cross_fade);
|
transitionnode->QueryBoolAttribute("cross_fade", &application.transition.cross_fade);
|
||||||
transitionnode->QueryFloatAttribute("duration", &application.transition.duration);
|
transitionnode->QueryFloatAttribute("duration", &application.transition.duration);
|
||||||
transitionnode->QueryIntAttribute("profile", &application.transition.profile);
|
transitionnode->QueryIntAttribute("profile", &application.transition.profile);
|
||||||
|
|||||||
@@ -122,13 +122,11 @@ struct History
|
|||||||
struct TransitionConfig
|
struct TransitionConfig
|
||||||
{
|
{
|
||||||
bool cross_fade;
|
bool cross_fade;
|
||||||
bool hide_windows;
|
|
||||||
float duration;
|
float duration;
|
||||||
int profile;
|
int profile;
|
||||||
|
|
||||||
TransitionConfig() {
|
TransitionConfig() {
|
||||||
cross_fade = true;
|
cross_fade = true;
|
||||||
hide_windows = true;
|
|
||||||
duration = 1.f;
|
duration = 1.f;
|
||||||
profile = 0;
|
profile = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -366,7 +366,9 @@ void UserInterface::handleKeyboard()
|
|||||||
navigator.togglePannelNew();
|
navigator.togglePannelNew();
|
||||||
// button esc
|
// button esc
|
||||||
else if (ImGui::IsKeyPressed( GLFW_KEY_ESCAPE )) {
|
else if (ImGui::IsKeyPressed( GLFW_KEY_ESCAPE )) {
|
||||||
|
// hide pannel
|
||||||
navigator.hidePannel();
|
navigator.hidePannel();
|
||||||
|
// toggle clear workspace
|
||||||
WorkspaceWindow::toggleClearRestoreWorkspace();
|
WorkspaceWindow::toggleClearRestoreWorkspace();
|
||||||
}
|
}
|
||||||
else if (ImGui::IsKeyPressed( GLFW_KEY_END )) {
|
else if (ImGui::IsKeyPressed( GLFW_KEY_END )) {
|
||||||
@@ -780,40 +782,41 @@ void UserInterface::Render()
|
|||||||
sourcecontrol.Update();
|
sourcecontrol.Update();
|
||||||
timercontrol.Update();
|
timercontrol.Update();
|
||||||
|
|
||||||
// warning modal dialog
|
// warnings and notifications
|
||||||
Log::Render(&Settings::application.widget.logs);
|
Log::Render(&Settings::application.widget.logs);
|
||||||
|
|
||||||
// clear view mode in Transition view
|
// Output controller
|
||||||
if ( !Settings::application.transition.hide_windows || Settings::application.current_view < View::TRANSITION) {
|
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
|
// windows
|
||||||
if (Settings::application.widget.toolbox)
|
|
||||||
toolbox.Render();
|
|
||||||
if (Settings::application.widget.shader_editor)
|
if (Settings::application.widget.shader_editor)
|
||||||
RenderShaderEditor();
|
RenderShaderEditor();
|
||||||
|
if (Settings::application.widget.help)
|
||||||
|
helpwindow.Render();
|
||||||
|
if (Settings::application.widget.toolbox)
|
||||||
|
toolbox.Render();
|
||||||
if (Settings::application.widget.logs)
|
if (Settings::application.widget.logs)
|
||||||
Log::ShowLogWindow(&Settings::application.widget.logs);
|
Log::ShowLogWindow(&Settings::application.widget.logs);
|
||||||
if (Settings::application.widget.help)
|
|
||||||
sessiontoolbox.Render();
|
|
||||||
|
|
||||||
// Output controller
|
// About
|
||||||
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 );
|
|
||||||
if (show_vimix_about)
|
if (show_vimix_about)
|
||||||
RenderAbout(&show_vimix_about);
|
RenderAbout(&show_vimix_about);
|
||||||
if (show_imgui_about)
|
if (show_imgui_about)
|
||||||
@@ -1392,7 +1395,7 @@ void UserInterface::showPannel(int id)
|
|||||||
void UserInterface::RenderNotes()
|
void UserInterface::RenderNotes()
|
||||||
{
|
{
|
||||||
Session *se = Mixer::manager().session();
|
Session *se = Mixer::manager().session();
|
||||||
if (se!=nullptr) {
|
if (se!=nullptr && se->beginNotes() != se->endNotes()) {
|
||||||
|
|
||||||
ImVec4 color = ImGui::GetStyle().Colors[ImGuiCol_ResizeGripHovered];
|
ImVec4 color = ImGui::GetStyle().Colors[ImGuiCol_ResizeGripHovered];
|
||||||
color.w = 0.35f;
|
color.w = 0.35f;
|
||||||
@@ -5182,6 +5185,8 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
// open on double clic
|
// open on double clic
|
||||||
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left) /*|| file_selected == it*/) {
|
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left) /*|| file_selected == it*/) {
|
||||||
Mixer::manager().open( *it, Settings::application.smooth_transition );
|
Mixer::manager().open( *it, Settings::application.smooth_transition );
|
||||||
|
if (Settings::application.smooth_transition)
|
||||||
|
WorkspaceWindow::clearWorkspace();
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5254,6 +5259,8 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_top.y));
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_top.y));
|
||||||
if ( ImGuiToolkit::IconButton( ICON_FA_FILE " +" )) {
|
if ( ImGuiToolkit::IconButton( ICON_FA_FILE " +" )) {
|
||||||
Mixer::manager().close(Settings::application.smooth_transition );
|
Mixer::manager().close(Settings::application.smooth_transition );
|
||||||
|
if (Settings::application.smooth_transition)
|
||||||
|
WorkspaceWindow::clearWorkspace();
|
||||||
hidePannel();
|
hidePannel();
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
@@ -5880,26 +5887,31 @@ void Navigator::RenderTransitionPannel()
|
|||||||
ImGui::Text("Transition");
|
ImGui::Text("Transition");
|
||||||
ImGui::PopFont();
|
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
|
// Transition options
|
||||||
ImGuiToolkit::Spacing();
|
ImGuiToolkit::Spacing();
|
||||||
ImGui::Text("Animation");
|
ImGui::Text("Transition");
|
||||||
if (ImGuiToolkit::ButtonIcon(4, 13)) Settings::application.transition.duration = 1.f;
|
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::SameLine(0, IMGUI_SAME_LINE);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
ImGui::SliderFloat("Duration", &Settings::application.transition.duration, TRANSITION_MIN_DURATION, TRANSITION_MAX_DURATION, "%.1f s");
|
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::SameLine(0, IMGUI_SAME_LINE);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
ImGui::Combo("Curve", &Settings::application.transition.profile, "Linear\0Quadratic\0");
|
ImGui::Combo("Curve", &Settings::application.transition.profile, "Linear\0Quadratic\0");
|
||||||
|
|
||||||
// specific transition actions
|
// 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)) ){
|
if ( ImGui::Button( ICON_FA_PLAY " Play ", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ){
|
||||||
TransitionView *tv = static_cast<TransitionView *>(Mixer::manager().view(View::TRANSITION));
|
TransitionView *tv = static_cast<TransitionView *>(Mixer::manager().view(View::TRANSITION));
|
||||||
if (tv) tv->play(false);
|
if (tv) tv->play(false);
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ public:
|
|||||||
WorkspaceWindow(const char* name);
|
WorkspaceWindow(const char* name);
|
||||||
|
|
||||||
// global access to Workspace control
|
// global access to Workspace control
|
||||||
|
static bool clear() { return clear_workspace_enabled; }
|
||||||
static void toggleClearRestoreWorkspace();
|
static void toggleClearRestoreWorkspace();
|
||||||
static void clearWorkspace();
|
static void clearWorkspace();
|
||||||
static void restoreWorkspace(bool instantaneous = false);
|
static void restoreWorkspace(bool instantaneous = false);
|
||||||
@@ -410,7 +411,7 @@ protected:
|
|||||||
SourceController sourcecontrol;
|
SourceController sourcecontrol;
|
||||||
OutputPreview outputcontrol;
|
OutputPreview outputcontrol;
|
||||||
TimerMetronome timercontrol;
|
TimerMetronome timercontrol;
|
||||||
HelperToolbox sessiontoolbox;
|
HelperToolbox helpwindow;
|
||||||
|
|
||||||
void showMenuFile();
|
void showMenuFile();
|
||||||
void showMenuEdit();
|
void showMenuEdit();
|
||||||
|
|||||||
Reference in New Issue
Block a user