]> git.mxchange.org Git - flightgear.git/commitdiff
Arrow icons for variant selection.
authorJames Turner <zakalawe@mac.com>
Thu, 5 Mar 2015 15:53:40 +0000 (15:53 +0000)
committerJames Turner <zakalawe@mac.com>
Thu, 5 Mar 2015 15:53:40 +0000 (15:53 +0000)
src/GUI/QtLauncher.cxx
src/GUI/arrow-left-icon.png [new file with mode: 0644]
src/GUI/arrow-right-icon.png [new file with mode: 0644]
src/GUI/resources.qrc

index 5775a442d4d5eddf3e569db64fc298f32eee38da..e7feadc3ba431819c36dae4ccc7e3b9ac0fcc732 100644 (file)
@@ -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 (file)
index 0000000..352ee93
Binary files /dev/null and b/src/GUI/arrow-left-icon.png differ
diff --git a/src/GUI/arrow-right-icon.png b/src/GUI/arrow-right-icon.png
new file mode 100644 (file)
index 0000000..2879b92
Binary files /dev/null and b/src/GUI/arrow-right-icon.png differ
index dc348f85fe026cdf0c0aa5608c9b2f122baefd94..9415e5b6cd0b0357b1a2d225ad1ab8a5c6f791e5 100644 (file)
@@ -2,5 +2,7 @@
     <qresource prefix="/">
         <file alias="history-icon">history-icon.png</file>
         <file alias="search-icon">large-search-icon.png</file>
+        <file alias="right-arrow-icon">arrow-right-icon.png</file>
+        <file alias="left-arrow-icon">arrow-left-icon.png</file>
     </qresource>
 </RCC>
\ No newline at end of file