diff options
author | Ken Moore <moorekou@gmail.com> | 2016-06-28 09:42:19 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-06-28 09:42:19 -0400 |
commit | 79f1863b83d0b3df619eb3e96c01c06dd12cb72f (patch) | |
tree | e40dd2abb83e19a90abe8edc49b76f8e174c1ffd /src-qt5/core-utils/lumina-config/pages | |
parent | Add in the last 2 converted pages (session_[locale/options]). Leave the new U... (diff) | |
download | lumina-79f1863b83d0b3df619eb3e96c01c06dd12cb72f.tar.gz lumina-79f1863b83d0b3df619eb3e96c01c06dd12cb72f.tar.bz2 lumina-79f1863b83d0b3df619eb3e96c01c06dd12cb72f.zip |
Finish up the switch over to the new UI for lumina-config
Diffstat (limited to 'src-qt5/core-utils/lumina-config/pages')
-rw-r--r-- | src-qt5/core-utils/lumina-config/pages/page_main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src-qt5/core-utils/lumina-config/pages/page_main.cpp b/src-qt5/core-utils/lumina-config/pages/page_main.cpp index ec03f8a5..976e7c69 100644 --- a/src-qt5/core-utils/lumina-config/pages/page_main.cpp +++ b/src-qt5/core-utils/lumina-config/pages/page_main.cpp @@ -14,6 +14,7 @@ page_main::page_main(QWidget *parent) : PageWidget(parent), ui(new Ui::page_main()){ ui->setupUi(this); ui->treeWidget->setMouseTracking(true); + ui->treeWidget->setSortingEnabled(false); //the QTreeView sort flag always puts them in backwards (reverse-alphabetical) connect(ui->treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(itemTriggered(QTreeWidgetItem*)) ); connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemTriggered(QTreeWidgetItem*)) ); connect(ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(searchChanged(QString)) ); @@ -65,10 +66,11 @@ void page_main::UpdateItems(QString search){ else{ ui->treeWidget->addTopLevelItem(it); } } //Now add the categories to the tree widget if they are non-empty - if(interface->childCount()>0){ ui->treeWidget->addTopLevelItem(interface); interface->setExpanded(true); } - if(appearance->childCount()>0){ ui->treeWidget->addTopLevelItem(appearance); appearance->setExpanded(true); } - if(session->childCount()>0){ ui->treeWidget->addTopLevelItem(session); session->setExpanded(true); } - if(user->childCount()>0){ ui->treeWidget->addTopLevelItem(user); user->setExpanded(true); } + if(interface->childCount()>0){ ui->treeWidget->addTopLevelItem(interface); interface->setExpanded(!search.isEmpty()); } + if(appearance->childCount()>0){ ui->treeWidget->addTopLevelItem(appearance); appearance->setExpanded(!search.isEmpty()); } + if(session->childCount()>0){ ui->treeWidget->addTopLevelItem(session); session->setExpanded(!search.isEmpty()); } + if(user->childCount()>0){ ui->treeWidget->addTopLevelItem(user); user->setExpanded(!search.isEmpty()); } + ui->treeWidget->sortItems(0, Qt::AscendingOrder); } //================ |