From 4038ba3d511f887f0f166d8f60eed4a322e96e66 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 5 Mar 2015 15:53:40 +0000 Subject: [PATCH] Arrow icons for variant selection. --- src/GUI/QtLauncher.cxx | 13 +++++++++++-- src/GUI/arrow-left-icon.png | Bin 0 -> 681 bytes src/GUI/arrow-right-icon.png | Bin 0 -> 688 bytes src/GUI/resources.qrc | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/GUI/arrow-left-icon.png create mode 100644 src/GUI/arrow-right-icon.png diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 5775a442d..e7feadc3b 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -381,6 +381,9 @@ public: m_view(view) { view->viewport()->installEventFilter(this); + + m_leftArrowIcon.load(":/left-arrow-icon"); + m_rightArrowIcon.load(":/right-arrow-icon"); } virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const @@ -427,10 +430,14 @@ public: bool canRight = (currentVariant < variantCount ); QRect leftArrowRect = leftCycleArrowRect(option.rect, index); - painter->fillRect(leftArrowRect, canLeft ? Qt::black : Qt::gray); + if (canLeft) { + painter->drawPixmap(leftArrowRect.topLeft() + QPoint(2, 2), m_leftArrowIcon); + } QRect rightArrowRect = rightCycleArrowRect(option.rect, index); - painter->fillRect(rightArrowRect, canRight ? Qt::black : Qt::gray); + if (canRight) { + painter->drawPixmap(rightArrowRect.topLeft() + QPoint(2, 2), m_rightArrowIcon); + } } painter->drawText(descriptionRect, Qt::TextWordWrap, description, &actualBounds); @@ -553,6 +560,8 @@ private: } QListView* m_view; + QPixmap m_leftArrowIcon, + m_rightArrowIcon; }; class ArgumentsTokenizer diff --git a/src/GUI/arrow-left-icon.png b/src/GUI/arrow-left-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..352ee93315f5525b7133bc27ede022052a627786 GIT binary patch literal 681 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D%zPiKZiltlRY zSS9D@>LsS+C#C9D0BS3v*iS0onb8|oS8W7AZUnTBv4iY|~0L>t&w5X)?UL1X1yl$uzQ zUlfv`pJNB|QD$CtadKioD#%|p`sgYUF0}y}Y2{y(nF{nP$VYaDHu@N1Q1v$YAnzi1 z9}>1;QDETOaRF_DMU)+v#OcroVBGb1x;Tbd2riv`o3p`y$JJT9nA5y~qkgW-$Bi?a zk3??}NLp_eu|vLfjv z9t?T#p!Z;CWAk_OABqlz{Zp>n?R%i(q48_`rlV}zI5n4d#4hZZqw=l8Md-JiQm3iV l#3NBNJ(3Qms9Y`F$FTUMR?x|E?(?8T<>~6@vd$@?2>`Ri-}V3i literal 0 HcmV?d00001 diff --git a/src/GUI/arrow-right-icon.png b/src/GUI/arrow-right-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..2879b920bcd85ad595586a697f17e01471d51b58 GIT binary patch literal 688 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D%zPiKZiltlRY zSS9D@>LsS+C#C9D0BS3v*iS0onb8|oS8W7AZUnTBv4iY|~0L>t&w5X)?UL1X1yl$uzQ zUlfv`pJNB|QD$CtadKioD#%|p`sgYUF0}y}Y2{y(nF{nP$VYaDHu@N1Q1v$YAnzi1 z9}>1;QDETOaRF_DMU)+v#OcroVBAgiba4!^5L`O>HE)9gPm8p8F{gO}$A7ENW5?5Y zn!sb`9di>=54&8Jx(4L>{e2tMM>UN(-u6{1-oD!M history-icon.png large-search-icon.png + arrow-right-icon.png + arrow-left-icon.png \ No newline at end of file