mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
BugFix WorkspaceWindow clear on ESC and Transition view
This commit is contained in:
@@ -157,8 +157,10 @@ void TransitionView::update(float dt)
|
|||||||
// request update
|
// request update
|
||||||
transition_source_->touch();
|
transition_source_->touch();
|
||||||
|
|
||||||
if (d > 0.2f)
|
if (d > 0.2f) {
|
||||||
Mixer::manager().setView(View::MIXING);
|
Mixer::manager().setView(View::MIXING);
|
||||||
|
WorkspaceWindow::restoreWorkspace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,8 @@ uint64_t UserInterface::Runtime() const
|
|||||||
|
|
||||||
void UserInterface::handleKeyboard()
|
void UserInterface::handleKeyboard()
|
||||||
{
|
{
|
||||||
|
static bool esc_repeat_ = false;
|
||||||
|
|
||||||
const ImGuiIO& io = ImGui::GetIO();
|
const ImGuiIO& io = ImGui::GetIO();
|
||||||
alt_modifier_active = io.KeyAlt;
|
alt_modifier_active = io.KeyAlt;
|
||||||
shift_modifier_active = io.KeyShift;
|
shift_modifier_active = io.KeyShift;
|
||||||
@@ -383,10 +385,17 @@ void UserInterface::handleKeyboard()
|
|||||||
navigator.hidePannel();
|
navigator.hidePannel();
|
||||||
// toggle clear workspace
|
// toggle clear workspace
|
||||||
WorkspaceWindow::toggleClearRestoreWorkspace();
|
WorkspaceWindow::toggleClearRestoreWorkspace();
|
||||||
|
// ESC key is not yet maintained pressed
|
||||||
|
esc_repeat_ = false;
|
||||||
}
|
}
|
||||||
else if ( WorkspaceWindow::clear() && ImGui::IsKeyReleased( GLFW_KEY_ESCAPE )) {
|
else if (ImGui::IsKeyPressed( GLFW_KEY_ESCAPE, true )) {
|
||||||
// toggle clear workspace
|
// ESC key is maintained pressed
|
||||||
WorkspaceWindow::toggleClearRestoreWorkspace();
|
esc_repeat_ = true;
|
||||||
|
}
|
||||||
|
else if ( esc_repeat_ && WorkspaceWindow::clear() && ImGui::IsKeyReleased( GLFW_KEY_ESCAPE )) {
|
||||||
|
// restore cleared workspace when releasing ESC after maintain
|
||||||
|
WorkspaceWindow::restoreWorkspace();
|
||||||
|
esc_repeat_ = false;
|
||||||
}
|
}
|
||||||
else if (ImGui::IsKeyPressed( GLFW_KEY_END, false )) {
|
else if (ImGui::IsKeyPressed( GLFW_KEY_END, false )) {
|
||||||
Settings::application.render.disabled = !Settings::application.render.disabled;
|
Settings::application.render.disabled = !Settings::application.render.disabled;
|
||||||
@@ -1982,7 +1991,7 @@ void WorkspaceWindow::toggleClearRestoreWorkspace()
|
|||||||
{
|
{
|
||||||
// do not toggle if an animation is ongoing
|
// do not toggle if an animation is ongoing
|
||||||
for(auto it = windows_.cbegin(); it != windows_.cend(); ++it) {
|
for(auto it = windows_.cbegin(); it != windows_.cend(); ++it) {
|
||||||
if ( (*it)->Visible() && (*it)->impl_ && (*it)->impl_->animation )
|
if ( (*it)->impl_ && (*it)->impl_->animation )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user