2021-11-19 15:02:57 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright (C) 2021 Edelhirsch Software GmbH
|
2023-04-06 10:15:03 +02:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2021-11-19 15:02:57 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QskBoundedValueInput.h>
|
|
|
|
#include <QskShadowMetrics.h>
|
|
|
|
|
|
|
|
class LightDisplay : public QskBoundedValueInput
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
QSK_SUBCONTROLS( Panel, Groove, ColdAndWarmArc, Tickmarks, ValueText,
|
2023-02-28 15:49:42 +01:00
|
|
|
LeftLabel, RightLabel, Knob ) // ### rename knob to handle?
|
2021-11-19 15:02:57 +01:00
|
|
|
QSK_STATES( Pressed )
|
|
|
|
|
|
|
|
LightDisplay( QQuickItem* parent = nullptr );
|
|
|
|
|
|
|
|
bool isPressed() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void mousePressEvent( QMouseEvent* e ) override;
|
|
|
|
void mouseMoveEvent( QMouseEvent* e ) override;
|
|
|
|
void mouseReleaseEvent( QMouseEvent* e ) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
qreal angleFromPoint( const QRectF&, const QPointF& ) const;
|
|
|
|
bool arcContainsPoint( const QRectF&, const QPointF& ) const;
|
|
|
|
};
|