2017-07-21 18:21:34 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the 3-clause BSD License
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SLIDER_SKINLET_H
|
|
|
|
#define SLIDER_SKINLET_H
|
|
|
|
|
|
|
|
#include <QskSliderSkinlet.h>
|
|
|
|
|
|
|
|
class QSGTransformNode;
|
|
|
|
|
|
|
|
class SliderSkinlet : public QskSliderSkinlet
|
|
|
|
{
|
|
|
|
using Inherited = QskSliderSkinlet;
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
public:
|
2017-07-21 18:21:34 +02:00
|
|
|
enum NodeRole
|
|
|
|
{
|
2017-10-20 20:26:39 +02:00
|
|
|
// we have a scale instead of a groove
|
2017-07-21 18:21:34 +02:00
|
|
|
ScaleRole = QskSliderSkinlet::HandleRole + 1,
|
|
|
|
DecorationRole
|
|
|
|
};
|
|
|
|
|
|
|
|
SliderSkinlet();
|
2018-07-31 17:32:25 +02:00
|
|
|
~SliderSkinlet() override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
QRectF subControlRect( const QskSkinnable*,
|
2019-04-25 14:23:39 +02:00
|
|
|
const QRectF&, QskAspect::Subcontrol ) const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
protected:
|
|
|
|
QSGNode* updateSubNode( const QskSkinnable*,
|
|
|
|
quint8 nodeRole, QSGNode* ) const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
private:
|
2017-10-20 20:26:39 +02:00
|
|
|
QSGNode* updateScaleNode( const QskSlider*, QSGNode* ) const;
|
|
|
|
QSGNode* updateDecorationNode( const QskSlider*, QSGNode* ) const;
|
2017-07-21 18:21:34 +02:00
|
|
|
QSGNode* updateHandleNode( const QskSlider*, QSGNode* ) const;
|
|
|
|
|
2019-04-25 14:23:39 +02:00
|
|
|
QRectF scaleRect( const QRectF& ) const;
|
|
|
|
QRectF fillRect( const QskSlider*, const QRectF& ) const;
|
|
|
|
QRectF decorationRect( const QskSlider*, const QRectF& ) const;
|
|
|
|
QRectF handleRect( const QskSlider*, const QRectF& ) const;
|
2017-07-21 18:21:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|