If there's only one node in a library item then expand it when expanding the parent
This commit is contained in:
parent
f950701620
commit
1230084dbf
1
TODO
1
TODO
@ -8,7 +8,6 @@
|
||||
- Configuration for:
|
||||
- crossfading
|
||||
- osd
|
||||
- If there's only one node in a library item then expand it when expanding the parent
|
||||
|
||||
- Edit tags in playlist view
|
||||
- Disabled fields in tag editor
|
||||
|
@ -59,6 +59,8 @@ LibraryView::LibraryView(QWidget* parent)
|
||||
nomusic_(":nomusic.png")
|
||||
{
|
||||
setItemDelegate(new LibraryItemDelegate(this));
|
||||
|
||||
connect(this, SIGNAL(expanded(QModelIndex)), SLOT(ItemExpanded(QModelIndex)));
|
||||
}
|
||||
|
||||
void LibraryView::SetLibrary(Library *library) {
|
||||
@ -137,3 +139,8 @@ bool LibraryView::RecursivelyExpand(const QModelIndex& index, int* count) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LibraryView::ItemExpanded(const QModelIndex& index) {
|
||||
if (model()->rowCount(index) == 1)
|
||||
expand(model()->index(0, 0, index));
|
||||
}
|
||||
|
@ -34,6 +34,9 @@ class LibraryView : public QTreeView {
|
||||
void paintEvent(QPaintEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* e);
|
||||
|
||||
private slots:
|
||||
void ItemExpanded(const QModelIndex& index);
|
||||
|
||||
private:
|
||||
void RecheckIsEmpty();
|
||||
bool RecursivelyExpand(const QModelIndex& index, int* count);
|
||||
|
Loading…
x
Reference in New Issue
Block a user