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 "CircularProgressBar.h"
#include <QskArcNode.h>
#include <QskPaintedNode.h>
#include <QEasingCurve>
@ -42,7 +41,6 @@ QSGNode* CircularProgressBarSkinlet::updateSubNode(
}
case BarRole:
{
const auto subControl = CircularProgressBar::Bar;
return updateArcNode( skinnable, node, CircularProgressBar::Bar,
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
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.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
*****************************************************************************/
@ -110,8 +110,8 @@ QDebug operator<<( QDebug debug, const QskArcMetrics& metrics )
debug << "Arc" << '(';
debug << "width:" << metrics.width();
debug << "start angle:" << metrics.startAngle();
debug << "span angle:" << metrics.spanAngle();
debug << ", start angle:" << metrics.startAngle();
debug << ", span angle:" << metrics.spanAngle();
debug << ", size mode:" << metrics.sizeMode();
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
*****************************************************************************/

View File

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

View File

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

View File

@ -344,6 +344,7 @@ QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
const auto margins = skinnable->marginHint( subControl );
const auto arcRect = rect.marginsRemoved( margins );
if ( arcRect.isEmpty() )
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
*****************************************************************************/
#include "QskArcNode.h"
#include "QskArcRenderer.h"
#include <QPainter>
QskArcNode::QskArcNode()
{
}
@ -19,11 +17,10 @@ QskArcNode::~QskArcNode()
void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics,
const QskGradient &gradient, QQuickWindow* window )
{
m_rect = rect;
m_metrics = metrics;
m_gradient = gradient;
update( window, QskTextureRenderer::AutoDetect, m_rect.toRect() );
update( window, QskTextureRenderer::AutoDetect, rect.toRect() );
}
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
*****************************************************************************/
@ -23,7 +23,6 @@ class QSK_EXPORT QskArcNode : public QskPaintedNode
uint hash() const override;
private:
QRectF m_rect;
QskArcMetrics m_metrics;
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
*****************************************************************************/