From 0868361fe1282a5aa3c904aa6581672e65bf5c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lhomme?= Date: Wed, 4 Feb 2015 13:43:21 +0000 Subject: [PATCH] Add UI concepts for filters and search location --- resources.qrc | 1 + resources/images/filter.png | Bin 0 -> 2303 bytes src/mainwindow_init.cpp | 28 ++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 resources/images/filter.png 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 0000000000000000000000000000000000000000..6d03b095b38addcd2a2f3c0aae100176c8adcce8 GIT binary patch literal 2303 zcmVr9qbM~u*VEY8G~ah$3!OT3p4;0$PLW6yj^k3Pe62eHU`i$v!u&|q3o?@hlM2tv z>yeSa_<=B;ox7Y^EdF64Y67r<2z3Ch1vmGJ0DLp=Jb*NSIRMuHo?^yj-}f#J z3=Ccm=Dqjc7HVqRDg(aOqQZ+{djZn=kj+ODAf3(5(DCDMc@I65aHG+>PJnj<)DGZI z08s!g0LQvS5hG}`AkSQR0674&0G|YCRBQjWzP|pm0C4~PZM1IP2FHBsn!7M_NC1AY z0J2^P&&zQ%8kdgat`kD;1o*1}b>V}f>j3`9tPeBepP9^bdUA3i*VMEnVq}b%#lUtU zFf)dSN4hW zJt7iW&zqOo?0h~NbzLIzgm4@w9R}bEAtZnZ5xGPpnekB~>HzpN0JRq2dlBGoPE4GC zsi9$`6DY@6fW_S0lx}R?@-z`03JvrD{1?DsX8vU=mAVc9?d{t{ELICE00es|@K0^_ zM9$o8(=WO!0GgS3-#>BUT@3&|J$pAu>3ki)0RWrLTsA$SlsarIv9Je*hDLO6Z|`FO zejoby8h{^pUjBCj1A{X=cRnCpH--XXSF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mr4Dv=b(G>Z;bQ3jV6J>f%uX~~D}@lx0oY%m@JE>aC$rf( z4Nyf;Tv&LhO!HAblbOzI?H>eiwgTZ#d!BbNlbQ7as`YvC0dBNOF~@b9=oRKvG8oGzp11EQPSf2CN!nV8UA zZLeu13zX9H0dpk)k94TDSW&O3D4Z^}RY+6`B+?L~I=&^t>6H>3GjsWSKxVgYjaSp6 zEFDg-lxT>`My10_snd7gy #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);