2020-09-08 15:21:54 +00:00
|
|
|
#ifndef LIGHTINTENSITY_H
|
|
|
|
#define LIGHTINTENSITY_H
|
|
|
|
|
2020-09-17 14:47:34 +00:00
|
|
|
#include "Box.h"
|
2020-09-08 15:21:54 +00:00
|
|
|
|
|
|
|
#include <QQuickPaintedItem>
|
2020-09-30 14:12:21 +00:00
|
|
|
#include <QRadialGradient>
|
2020-09-08 15:21:54 +00:00
|
|
|
|
2020-09-30 15:04:20 +00:00
|
|
|
class DimmerAnimator;
|
2020-09-08 15:21:54 +00:00
|
|
|
class QskTextLabel;
|
|
|
|
|
|
|
|
class LightDimmer: public QQuickPaintedItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
LightDimmer( QQuickItem* parent );
|
|
|
|
|
|
|
|
double thickness() const
|
|
|
|
{
|
|
|
|
return m_thickness;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setThickness( double thickness )
|
|
|
|
{
|
|
|
|
m_thickness = thickness;
|
|
|
|
}
|
|
|
|
|
2020-09-30 15:04:20 +00:00
|
|
|
QColor backgroundColor() const
|
|
|
|
{
|
|
|
|
return m_backgroundColor;
|
|
|
|
}
|
|
|
|
|
2020-09-23 15:45:06 +00:00
|
|
|
void setBackgroundColor( const QColor& color )
|
|
|
|
{
|
|
|
|
m_backgroundColor = color;
|
|
|
|
}
|
|
|
|
|
2020-09-30 14:12:21 +00:00
|
|
|
QRadialGradient ringGradient() const
|
|
|
|
{
|
|
|
|
return m_ringGradient;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setRingGradient( const QRadialGradient& gradient )
|
|
|
|
{
|
|
|
|
m_ringGradient = gradient;
|
|
|
|
}
|
|
|
|
|
2020-09-08 15:21:54 +00:00
|
|
|
private:
|
|
|
|
double m_thickness = 17.57;
|
2020-09-23 15:45:06 +00:00
|
|
|
QColor m_backgroundColor;
|
2020-09-30 14:12:21 +00:00
|
|
|
QRadialGradient m_ringGradient;
|
2020-09-08 15:21:54 +00:00
|
|
|
|
|
|
|
virtual void paint( QPainter* painter ) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LightDisplay : public QskControl
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-09-23 15:45:06 +00:00
|
|
|
QSK_SUBCONTROLS( Panel )
|
|
|
|
|
2020-09-08 15:21:54 +00:00
|
|
|
LightDisplay( QQuickItem* parent );
|
|
|
|
|
2020-09-23 15:45:06 +00:00
|
|
|
QskAspect::Subcontrol effectiveSubcontrol(
|
|
|
|
QskAspect::Subcontrol subControl ) const override final;
|
|
|
|
|
2020-09-08 15:21:54 +00:00
|
|
|
protected:
|
|
|
|
void updateLayout() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QskTextLabel* m_leftLabel;
|
|
|
|
QskTextLabel* m_centreLabel;
|
|
|
|
QskTextLabel* m_rightLabel;
|
|
|
|
LightDimmer* m_dimmer;
|
2020-09-30 15:04:20 +00:00
|
|
|
DimmerAnimator* m_animator;
|
2020-09-08 15:21:54 +00:00
|
|
|
};
|
|
|
|
|
2020-09-17 14:47:34 +00:00
|
|
|
class LightIntensity : public Box
|
2020-09-08 15:21:54 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
LightIntensity( QQuickItem* parent );
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LIGHTINTENSITY_H
|