diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-14 18:48:28 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-14 18:48:28 +0000 |
| commit | 09444084654489cd2f3af75cb5a64b44aa9a06ef (patch) | |
| tree | c9b0502f3b357b6c98ce07237e635cef06056b90 /src | |
| parent | e83c06bb9909388aae4c1c6fdafe3781d4ab289a (diff) | |
| download | qmmp-09444084654489cd2f3af75cb5a64b44aa9a06ef.tar.gz qmmp-09444084654489cd2f3af75cb5a64b44aa9a06ef.tar.bz2 qmmp-09444084654489cd2f3af75cb5a64b44aa9a06ef.zip | |
fixed drawing bugs
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4849 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/Ui/skinned/playlistheader.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/plugins/Ui/skinned/playlistheader.cpp b/src/plugins/Ui/skinned/playlistheader.cpp index 387691d59..0eed22566 100644 --- a/src/plugins/Ui/skinned/playlistheader.cpp +++ b/src/plugins/Ui/skinned/playlistheader.cpp @@ -136,7 +136,16 @@ void PlayListHeader::updateColumns() if(m_model->count() == 1) { m_rects << QRect(sx, 0, width() - sx - 5, height()); - m_names << m_model->name(0); + if(m_sorting_column == 0) + { + m_names << m_metrics->elidedText(m_model->name(0), Qt::ElideRight, + m_rects.last().width() - 2 * m_padding - m_arrow_up.width() - 4); + } + else + { + m_names << m_metrics->elidedText(m_model->name(0), Qt::ElideRight, + m_rects.last().width() - 2 * m_padding); + } return; } @@ -374,6 +383,12 @@ void PlayListHeader::paintEvent(QPaintEvent *) if(m_names.count() == 1) { painter.drawText(m_rects[0].x() + m_padding, m_metrics->ascent(), m_names[0]); + if(m_sorting_column == 0) + { + painter.drawPixmap(m_rects[0].right() - m_arrow_up.width() - 4, + (height() - m_arrow_up.height()) / 2, + m_reverted ? m_arrow_up : m_arrow_down); + } return; } @@ -398,7 +413,8 @@ void PlayListHeader::paintEvent(QPaintEvent *) if(i == m_sorting_column) { painter.drawPixmap(m_rects[i].right() - m_arrow_up.width() - 4, - (height() - m_arrow_up.height()) / 2, m_reverted ? m_arrow_up : m_arrow_down); + (height() - m_arrow_up.height()) / 2, + m_reverted ? m_arrow_up : m_arrow_down); } } |
