mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-03 20:57:35 +01:00
Make single clicking on an item in a library view expand it. Fixes issue #1027
This commit is contained in:
parent
d761a5e91f
commit
579e24965a
@ -27,6 +27,7 @@ AutoExpandingTreeView::AutoExpandingTreeView(QWidget *parent)
|
||||
expand_on_reset_(true)
|
||||
{
|
||||
connect(this, SIGNAL(expanded(QModelIndex)), SLOT(ItemExpanded(QModelIndex)));
|
||||
connect(this, SIGNAL(clicked(QModelIndex)), SLOT(ItemClicked(QModelIndex)));
|
||||
}
|
||||
|
||||
void AutoExpandingTreeView::reset() {
|
||||
@ -69,3 +70,7 @@ void AutoExpandingTreeView::ItemExpanded(const QModelIndex& index) {
|
||||
if (model()->rowCount(index) == 1 && auto_open_)
|
||||
expand(model()->index(0, 0, index));
|
||||
}
|
||||
|
||||
void AutoExpandingTreeView::ItemClicked(const QModelIndex& index) {
|
||||
expand(index);
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ class AutoExpandingTreeView : public QTreeView {
|
||||
|
||||
private slots:
|
||||
void ItemExpanded(const QModelIndex& index);
|
||||
void ItemClicked(const QModelIndex& index);
|
||||
|
||||
private:
|
||||
bool RecursivelyExpand(const QModelIndex& index, int* count);
|
||||
|
Loading…
x
Reference in New Issue
Block a user