diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-13 13:23:04 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-13 13:23:04 +0000 |
| commit | 555165e35704240335bd7d7ea4af6c66bee8d73b (patch) | |
| tree | 9af2ef9ea6e9090a8d911109211fe57586a769df /src/plugins | |
| parent | 11aafe91ce22d00cf5b36f7dd835d38875d17d0f (diff) | |
| download | qmmp-555165e35704240335bd7d7ea4af6c66bee8d73b.tar.gz qmmp-555165e35704240335bd7d7ea4af6c66bee8d73b.tar.bz2 qmmp-555165e35704240335bd7d7ea4af6c66bee8d73b.zip | |
skinned: added sorting arrows
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4846 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/Ui/skinned/playlistheader.cpp | 35 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/playlistheader.h | 2 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/plugins/Ui/skinned/playlistheader.cpp b/src/plugins/Ui/skinned/playlistheader.cpp index 0ed151e0b..75cb299fa 100644 --- a/src/plugins/Ui/skinned/playlistheader.cpp +++ b/src/plugins/Ui/skinned/playlistheader.cpp @@ -19,6 +19,7 @@ ***************************************************************************/ #include <QPainter> +#include <QBitmap> #include <QFont> #include <QFontMetrics> #include <QSettings> @@ -35,6 +36,28 @@ #include "skin.h" #include "playlistheader.h" +static const char * const skinned_arrow_down_xpm[] = { + "11 6 2 1", + " c None", + "x c #000000", + " ", + " xxxxxxxxx ", + " xxxxxxx ", + " xxxxx ", + " xxx ", + " x "}; + +static const char * const skinned_arrow_up_xpm[] = { + "11 6 2 1", + " c None", + "x c #000000", + " x ", + " xxx ", + " xxxxx ", + " xxxxxxx ", + " xxxxxxxxx ", + " "}; + PlayListHeader::PlayListHeader(QWidget *parent) : QWidget(parent) { @@ -85,6 +108,7 @@ void PlayListHeader::readSettings() m_show_number = settings.value ("pl_show_numbers", true).toBool(); m_align_numbres = settings.value ("pl_align_numbers", false).toBool(); m_padding = m_metrics->width("9")/2; + settings.endGroup(); updateColumns(); } @@ -332,6 +356,8 @@ void PlayListHeader::paintEvent(QPaintEvent *) painter.drawLine(m_rects[i].right()+1, 0, m_rects[i].right()+1, height()+1); + painter.drawPixmap(m_rects[i].right() - m_arrow_up.width() - 4, (height() - m_arrow_up.height()) / 2, m_arrow_up); + } if(m_task == MOVE) @@ -351,6 +377,15 @@ void PlayListHeader::loadColors() m_normal.setNamedColor(m_skin->getPLValue("normal")); m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); m_current.setNamedColor(m_skin->getPLValue("current")); + + QPixmap px1(skinned_arrow_up_xpm); + QPixmap px2(skinned_arrow_up_xpm); + m_arrow_up = px1; + m_arrow_down = px2; + m_arrow_up.fill(m_normal_bg); + m_arrow_down.fill(m_normal_bg); + m_arrow_up.setMask(px1.createMaskFromColor(Qt::transparent)); + m_arrow_down.setMask(px2.createMaskFromColor(Qt::transparent)); } int PlayListHeader::findColumn(QPoint pos) diff --git a/src/plugins/Ui/skinned/playlistheader.h b/src/plugins/Ui/skinned/playlistheader.h index 393856d1f..b43e2c962 100644 --- a/src/plugins/Ui/skinned/playlistheader.h +++ b/src/plugins/Ui/skinned/playlistheader.h @@ -22,6 +22,7 @@ #define PLAYLISTHEADER_H #include <QWidget> +#include <QPixmap> class QFontMetrics; class QFont; @@ -74,6 +75,7 @@ private: QPoint m_mouse_pos; PlayListHeaderModel *m_model; QAction *m_autoResize; + QPixmap m_arrow_up, m_arrow_down; bool m_show_number; bool m_align_numbres; int m_number_width; |
