aboutsummaryrefslogtreecommitdiff
path: root/src/ui/playlistselector.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-02-27 12:25:47 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-02-27 12:25:47 +0000
commitf7d49232a953d33ee57080193dfdf3d939deef29 (patch)
tree434744c411c9b4bd795227645fac7c90a008ac42 /src/ui/playlistselector.cpp
parent9e71a3a8a2d092b4ce61c502e82c0a275656a532 (diff)
downloadqmmp-f7d49232a953d33ee57080193dfdf3d939deef29.tar.gz
qmmp-f7d49232a953d33ee57080193dfdf3d939deef29.tar.bz2
qmmp-f7d49232a953d33ee57080193dfdf3d939deef29.zip
fixed playlist selector
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1592 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/playlistselector.cpp')
-rw-r--r--src/ui/playlistselector.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/ui/playlistselector.cpp b/src/ui/playlistselector.cpp
index e63056c89..8d84750a4 100644
--- a/src/ui/playlistselector.cpp
+++ b/src/ui/playlistselector.cpp
@@ -36,6 +36,8 @@ PlayListSelector::PlayListSelector(PlayListManager *manager, QWidget *parent) :
{
m_update = FALSE;
m_scrollable = FALSE;
+ m_left_pressed = FALSE;
+ m_right_pressed = FALSE;
m_offset = 0;
m_offset_max = 0;
m_skin = Skin::instance();
@@ -155,6 +157,8 @@ void PlayListSelector::mousePressEvent (QMouseEvent *e)
{
m_offset += m_rects.at(lastVisible()).right() - m_offset - width() + 42;
m_offset = qMin(m_offset, m_offset_max);
+ m_right_pressed = TRUE;
+ drawButtons();
update();
return;
}
@@ -162,6 +166,8 @@ void PlayListSelector::mousePressEvent (QMouseEvent *e)
{
m_offset -= 11 - m_rects.at(firstVisible()).x() + m_offset;
m_offset = qMax(0, m_offset);
+ m_left_pressed = TRUE;
+ drawButtons();
update();
return;
}
@@ -181,9 +187,18 @@ void PlayListSelector::mousePressEvent (QMouseEvent *e)
m_menu->exec(e->globalPos());
}
+void PlayListSelector::mouseReleaseEvent (QMouseEvent *e)
+{
+ m_left_pressed = FALSE;
+ m_right_pressed = FALSE;
+ drawButtons();
+ update();
+ QWidget::mouseReleaseEvent(e);
+}
+
void PlayListSelector::mouseDoubleClickEvent (QMouseEvent *e)
{
- if(e->button() == Qt::LeftButton)
+ if(e->button() == Qt::LeftButton && !(m_scrollable && (e->x() > width() - 40)))
renamePlaylist();
else
QWidget::mouseDoubleClickEvent(e);
@@ -207,19 +222,20 @@ void PlayListSelector::drawButtons()
m_pixmap = QPixmap(40, height());
m_pixmap.fill(m_normal_bg);
QPainter painter(&m_pixmap);
- painter.setPen(m_normal);
- painter.setBrush(QBrush(m_normal));
+ painter.setPen(m_left_pressed ? m_current : m_normal);
+ painter.setBrush(QBrush(m_left_pressed ? m_current : m_normal));
QPoint points[3] = {
- QPoint(m_pixmap.width() - 25, height()/2 - 6),
+ QPoint(m_pixmap.width() - 25, height()/2 - 5),
QPoint(m_pixmap.width() - 35, height()/2-1),
- QPoint(m_pixmap.width() - 25, height()/2 + 4),
+ QPoint(m_pixmap.width() - 25, height()/2 + 3),
};
painter.drawPolygon(points, 3);
-
+ painter.setPen(m_right_pressed ? m_current : m_normal);
+ painter.setBrush(QBrush(m_right_pressed ? m_current : m_normal));
QPoint points2[3] = {
- QPoint(m_pixmap.width() - 20, height()/2 - 6),
+ QPoint(m_pixmap.width() - 20, height()/2 - 5),
QPoint(m_pixmap.width() - 10, height()/2-1),
- QPoint(m_pixmap.width() - 20, height()/2 + 4),
+ QPoint(m_pixmap.width() - 20, height()/2 + 3),
};
painter.drawPolygon(points2, 3);
}