This commit is contained in:
Peter Hartmann 2021-10-13 14:24:41 +02:00
parent 1ccd19392b
commit deb5df8edb
10 changed files with 16 additions and 19 deletions

View File

@ -6,7 +6,6 @@
#include "CircularProgressBarSkinlet.h" #include "CircularProgressBarSkinlet.h"
#include "CircularProgressBar.h" #include "CircularProgressBar.h"
#include <QskArcNode.h>
#include <QskPaintedNode.h> #include <QskPaintedNode.h>
#include <QEasingCurve> #include <QEasingCurve>
@ -42,7 +41,6 @@ QSGNode* CircularProgressBarSkinlet::updateSubNode(
} }
case BarRole: case BarRole:
{ {
const auto subControl = CircularProgressBar::Bar;
return updateArcNode( skinnable, node, CircularProgressBar::Bar, return updateArcNode( skinnable, node, CircularProgressBar::Bar,
bar->window() ); bar->window() );
} }

View File

@ -116,6 +116,8 @@ void Skin::initHints( const Palette& palette )
// the bar gradient is defined through the top bar items above // the bar gradient is defined through the top bar items above
ed.setArcMetrics( CircularProgressBar::Groove, { 8.53, 90 * 16, -360 * 16 } ); ed.setArcMetrics( CircularProgressBar::Groove, { 8.53, 90 * 16, -360 * 16 } );
// the span angle will be set in the progress bar, we just give a dummy
// value here:
ed.setArcMetrics( CircularProgressBar::Bar, { 8.53, 90 * 16, -180 * 16 } ); ed.setArcMetrics( CircularProgressBar::Bar, { 8.53, 90 * 16, -180 * 16 } );
ed.setFontRole( TimeTitleLabel::Text, Skin::TitleFont ); ed.setFontRole( TimeTitleLabel::Text, Skin::TitleFont );

View File

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann * QSkinny - Copyright (C) 2021 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0 * This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/ *****************************************************************************/
@ -110,8 +110,8 @@ QDebug operator<<( QDebug debug, const QskArcMetrics& metrics )
debug << "Arc" << '('; debug << "Arc" << '(';
debug << "width:" << metrics.width(); debug << "width:" << metrics.width();
debug << "start angle:" << metrics.startAngle(); debug << ", start angle:" << metrics.startAngle();
debug << "span angle:" << metrics.spanAngle(); debug << ", span angle:" << metrics.spanAngle();
debug << ", size mode:" << metrics.sizeMode(); debug << ", size mode:" << metrics.sizeMode();
debug << ')'; debug << ')';

View File

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann * QSkinny - Copyright (C) 2021 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0 * This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/ *****************************************************************************/

View File

@ -474,11 +474,11 @@ QskBoxBorderColors QskSkinHintTableEditor::boxBorderColors( QskAspect aspect ) c
return colorHint< QskBoxBorderColors >( aspectBorder( aspect ) ); return colorHint< QskBoxBorderColors >( aspectBorder( aspect ) );
} }
void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect, qreal startAngle, void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect, qreal width,
qreal endAngle, qreal width, Qt::SizeMode sizeMode ) int startAngle, int spanAngle, Qt::SizeMode sizeMode )
{ {
setMetricHint( aspectArc( aspect ), setMetricHint( aspectArc( aspect ),
QskArcMetrics( startAngle, endAngle, width, sizeMode ) ); QskArcMetrics( width, startAngle, spanAngle, sizeMode ) );
} }
void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect, void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect,

View File

@ -223,8 +223,8 @@ class QSK_EXPORT QskSkinHintTableEditor
// arcMetrics // arcMetrics
void setArcMetrics( QskAspect, void setArcMetrics( QskAspect, qreal, int, int,
qreal, qreal, qreal, Qt::SizeMode = Qt::AbsoluteSize ); Qt::SizeMode = Qt::AbsoluteSize );
void setArcMetrics( QskAspect, void setArcMetrics( QskAspect,
const QskArcMetrics&, QskStateCombination = QskStateCombination() ); const QskArcMetrics&, QskStateCombination = QskStateCombination() );

View File

@ -344,6 +344,7 @@ QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
const auto margins = skinnable->marginHint( subControl ); const auto margins = skinnable->marginHint( subControl );
const auto arcRect = rect.marginsRemoved( margins ); const auto arcRect = rect.marginsRemoved( margins );
if ( arcRect.isEmpty() ) if ( arcRect.isEmpty() )
return nullptr; return nullptr;

View File

@ -1,13 +1,11 @@
/********************************************************************** /**********************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann * QSkinny - Copyright (C) 2021 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0 * This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/ *****************************************************************************/
#include "QskArcNode.h" #include "QskArcNode.h"
#include "QskArcRenderer.h" #include "QskArcRenderer.h"
#include <QPainter>
QskArcNode::QskArcNode() QskArcNode::QskArcNode()
{ {
} }
@ -19,11 +17,10 @@ QskArcNode::~QskArcNode()
void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics, void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics,
const QskGradient &gradient, QQuickWindow* window ) const QskGradient &gradient, QQuickWindow* window )
{ {
m_rect = rect;
m_metrics = metrics; m_metrics = metrics;
m_gradient = gradient; m_gradient = gradient;
update( window, QskTextureRenderer::AutoDetect, m_rect.toRect() ); update( window, QskTextureRenderer::AutoDetect, rect.toRect() );
} }
void QskArcNode::paint( QPainter* painter, const QSizeF &size ) void QskArcNode::paint( QPainter* painter, const QSizeF &size )

View File

@ -1,5 +1,5 @@
/********************************************************************** /**********************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann * QSkinny - Copyright (C) 2021 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0 * This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/ *****************************************************************************/
@ -23,7 +23,6 @@ class QSK_EXPORT QskArcNode : public QskPaintedNode
uint hash() const override; uint hash() const override;
private: private:
QRectF m_rect;
QskArcMetrics m_metrics; QskArcMetrics m_metrics;
QskGradient m_gradient; QskGradient m_gradient;
}; };

View File

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann * QSkinny - Copyright (C) 2021 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0 * This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/ *****************************************************************************/