diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-09-30 16:38:10 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-09-30 16:38:10 +0000 |
| commit | 97adebbb8689671e6045d09f84456f28566aa3ed (patch) | |
| tree | e4202f9e64512ceb82f7be8bac42076b1af22bbe /src/plugins/Ui/skinned/timeindicator.h | |
| parent | e3da4a8739f801d83ee4386a559e9cd010398101 (diff) | |
| download | qmmp-97adebbb8689671e6045d09f84456f28566aa3ed.tar.gz qmmp-97adebbb8689671e6045d09f84456f28566aa3ed.tar.bz2 qmmp-97adebbb8689671e6045d09f84456f28566aa3ed.zip | |
skinned: improved time indicator in shaded mode (Thomas Perl) (#811)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5621 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/skinned/timeindicator.h')
| -rw-r--r-- | src/plugins/Ui/skinned/timeindicator.h | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/src/plugins/Ui/skinned/timeindicator.h b/src/plugins/Ui/skinned/timeindicator.h index 38d8e898e..526583688 100644 --- a/src/plugins/Ui/skinned/timeindicator.h +++ b/src/plugins/Ui/skinned/timeindicator.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * + * Copyright (C) 2006-2015 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -23,11 +23,50 @@ #include "pixmapwidget.h" class QMouseEvent; -class QTimer; class Skin; +/** Class TimeIndicatorModel + * @author Thomas Perl <m@thp.io> + * + * Encapsulates state and settings for the time indicator + */ +class TimeIndicatorModel : public QObject { + Q_OBJECT +public: + TimeIndicatorModel(QObject *parent = 0); + ~TimeIndicatorModel(); + + int position() { return m_position; } + int duration() { return m_duration; } + bool elapsed() { return m_elapsed; } + bool visible() { return m_visible; } + + void setPosition(int position); + void setDuration(int duration); + void setElapsed(bool elapsed); + void setVisible(bool visible); + + int displayTime(); + +public slots: + void toggleElapsed(); + +signals: + void changed(); + +private: + void readSettings(); + void writeSettings(); + + int m_position; + int m_duration; + bool m_elapsed; + bool m_visible; +}; + + /** Class TimeIndicator * @author Vladimir Kuznetsov <vovanec@gmail.com> * @@ -38,31 +77,22 @@ class TimeIndicator : public PixmapWidget { Q_OBJECT public: - TimeIndicator(QWidget *parent = 0); + TimeIndicator(TimeIndicatorModel *model, QWidget *parent = 0); ~TimeIndicator(); - void setTime ( int t ); - void setSongDuration(int); - void setNeedToShowTime(bool); protected: virtual void mousePressEvent(QMouseEvent*); virtual void mouseMoveEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); - void writeSettings(); - void readSettings(); private slots: + void modelChanged(); void updateSkin(); - void reset(); private: + TimeIndicatorModel *m_model; QPixmap m_pixmap; Skin *m_skin; - int m_time; - int m_songDuration; - bool m_elapsed; - bool m_needToShowTime; - QTimer *m_timer; }; #endif |
