Revert to the old type-to-scroll behaviour in the library view
This commit is contained in:
parent
ebe237cd40
commit
3cf2b5ba47
@ -244,7 +244,16 @@ void LibraryView::AddToPlaylist() {
|
||||
}
|
||||
|
||||
void LibraryView::keyboardSearch(const QString& search) {
|
||||
emit FocusFilterBox(search);
|
||||
is_in_keyboard_search_ = true;
|
||||
QTreeView::keyboardSearch(search);
|
||||
is_in_keyboard_search_ = false;
|
||||
}
|
||||
|
||||
void LibraryView::scrollTo(const QModelIndex& index, ScrollHint hint) {
|
||||
if (is_in_keyboard_search_)
|
||||
QTreeView::scrollTo(index, QAbstractItemView::PositionAtTop);
|
||||
else
|
||||
QTreeView::scrollTo(index, hint);
|
||||
}
|
||||
|
||||
void LibraryView::GetSelectedFileInfo(
|
||||
|
@ -50,6 +50,7 @@ class LibraryView : public AutoExpandingTreeView {
|
||||
|
||||
// QTreeView
|
||||
void keyboardSearch(const QString &search);
|
||||
void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
|
||||
|
||||
public slots:
|
||||
void TotalSongCountUpdated(int count);
|
||||
@ -63,7 +64,6 @@ class LibraryView : public AutoExpandingTreeView {
|
||||
void ShowConfigDialog();
|
||||
void Load(const QModelIndexList& indexes);
|
||||
void AddToPlaylist(const QModelIndexList& indexes);
|
||||
void FocusFilterBox(const QString& text);
|
||||
|
||||
protected:
|
||||
// QWidget
|
||||
@ -108,6 +108,8 @@ class LibraryView : public AutoExpandingTreeView {
|
||||
QAction* no_show_in_various_;
|
||||
|
||||
boost::scoped_ptr<OrganiseDialog> organise_dialog_;
|
||||
|
||||
bool is_in_keyboard_search_;
|
||||
};
|
||||
|
||||
#endif // LIBRARYVIEW_H
|
||||
|
@ -365,7 +365,6 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
||||
connect(ui_->library_view, SIGNAL(Load(QModelIndexList)), SLOT(LoadLibraryItemToPlaylist(QModelIndexList)));
|
||||
connect(ui_->library_view, SIGNAL(AddToPlaylist(QModelIndexList)), SLOT(AddLibraryItemToPlaylist(QModelIndexList)));
|
||||
connect(ui_->library_view, SIGNAL(ShowConfigDialog()), SLOT(ShowLibraryConfig()));
|
||||
connect(ui_->library_view, SIGNAL(FocusFilterBox(QString)), ui_->library_filter, SLOT(AppendAndFocus(QString)));
|
||||
connect(library_->model(), SIGNAL(TotalSongCountUpdated(int)), ui_->library_view, SLOT(TotalSongCountUpdated(int)));
|
||||
|
||||
connect(task_manager_, SIGNAL(PauseLibraryWatchers()), library_, SLOT(PauseWatcher()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user