diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-03-05 15:31:21 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-03-05 15:31:21 +0000 |
| commit | 6f2cb48f2aefdea338d59111fd9f80440b6c1dc1 (patch) | |
| tree | 0ff5ca4190ceb058964b8e34f22c667c88e63e0a /src/ui/timeindicator.cpp | |
| parent | d0175f9a6b22c72642d43819ce873d03be3f455f (diff) | |
| download | qmmp-6f2cb48f2aefdea338d59111fd9f80440b6c1dc1.tar.gz qmmp-6f2cb48f2aefdea338d59111fd9f80440b6c1dc1.tar.bz2 qmmp-6f2cb48f2aefdea338d59111fd9f80440b6c1dc1.zip | |
fixed time indicator blinking
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@821 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/timeindicator.cpp')
| -rw-r--r-- | src/ui/timeindicator.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ui/timeindicator.cpp b/src/ui/timeindicator.cpp index 111ed2d07..ee979a94d 100644 --- a/src/ui/timeindicator.cpp +++ b/src/ui/timeindicator.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * + * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -20,6 +20,7 @@ #include <QPainter> #include <QSettings> #include <QMouseEvent> +#include <QTimer> #include <qmmp/qmmp.h> #include "skin.h" @@ -37,6 +38,10 @@ TimeIndicator::TimeIndicator ( QWidget *parent ) updateSkin(); reset(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + m_timer = new QTimer(this); + m_timer->setInterval(125); + m_timer->setSingleShot (TRUE); + connect(m_timer, SIGNAL(timeout()),SLOT(reset())); } void TimeIndicator::setTime ( int t ) @@ -50,7 +55,7 @@ void TimeIndicator::setTime ( int t ) t = m_songDuration - t; paint.drawPixmap(QPoint(2,0),m_skin->getNumber( 10 )); } - if(t < 0) + if (t < 0) t = 0; paint.drawPixmap(QPoint(13,0),m_skin->getNumber( t/600%10 )); @@ -117,7 +122,11 @@ void TimeIndicator::writeSettings() void TimeIndicator::setNeedToShowTime(bool need) { m_needToShowTime = need; - if (!need) reset(); + //if (!need) reset(); + if (!need) + m_timer->start(); + else + m_timer->stop(); } void TimeIndicator::mouseMoveEvent(QMouseEvent *) |
