mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-07 15:28:47 +01:00
parent
7dff6f26bc
commit
3454656207
@ -264,7 +264,7 @@ void PlaylistContainer::ReloadSettings() {
|
||||
}
|
||||
|
||||
bool PlaylistContainer::SearchFieldHasFocus() const {
|
||||
return ui_->search_field->hasFocus();
|
||||
return ui_->toolbar->isVisible() && ui_->search_field->hasFocus();
|
||||
}
|
||||
|
||||
void PlaylistContainer::FocusSearchField() {
|
||||
@ -402,6 +402,8 @@ void PlaylistContainer::SetTabBarHeight(const int height) {
|
||||
|
||||
void PlaylistContainer::MaybeUpdateFilter() {
|
||||
|
||||
if (!ui_->toolbar->isVisible()) return;
|
||||
|
||||
// delaying the filter update on small playlists is undesirable and an empty filter applies very quickly, too
|
||||
if (manager_->current()->rowCount() < kFilterDelayPlaylistSizeThreshold || ui_->search_field->text().isEmpty()) {
|
||||
UpdateFilter();
|
||||
@ -414,6 +416,8 @@ void PlaylistContainer::MaybeUpdateFilter() {
|
||||
|
||||
void PlaylistContainer::UpdateFilter() {
|
||||
|
||||
if (!ui_->toolbar->isVisible()) return;
|
||||
|
||||
manager_->current()->filter()->SetFilterText(ui_->search_field->text());
|
||||
ui_->playlist->JumpToCurrentlyPlayingTrack();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user