qskinny/src/controls/QskSlider.h
Uwe Rathmann e6f0088ae4 All box subcontrols are displayd with vertex lists instead of
textures
    now. Implementation is almost complete beside of the not yet done Qt
    antialiasing mode. Not all sort of linear gradients ( see
    QLinearGradients ) are implemented - needs 1-2 days more.
    The aspect flags for box primitives have been substantially changed
from
    too atomic to more strutured units.
    The skins are currently incomplete - will be fixed later.
2017-10-17 17:34:00 +02:00

68 lines
1.8 KiB
C++

/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_SLIDER_H
#define QSK_SLIDER_H
#include "QskRangeControl.h"
class QSGNode;
class QskSkin;
class QSK_EXPORT QskSlider : public QskRangeControl
{
Q_OBJECT
Q_PROPERTY( bool isPressed READ isPressed NOTIFY pressedChanged )
Q_PROPERTY( Qt::Orientation orientation READ orientation
WRITE setOrientation NOTIFY orientationChanged )
Q_PROPERTY( bool tracking READ isTracking WRITE setTracking NOTIFY trackingChanged )
using Inherited = QskRangeControl;
public:
QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Handle )
QSK_STATES( Pressed, Minimum, Maximum )
explicit QskSlider( QQuickItem* parent = nullptr );
explicit QskSlider( Qt::Orientation, QQuickItem* parent = nullptr );
virtual ~QskSlider();
bool isPressed() const;
void setOrientation( Qt::Orientation );
Qt::Orientation orientation() const;
void setTracking( bool );
bool isTracking() const;
virtual QSizeF contentsSizeHint() const override;
virtual QskAspect::Placement effectivePlacement() const override;
Q_SIGNALS:
void pressedChanged( bool );
void orientationChanged( Qt::Orientation );
void trackingChanged( bool );
protected:
virtual void mousePressEvent( QMouseEvent* e ) override;
virtual void mouseMoveEvent( QMouseEvent* e ) override;
virtual void mouseReleaseEvent( QMouseEvent* e ) override;
QSizeF handleSize() const;
QRectF handleRect() const;
private:
void updatePosition();
class PrivateData;
std::unique_ptr< PrivateData > m_data;
};
#endif