bugfix show Player when clic source

This commit is contained in:
Bruno Herbelin
2021-12-18 10:18:36 +01:00
parent a7689a8f54
commit bbc5e50491
2 changed files with 17 additions and 6 deletions

View File

@@ -305,11 +305,12 @@ void UserInterface::handleKeyboard()
} }
else if (ImGui::IsKeyPressed( GLFW_KEY_P )) { else if (ImGui::IsKeyPressed( GLFW_KEY_P )) {
// Media player // Media player
Settings::application.widget.media_player = !Settings::application.widget.media_player; sourcecontrol.setVisible(!Settings::application.widget.media_player);
if (Settings::application.widget.media_player_view != Settings::application.current_view) { // Settings::application.widget.media_player = !Settings::application.widget.media_player;
Settings::application.widget.media_player_view = -1; // if (Settings::application.widget.media_player_view != Settings::application.current_view) {
Settings::application.widget.media_player = true; // Settings::application.widget.media_player_view = -1;
} // Settings::application.widget.media_player = true;
// }
} }
else if (ImGui::IsKeyPressed( GLFW_KEY_A )) { else if (ImGui::IsKeyPressed( GLFW_KEY_A )) {
if (shift_modifier_active) if (shift_modifier_active)
@@ -1690,7 +1691,7 @@ void UserInterface::showSourceEditor(Source *s)
if (s) { if (s) {
Mixer::manager().setCurrentSource( s ); Mixer::manager().setCurrentSource( s );
if (s->playable()) { if (s->playable()) {
Settings::application.widget.media_player = true; sourcecontrol.setVisible(true);
sourcecontrol.resetActiveSelection(); sourcecontrol.resetActiveSelection();
return; return;
} }
@@ -2488,6 +2489,15 @@ void SourceController::resetActiveSelection()
} }
void SourceController::setVisible(bool on)
{
if (on && Settings::application.widget.media_player_view != Settings::application.current_view)
Settings::application.widget.media_player_view = -1;
Settings::application.widget.media_player = on;
}
bool SourceController::Visible() const bool SourceController::Visible() const
{ {
return ( Settings::application.widget.media_player return ( Settings::application.widget.media_player

View File

@@ -255,6 +255,7 @@ public:
void resetActiveSelection(); void resetActiveSelection();
void Render(); void Render();
void setVisible(bool on);
bool Visible() const; bool Visible() const;
inline bool Foccused() const { return focused_; } inline bool Foccused() const { return focused_; }
}; };