| 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| 2 | Copyright (C) 2006-2010 Ricardo Villalba <rvm@escomposlinux.org>
|
|---|
| 3 |
|
|---|
| 4 | This library is free software; you can redistribute it and/or
|
|---|
| 5 | modify it under the terms of the GNU Lesser General Public
|
|---|
| 6 | License as published by the Free Software Foundation; either
|
|---|
| 7 | version 2.1 of the License, or (at your option) version 3, or any
|
|---|
| 8 | later version accepted by the membership of KDE e.V. (or its
|
|---|
| 9 | successor approved by the membership of KDE e.V.), Trolltech ASA
|
|---|
| 10 | (or its successors, if any) and the KDE Free Qt Foundation, which shall
|
|---|
| 11 | act as a proxy defined in Section 6 of version 3 of the license.
|
|---|
| 12 |
|
|---|
| 13 | This library is distributed in the hope that it will be useful,
|
|---|
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 16 | Lesser General Public License for more details.
|
|---|
| 17 |
|
|---|
| 18 | You should have received a copy of the GNU Lesser General Public
|
|---|
| 19 | License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 20 | */
|
|---|
| 21 |
|
|---|
| 22 | #ifndef _MYSLIDER_H_
|
|---|
| 23 | #define _MYSLIDER_H_
|
|---|
| 24 |
|
|---|
| 25 | #include <QSlider>
|
|---|
| 26 | #include "config.h"
|
|---|
| 27 |
|
|---|
| 28 | #define CODE_FOR_CLICK 1 // 0 = old code, 1 = code copied from QSlider, 2 = button swap
|
|---|
| 29 |
|
|---|
| 30 | class QTimer;
|
|---|
| 31 |
|
|---|
| 32 | class MySlider : public QSlider
|
|---|
| 33 | {
|
|---|
| 34 | Q_OBJECT
|
|---|
| 35 |
|
|---|
| 36 | public:
|
|---|
| 37 | MySlider( QWidget * parent );
|
|---|
| 38 | ~MySlider();
|
|---|
| 39 |
|
|---|
| 40 | protected:
|
|---|
| 41 | void mousePressEvent ( QMouseEvent * event );
|
|---|
| 42 | #if CODE_FOR_CLICK == 1
|
|---|
| 43 | inline int pick(const QPoint &pt) const;
|
|---|
| 44 | int pixelPosToRangeValue(int pos) const;
|
|---|
| 45 | #if QT_VERSION < 0x040300
|
|---|
| 46 | void initStyleOption(QStyleOptionSlider *option) const;
|
|---|
| 47 | #endif
|
|---|
| 48 | #endif
|
|---|
| 49 | };
|
|---|
| 50 |
|
|---|
| 51 | #endif
|
|---|
| 52 |
|
|---|