2021-08-24 06:46:26 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2021 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#include "CircularProgressBarSkinlet.h"
|
|
|
|
#include "CircularProgressBar.h"
|
|
|
|
|
2021-10-11 12:44:40 +00:00
|
|
|
#include <QskArcNode.h>
|
2021-08-24 06:46:26 +00:00
|
|
|
#include <QskPaintedNode.h>
|
|
|
|
|
|
|
|
#include <QEasingCurve>
|
|
|
|
#include <QPainter>
|
|
|
|
|
|
|
|
CircularProgressBarSkinlet::CircularProgressBarSkinlet( QskSkin* skin )
|
|
|
|
: QskSkinlet( skin )
|
|
|
|
{
|
|
|
|
setNodeRoles( { GrooveRole, BarRole } );
|
|
|
|
}
|
|
|
|
|
|
|
|
CircularProgressBarSkinlet::~CircularProgressBarSkinlet()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QRectF CircularProgressBarSkinlet::subControlRect(
|
2021-08-24 12:38:03 +00:00
|
|
|
const QskSkinnable*, const QRectF& contentsRect, QskAspect::Subcontrol ) const
|
2021-08-24 06:46:26 +00:00
|
|
|
{
|
|
|
|
return contentsRect;
|
|
|
|
}
|
|
|
|
|
|
|
|
QSGNode* CircularProgressBarSkinlet::updateSubNode(
|
|
|
|
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
|
|
|
{
|
|
|
|
const auto bar = static_cast< const CircularProgressBar* >( skinnable );
|
|
|
|
|
|
|
|
switch( nodeRole )
|
|
|
|
{
|
2021-10-13 09:57:50 +00:00
|
|
|
case GrooveRole:
|
|
|
|
{
|
|
|
|
return updateArcNode( skinnable, node, CircularProgressBar::Groove,
|
|
|
|
bar->window() );
|
|
|
|
}
|
2021-08-24 06:46:26 +00:00
|
|
|
case BarRole:
|
|
|
|
{
|
2021-10-13 09:57:50 +00:00
|
|
|
const auto subControl = CircularProgressBar::Bar;
|
|
|
|
return updateArcNode( skinnable, node, CircularProgressBar::Bar,
|
|
|
|
bar->window() );
|
2021-08-24 06:46:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "moc_CircularProgressBarSkinlet.cpp"
|