Arrow icons for variant selection.
This commit is contained in:
parent
7ca9fba4a8
commit
4038ba3d51
4 changed files with 13 additions and 2 deletions
|
@ -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
|
||||
|
|
BIN
src/GUI/arrow-left-icon.png
Normal file
BIN
src/GUI/arrow-left-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 681 B |
BIN
src/GUI/arrow-right-icon.png
Normal file
BIN
src/GUI/arrow-right-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 688 B |
|
@ -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>
|
Loading…
Add table
Reference in a new issue