mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +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);
|
||||
}
|
||||
|
||||
void LyricsLayout::OnVisibilityChanged(bool visible) {
|
||||
LayoutBase::OnVisibilityChanged(visible);
|
||||
if (visible) {
|
||||
this->FocusFirst();
|
||||
}
|
||||
}
|
||||
|
||||
void LyricsLayout::LoadLyricsForCurrentTrack() {
|
||||
auto track = playback.GetPlaying();
|
||||
if (track && track->GetId() != this->currentTrackId) {
|
||||
|
@ -20,6 +20,7 @@ namespace musik { namespace cube {
|
||||
virtual void OnLayout() override;
|
||||
virtual void SetShortcutsWindow(cursespp::ShortcutsWindow* w) override;
|
||||
virtual bool KeyPress(const std::string& kn) override;
|
||||
virtual void OnVisibilityChanged(bool visible) override;
|
||||
|
||||
private:
|
||||
enum class State: int { NotPlaying, Loading, Loaded, Failed };
|
||||
|
Loading…
Reference in New Issue
Block a user