Changeset 97a8dff38b78903b0362bf6dbfe65bf64197bcb1

Show
Ignore:
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
  • modules/gui/qt4/Modules.am

    rcebe12a r97a8dff  
    147147    components/playlist/selector.hpp \ 
    148148    util/input_slider.hpp \ 
    149     util/directslider.hpp \ 
    150149    util/customwidgets.hpp \ 
    151150    util/qvlcframe.hpp 
  • modules/gui/qt4/input_manager.cpp

    r733d4d7 r97a8dff  
    477477    /* Warn our embedded IM about input changes */ 
    478478    CONNECT( this, inputChanged( input_thread_t * ), 
    479              im,   setInput( input_thread_t * ) ); 
     479             im, setInput( input_thread_t * ) ); 
    480480} 
    481481 
  • modules/gui/qt4/util/input_slider.cpp

    rad2f8e7 r97a8dff  
    3030#include <QStyle> 
    3131 
    32 InputSlider::InputSlider( QWidget *_parent ) : DirectSlider( _parent ) 
     32InputSlider::InputSlider( QWidget *_parent ) : QSlider( _parent ) 
    3333{ 
    3434    InputSlider::InputSlider( Qt::Horizontal, _parent ); 
     
    3636 
    3737InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) : 
    38                                  DirectSlider( q, _parent ) 
     38                                 QSlider( q, _parent ) 
    3939{ 
    4040    mymove = false; 
     
    6767        emit sliderDragged( f_pos ); 
    6868    } 
     69} 
     70 
     71void 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 ); 
    6984} 
    7085 
  • modules/gui/qt4/util/input_slider.hpp

    r8b58391 r97a8dff  
    2525#define _INPUTSLIDER_H_ 
    2626 
    27 #include "util/directslider.hpp" 
     27#include <QSlider> 
     28#include <QMouseEvent> 
    2829 
    29 class InputSlider : public DirectSlider 
     30class InputSlider : public QSlider 
    3031{ 
    3132    Q_OBJECT 
     
    3536    virtual ~InputSlider()   {}; 
    3637protected: 
    37     void mouseMoveEvent(QMouseEvent *event); 
     38    virtual void mouseMoveEvent(QMouseEvent *event); 
     39    virtual void mousePressEvent(QMouseEvent* event); 
    3840private: 
    3941    bool mymove;