mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 15:32:37 +00:00
Fixed ListView focus issue when switching to the LyricsLayout.
This commit is contained in:
parent
839382e2e0
commit
2f6268d7db
@ -89,6 +89,13 @@ bool LyricsLayout::KeyPress(const std::string& kn) {
|
|||||||
return LayoutBase::KeyPress(kn);
|
return LayoutBase::KeyPress(kn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LyricsLayout::OnVisibilityChanged(bool visible) {
|
||||||
|
LayoutBase::OnVisibilityChanged(visible);
|
||||||
|
if (visible) {
|
||||||
|
this->FocusFirst();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void LyricsLayout::LoadLyricsForCurrentTrack() {
|
void LyricsLayout::LoadLyricsForCurrentTrack() {
|
||||||
auto track = playback.GetPlaying();
|
auto track = playback.GetPlaying();
|
||||||
if (track && track->GetId() != this->currentTrackId) {
|
if (track && track->GetId() != this->currentTrackId) {
|
||||||
|
@ -20,6 +20,7 @@ namespace musik { namespace cube {
|
|||||||
virtual void OnLayout() override;
|
virtual void OnLayout() override;
|
||||||
virtual void SetShortcutsWindow(cursespp::ShortcutsWindow* w) override;
|
virtual void SetShortcutsWindow(cursespp::ShortcutsWindow* w) override;
|
||||||
virtual bool KeyPress(const std::string& kn) override;
|
virtual bool KeyPress(const std::string& kn) override;
|
||||||
|
virtual void OnVisibilityChanged(bool visible) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class State: int { NotPlaying, Loading, Loaded, Failed };
|
enum class State: int { NotPlaying, Loading, Loaded, Failed };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user