diff --git a/resources.qrc b/resources.qrc index 5008f182..513fbe98 100644 --- a/resources.qrc +++ b/resources.qrc @@ -23,6 +23,7 @@ resources/images/folder.png resources/images/binary.png resources/images/outdated.png + resources/images/filter.png resources/images/unrequired.png resources/images/commit.png resources/images/refresh.png diff --git a/resources/images/filter.png b/resources/images/filter.png new file mode 100644 index 00000000..6d03b095 Binary files /dev/null and b/resources/images/filter.png differ diff --git a/src/mainwindow_init.cpp b/src/mainwindow_init.cpp index b7fff070..df3e497d 100644 --- a/src/mainwindow_init.cpp +++ b/src/mainwindow_init.cpp @@ -46,6 +46,7 @@ #include #include #include +#include /* * Loads various application settings configured in ~/.config/octopi/octopi.conf @@ -284,6 +285,33 @@ void MainWindow::initToolBar() } m_leFilterPackage->setMinimumHeight(24); + + QMenu * menu = new QMenu(); + menu -> addAction("All"); + menu -> addAction(QIcon(":/resources/images/installed.png"), "Installed"); + menu -> addAction(QIcon(":/resources/images/unrequired.png"), "Unrequired"); + menu -> addAction(QIcon(":/resources/images/foreign_green.png"), "Alien Installed"); + menu -> addAction(QIcon(":/resources/images/noninstalled.png"), "Non installed"); + menu -> addAction(QIcon(":/resources/images/outdated.png"), "Outdated"); + menu -> addAction(QIcon(":/resources/images/foreign_red.png"), "Alien Outdated"); + menu -> addAction(QIcon(":/resources/images/newer.png"), "More recent"); + + foreach(QAction * action, menu -> actions()) + action -> setCheckable(true); + + QToolButton * filterButton = new QToolButton(); + filterButton -> setIcon(QIcon(":/resources/images/filter.png")); + filterButton -> setMenu(menu); + filterButton -> setPopupMode(QToolButton::InstantPopup); + ui->mainToolBar->addWidget(filterButton); + + + QComboBox * searchLocation = new QComboBox(); + searchLocation -> addItem("Pacman"); + searchLocation -> addItem("AUR"); + searchLocation -> addItem("Both"); + ui->mainToolBar->addWidget(searchLocation); + ui->mainToolBar->addWidget(m_leFilterPackage); QWidget * hSpacer = new QWidget(this);