diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-09-09 19:45:15 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-09-09 19:45:15 +0000 |
| commit | 0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532 (patch) | |
| tree | 33da2a2b96d40e270b4bbe3a124bdf7e23b788f5 /src/ui/positionbar.cpp | |
| parent | 3188ada336102df3bf8d77cdafdab1a8f65f4d86 (diff) | |
| download | qmmp-0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532.tar.gz qmmp-0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532.tar.bz2 qmmp-0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532.zip | |
new libqmmp api, a lot of features has been temporary disabled
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@546 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/positionbar.cpp')
| -rw-r--r-- | src/ui/positionbar.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/ui/positionbar.cpp b/src/ui/positionbar.cpp index 5431fd4f3..08a612fcb 100644 --- a/src/ui/positionbar.cpp +++ b/src/ui/positionbar.cpp @@ -38,7 +38,7 @@ PositionBar::PositionBar(QWidget *parent) mw = qobject_cast<MainWindow*>(window()); m_moving = FALSE; m_min = 0; - m_max = 50; + m_max = 0; m_old = m_value = 0; draw(FALSE); } @@ -52,7 +52,7 @@ void PositionBar::mousePressEvent(QMouseEvent *e) m_moving = TRUE; press_pos = e->x(); - if(m_pos<e->x() && e->x()<m_pos+29) + if (m_pos<e->x() && e->x()<m_pos+29) { press_pos = e->x()-m_pos; } @@ -71,12 +71,12 @@ void PositionBar::mousePressEvent(QMouseEvent *e) void PositionBar::mouseMoveEvent (QMouseEvent *e) { - if(m_moving) + if (m_moving) { int po = e->x(); po = po - press_pos; - if(0<=po && po<=width()-30) + if (0<=po && po<=width()-30) { m_value = convert(po); draw(); @@ -122,12 +122,15 @@ void PositionBar::draw(bool pressed) { int p=int(ceil(double(m_value-m_min)*(width()-30)/(m_max-m_min))); m_pixmap = m_skin->getPosBar(); - QPainter paint(&m_pixmap); - if(pressed) - paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_P)); - else - paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_N)); - setPixmap(m_pixmap); + if (m_max > 0) + { + QPainter paint(&m_pixmap); + if (pressed) + paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_P)); + else + paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_N)); + } + setPixmap(m_pixmap); m_pos = p; } |
