Changeset 97a8dff38b78903b0362bf6dbfe65bf64197bcb1
- Timestamp:
- 23/01/08 02:40:42
(10 months ago)
- Author:
- Jean-Baptiste Kempf <jb@videolan.org>
- git-committer:
- Jean-Baptiste Kempf <jb@videolan.org> 1201052442 +0000
- git-parent:
[011e78e6ce52d771ae7661c4b42405e6922f50a4]
- git-author:
- Jean-Baptiste Kempf <jb@videolan.org> 1201052442 +0000
- Message:
Qt4 - Input Slider simplification... Draging still kind of suck...
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rcebe12a |
r97a8dff |
|
| 147 | 147 | components/playlist/selector.hpp \ |
|---|
| 148 | 148 | util/input_slider.hpp \ |
|---|
| 149 | | util/directslider.hpp \ |
|---|
| 150 | 149 | util/customwidgets.hpp \ |
|---|
| 151 | 150 | util/qvlcframe.hpp |
|---|
| r733d4d7 |
r97a8dff |
|
| 477 | 477 | /* Warn our embedded IM about input changes */ |
|---|
| 478 | 478 | CONNECT( this, inputChanged( input_thread_t * ), |
|---|
| 479 | | im, setInput( input_thread_t * ) ); |
|---|
| | 479 | im, setInput( input_thread_t * ) ); |
|---|
| 480 | 480 | } |
|---|
| 481 | 481 | |
|---|
| rad2f8e7 |
r97a8dff |
|
| 30 | 30 | #include <QStyle> |
|---|
| 31 | 31 | |
|---|
| 32 | | InputSlider::InputSlider( QWidget *_parent ) : DirectSlider( _parent ) |
|---|
| | 32 | InputSlider::InputSlider( QWidget *_parent ) : QSlider( _parent ) |
|---|
| 33 | 33 | { |
|---|
| 34 | 34 | InputSlider::InputSlider( Qt::Horizontal, _parent ); |
|---|
| … | … | |
| 36 | 36 | |
|---|
| 37 | 37 | InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) : |
|---|
| 38 | | DirectSlider( q, _parent ) |
|---|
| | 38 | QSlider( q, _parent ) |
|---|
| 39 | 39 | { |
|---|
| 40 | 40 | mymove = false; |
|---|
| … | … | |
| 67 | 67 | emit sliderDragged( f_pos ); |
|---|
| 68 | 68 | } |
|---|
| | 69 | } |
|---|
| | 70 | |
|---|
| | 71 | void InputSlider::mousePressEvent(QMouseEvent* event) |
|---|
| | 72 | { |
|---|
| | 73 | if( event->button() != Qt::LeftButton && event->button() != Qt::MidButton ) |
|---|
| | 74 | { |
|---|
| | 75 | QSlider::mousePressEvent( event ); |
|---|
| | 76 | return; |
|---|
| | 77 | } |
|---|
| | 78 | |
|---|
| | 79 | QMouseEvent newEvent( event->type(), event->pos(), event->globalPos(), |
|---|
| | 80 | Qt::MouseButton( event->button() ^ Qt::LeftButton ^ Qt::MidButton ), |
|---|
| | 81 | Qt::MouseButtons( event->buttons() ^ Qt::LeftButton ^ Qt::MidButton ), |
|---|
| | 82 | event->modifiers() ); |
|---|
| | 83 | QSlider::mousePressEvent( &newEvent ); |
|---|
| 69 | 84 | } |
|---|
| 70 | 85 | |
|---|
| r8b58391 |
r97a8dff |
|
| 25 | 25 | #define _INPUTSLIDER_H_ |
|---|
| 26 | 26 | |
|---|
| 27 | | #include "util/directslider.hpp" |
|---|
| | 27 | #include <QSlider> |
|---|
| | 28 | #include <QMouseEvent> |
|---|
| 28 | 29 | |
|---|
| 29 | | class InputSlider : public DirectSlider |
|---|
| | 30 | class InputSlider : public QSlider |
|---|
| 30 | 31 | { |
|---|
| 31 | 32 | Q_OBJECT |
|---|
| … | … | |
| 35 | 36 | virtual ~InputSlider() {}; |
|---|
| 36 | 37 | protected: |
|---|
| 37 | | void mouseMoveEvent(QMouseEvent *event); |
|---|
| | 38 | virtual void mouseMoveEvent(QMouseEvent *event); |
|---|
| | 39 | virtual void mousePressEvent(QMouseEvent* event); |
|---|
| 38 | 40 | private: |
|---|
| 39 | 41 | bool mymove; |
|---|