qskinny/examples/iotdashboard/CircularProgressBarSkinlet.h
Peter Hartmann 3a1a7c635c
Iot dashboard: Make circular progress bar a QskControl (#124)
* IOT example, circular progress bar: Use a pen instead of a brush

That way we don't have to draw two circles, and we can in addition
use a conical gradient.

* IOT example: Make circular progress bar a QskControl

... and internally use a QskPaintedNode for now. By doing this we
already have the API ready (similar to QskProgressBar) and can
swap the QskPaintedNode with an arc renderer at a later point in
time.
2021-08-24 08:46:26 +02:00

40 lines
996 B
C++

/******************************************************************************
* QSkinny - Copyright (C) 2021 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#pragma once
#include <QskSkinlet.h>
class CircularProgressBar;
class CircularProgressBarSkinlet : public QskSkinlet
{
Q_GADGET
using Inherited = QskSkinlet;
public:
enum NodeRole
{
GrooveRole,
BarRole,
RoleCount,
};
Q_INVOKABLE CircularProgressBarSkinlet( QskSkin* = nullptr );
~CircularProgressBarSkinlet() override;
QRectF subControlRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol ) const override;
protected:
QSGNode* updateSubNode( const QskSkinnable*,
quint8 nodeRole, QSGNode* ) const override;
private:
QSGNode* updateBarNode( const CircularProgressBar*, quint8 nodeRole, QSGNode* ) const;
};