incorporate Uwe's changes
This commit is contained in:
parent
deb5df8edb
commit
a83df8c6f7
|
|
@ -30,19 +30,15 @@ QRectF CircularProgressBarSkinlet::subControlRect(
|
||||||
QSGNode* CircularProgressBarSkinlet::updateSubNode(
|
QSGNode* CircularProgressBarSkinlet::updateSubNode(
|
||||||
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
||||||
{
|
{
|
||||||
const auto bar = static_cast< const CircularProgressBar* >( skinnable );
|
|
||||||
|
|
||||||
switch( nodeRole )
|
switch( nodeRole )
|
||||||
{
|
{
|
||||||
case GrooveRole:
|
case GrooveRole:
|
||||||
{
|
{
|
||||||
return updateArcNode( skinnable, node, CircularProgressBar::Groove,
|
return updateArcNode( skinnable, node, CircularProgressBar::Groove );
|
||||||
bar->window() );
|
|
||||||
}
|
}
|
||||||
case BarRole:
|
case BarRole:
|
||||||
{
|
{
|
||||||
return updateArcNode( skinnable, node, CircularProgressBar::Bar,
|
return updateArcNode( skinnable, node, CircularProgressBar::Bar );
|
||||||
bar->window() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,10 +109,10 @@ void Skin::initHints( const Palette& palette )
|
||||||
ed.setColor( TopBarItem::Item4 | QskAspect::TextColor, "#6776ff" );
|
ed.setColor( TopBarItem::Item4 | QskAspect::TextColor, "#6776ff" );
|
||||||
|
|
||||||
// conical gradients are counterclockwise, so specify the 2nd color first:
|
// conical gradients are counterclockwise, so specify the 2nd color first:
|
||||||
ed.setGradient( TopBarItem::Item1, { QskGradient::Conical, "#FF3122", "#FF5C00" } );
|
ed.setGradient( TopBarItem::Item1, { QskGradient::Horizontal, "#FF3122", "#FF5C00" } );
|
||||||
ed.setGradient( TopBarItem::Item2, { QskGradient::Conical, "#6100FF", "#6776FF" } );
|
ed.setGradient( TopBarItem::Item2, { QskGradient::Horizontal, "#6100FF", "#6776FF" } );
|
||||||
ed.setGradient( TopBarItem::Item3, { QskGradient::Conical, "#FF3122", "#FFCE50" } );
|
ed.setGradient( TopBarItem::Item3, { QskGradient::Horizontal, "#FF3122", "#FFCE50" } );
|
||||||
ed.setGradient( TopBarItem::Item4, { QskGradient::Conical, "#6100FF", "#6776FF" } );
|
ed.setGradient( TopBarItem::Item4, { QskGradient::Horizontal, "#6100FF", "#6776FF" } );
|
||||||
|
|
||||||
// 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 } );
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class DaytimeSkin : public Skin
|
||||||
: Skin(
|
: Skin(
|
||||||
Skin::Palette( {"#6D7BFB"}, {"#fbfbfb"}, {"#ffffff"},
|
Skin::Palette( {"#6D7BFB"}, {"#fbfbfb"}, {"#ffffff"},
|
||||||
"#ffffff", {"#f7f7f7"}, {"#f4f4f4"}, Qt::black, Qt::black,
|
"#ffffff", {"#f7f7f7"}, {"#f4f4f4"}, Qt::black, Qt::black,
|
||||||
{ QskGradient::Radial, { { 0.0, 0xc4c4c4 }, { 0.5, 0xf8f8f8 }, { 1.0, 0xc4c4c4 } } } )
|
{ QskGradient::Vertical, { { 0.0, 0xc4c4c4 }, { 0.5, 0xf8f8f8 }, { 1.0, 0xc4c4c4 } } } )
|
||||||
, parent )
|
, parent )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -73,7 +73,7 @@ class NighttimeSkin : public Skin
|
||||||
: Skin(
|
: Skin(
|
||||||
Skin::Palette( {"#2937A7"}, {"#040404"}, {"#000000"},
|
Skin::Palette( {"#2937A7"}, {"#040404"}, {"#000000"},
|
||||||
"#000000", {"#0a0a0a"}, {"#0c0c0c"}, Qt::white, Qt::white,
|
"#000000", {"#0a0a0a"}, {"#0c0c0c"}, Qt::white, Qt::white,
|
||||||
{ QskGradient::Radial, { { 0.0, 0x666666 }, { 0.5, 0x222222 }, { 1.0, 0x333333 } } } )
|
{ QskGradient::Vertical, { { 0.0, 0x666666 }, { 0.5, 0x222222 }, { 1.0, 0x333333 } } } )
|
||||||
, parent )
|
, parent )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,7 @@ class QSK_EXPORT QskAspect
|
||||||
|
|
||||||
Shadow,
|
Shadow,
|
||||||
Shape,
|
Shape,
|
||||||
Border,
|
Border
|
||||||
Arc
|
|
||||||
};
|
};
|
||||||
Q_ENUM( Primitive )
|
Q_ENUM( Primitive )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,7 @@ class QSK_EXPORT QskGradient
|
||||||
{
|
{
|
||||||
Horizontal,
|
Horizontal,
|
||||||
Vertical,
|
Vertical,
|
||||||
Diagonal,
|
Diagonal
|
||||||
Radial,
|
|
||||||
Conical
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_ENUM( Orientation )
|
Q_ENUM( Orientation )
|
||||||
|
|
|
||||||
|
|
@ -109,11 +109,6 @@ namespace
|
||||||
{
|
{
|
||||||
return aspect | QskAspect::Border;
|
return aspect | QskAspect::Border;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QskAspect aspectArc( QskAspect aspect )
|
|
||||||
{
|
|
||||||
return aspect | QskAspect::Arc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QskSkinHintTableEditor::QskSkinHintTableEditor( QskSkinHintTable* table )
|
QskSkinHintTableEditor::QskSkinHintTableEditor( QskSkinHintTable* table )
|
||||||
|
|
@ -477,23 +472,23 @@ QskBoxBorderColors QskSkinHintTableEditor::boxBorderColors( QskAspect aspect ) c
|
||||||
void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect, qreal width,
|
void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect, qreal width,
|
||||||
int startAngle, int spanAngle, Qt::SizeMode sizeMode )
|
int startAngle, int spanAngle, Qt::SizeMode sizeMode )
|
||||||
{
|
{
|
||||||
setMetricHint( aspectArc( aspect ),
|
setMetricHint( aspectShape( aspect ),
|
||||||
QskArcMetrics( width, startAngle, spanAngle, sizeMode ) );
|
QskArcMetrics( width, startAngle, spanAngle, sizeMode ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect,
|
void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect,
|
||||||
const QskArcMetrics& arcMetrics, QskStateCombination combination )
|
const QskArcMetrics& arcMetrics, QskStateCombination combination )
|
||||||
{
|
{
|
||||||
setMetricHint( aspectArc( aspect ), arcMetrics, combination );
|
setMetricHint( aspectShape( aspect ), arcMetrics, combination );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::removeArcMetrics( QskAspect aspect,
|
void QskSkinHintTableEditor::removeArcMetrics( QskAspect aspect,
|
||||||
QskStateCombination combination )
|
QskStateCombination combination )
|
||||||
{
|
{
|
||||||
return removeMetricHint( aspectArc( aspect ), combination );
|
return removeMetricHint( aspectShape( aspect ), combination );
|
||||||
}
|
}
|
||||||
|
|
||||||
QskArcMetrics QskSkinHintTableEditor::arcMetrics( QskAspect aspect ) const
|
QskArcMetrics QskSkinHintTableEditor::arcMetrics( QskAspect aspect ) const
|
||||||
{
|
{
|
||||||
return metricHint< QskArcMetrics >( aspectArc( aspect ) );
|
return metricHint< QskArcMetrics >( aspectShape( aspect ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -321,26 +321,27 @@ QSGNode* QskSkinlet::updateBoxNode( const QskSkinnable* skinnable,
|
||||||
}
|
}
|
||||||
|
|
||||||
QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
|
QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
|
||||||
QSGNode* node, QskAspect::Subcontrol subControl,
|
QSGNode* node, QskAspect::Subcontrol subControl ) const
|
||||||
QQuickWindow* window ) const
|
|
||||||
{
|
{
|
||||||
const auto rect = qskSubControlRect( this, skinnable, subControl );
|
const auto rect = qskSubControlRect( this, skinnable, subControl );
|
||||||
return updateArcNode( skinnable, node, rect, subControl, window );
|
return updateArcNode( skinnable, node, rect, subControl );
|
||||||
}
|
}
|
||||||
|
|
||||||
QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
|
QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
|
||||||
QSGNode* node, const QRectF& rect, QskAspect::Subcontrol subControl,
|
QSGNode* node, const QRectF& rect, QskAspect::Subcontrol subControl )
|
||||||
QQuickWindow* window )
|
|
||||||
{
|
{
|
||||||
const auto fillGradient = skinnable->gradientHint( subControl );
|
const auto fillGradient = skinnable->gradientHint( subControl );
|
||||||
return updateArcNode( skinnable, node, rect, fillGradient, subControl,
|
return updateArcNode( skinnable, node, rect, fillGradient, subControl );
|
||||||
window );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
|
QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
|
||||||
QSGNode* node, const QRectF& rect, const QskGradient& fillGradient,
|
QSGNode* node, const QRectF& rect, const QskGradient& fillGradient,
|
||||||
QskAspect::Subcontrol subControl, QQuickWindow* window )
|
QskAspect::Subcontrol subControl )
|
||||||
{
|
{
|
||||||
|
const auto control = skinnable->owningControl();
|
||||||
|
if ( control == nullptr )
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
const auto margins = skinnable->marginHint( subControl );
|
const auto margins = skinnable->marginHint( subControl );
|
||||||
|
|
||||||
const auto arcRect = rect.marginsRemoved( margins );
|
const auto arcRect = rect.marginsRemoved( margins );
|
||||||
|
|
@ -359,7 +360,7 @@ QSGNode* QskSkinlet::updateArcNode( const QskSkinnable* skinnable,
|
||||||
if ( arcNode == nullptr )
|
if ( arcNode == nullptr )
|
||||||
arcNode = new QskArcNode();
|
arcNode = new QskArcNode();
|
||||||
|
|
||||||
arcNode->setArcData( rect, arcMetrics, fillGradient, window );
|
arcNode->setArcData( rect, arcMetrics, fillGradient, control->window() );
|
||||||
|
|
||||||
return arcNode;
|
return arcNode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ class QskGraphic;
|
||||||
class QskTextOptions;
|
class QskTextOptions;
|
||||||
|
|
||||||
class QSGNode;
|
class QSGNode;
|
||||||
class QQuickWindow;
|
|
||||||
|
|
||||||
class QSK_EXPORT QskSkinlet
|
class QSK_EXPORT QskSkinlet
|
||||||
{
|
{
|
||||||
|
|
@ -54,11 +53,10 @@ class QSK_EXPORT QskSkinlet
|
||||||
const QRectF&, const QskGradient&, QskAspect::Subcontrol );
|
const QRectF&, const QskGradient&, QskAspect::Subcontrol );
|
||||||
|
|
||||||
static QSGNode* updateArcNode( const QskSkinnable*, QSGNode*,
|
static QSGNode* updateArcNode( const QskSkinnable*, QSGNode*,
|
||||||
const QRectF&, QskAspect::Subcontrol, QQuickWindow* );
|
const QRectF&, QskAspect::Subcontrol );
|
||||||
|
|
||||||
static QSGNode* updateArcNode( const QskSkinnable*, QSGNode*,
|
static QSGNode* updateArcNode( const QskSkinnable*, QSGNode*,
|
||||||
const QRectF&, const QskGradient&, QskAspect::Subcontrol,
|
const QRectF&, const QskGradient&, QskAspect::Subcontrol );
|
||||||
QQuickWindow* );
|
|
||||||
|
|
||||||
static QSGNode* updateTextNode( const QskSkinnable*, QSGNode*,
|
static QSGNode* updateTextNode( const QskSkinnable*, QSGNode*,
|
||||||
const QRectF&, Qt::Alignment, const QString&, const QskTextOptions&,
|
const QRectF&, Qt::Alignment, const QString&, const QskTextOptions&,
|
||||||
|
|
@ -94,7 +92,7 @@ class QSK_EXPORT QskSkinlet
|
||||||
QskAspect::Subcontrol ) const;
|
QskAspect::Subcontrol ) const;
|
||||||
|
|
||||||
QSGNode* updateArcNode( const QskSkinnable*, QSGNode*,
|
QSGNode* updateArcNode( const QskSkinnable*, QSGNode*,
|
||||||
QskAspect::Subcontrol, QQuickWindow* ) const;
|
QskAspect::Subcontrol ) const;
|
||||||
|
|
||||||
QSGNode* updateBoxClipNode( const QskSkinnable*, QSGNode*,
|
QSGNode* updateBoxClipNode( const QskSkinnable*, QSGNode*,
|
||||||
QskAspect::Subcontrol ) const;
|
QskAspect::Subcontrol ) const;
|
||||||
|
|
|
||||||
|
|
@ -525,19 +525,19 @@ QskBoxBorderColors QskSkinnable::boxBorderColorsHint(
|
||||||
bool QskSkinnable::setArcMetricsHint(
|
bool QskSkinnable::setArcMetricsHint(
|
||||||
const QskAspect aspect, const QskArcMetrics& arc )
|
const QskAspect aspect, const QskArcMetrics& arc )
|
||||||
{
|
{
|
||||||
return qskSetMetric( this, aspect | QskAspect::Arc, arc );
|
return qskSetMetric( this, aspect | QskAspect::Shape, arc );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QskSkinnable::resetArcMetricsHint( const QskAspect aspect )
|
bool QskSkinnable::resetArcMetricsHint( const QskAspect aspect )
|
||||||
{
|
{
|
||||||
return resetMetric( aspect | QskAspect::Arc );
|
return resetMetric( aspect | QskAspect::Shape );
|
||||||
}
|
}
|
||||||
|
|
||||||
QskArcMetrics QskSkinnable::arcMetricsHint(
|
QskArcMetrics QskSkinnable::arcMetricsHint(
|
||||||
const QskAspect aspect, QskSkinHintStatus* status ) const
|
const QskAspect aspect, QskSkinHintStatus* status ) const
|
||||||
{
|
{
|
||||||
return qskMetric< QskArcMetrics >(
|
return qskMetric< QskArcMetrics >(
|
||||||
this, aspect | QskAspect::Arc, status );
|
this, aspect | QskAspect::Shape, status );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QskSkinnable::setSpacingHint( const QskAspect aspect, qreal spacing )
|
bool QskSkinnable::setSpacingHint( const QskAspect aspect, qreal spacing )
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* QSkinny - Copyright (C) 2021 Uwe Rathmann
|
* QSkinny - Copyright (C) 2016 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
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
|
@ -36,10 +36,8 @@ uint QskArcNode::hash() const
|
||||||
{
|
{
|
||||||
uint h = m_metrics.hash();
|
uint h = m_metrics.hash();
|
||||||
|
|
||||||
for( const QskGradientStop& stop : m_gradient.stops() )
|
for( const auto& stop : m_gradient.stops() )
|
||||||
{
|
|
||||||
h = stop.hash( h );
|
h = stop.hash( h );
|
||||||
}
|
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* QSkinny - Copyright (C) 2021 Uwe Rathmann
|
* QSkinny - Copyright (C) 2016 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
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
/******************************************************************************
|
||||||
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||||
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include "QskArcRenderer.h"
|
||||||
|
#include "QskArcMetrics.h"
|
||||||
|
#include "QskGradient.h"
|
||||||
|
|
||||||
|
#include <qpainter.h>
|
||||||
|
#include <qrect.h>
|
||||||
|
|
||||||
|
void QskArcRenderer::renderArc(const QRectF& rect,
|
||||||
|
const QskArcMetrics& metrics, const QskGradient& gradient,
|
||||||
|
QPainter* painter )
|
||||||
|
{
|
||||||
|
painter->setRenderHint( QPainter::Antialiasing, true );
|
||||||
|
|
||||||
|
QGradientStops stops;
|
||||||
|
|
||||||
|
for( const QskGradientStop& stop : gradient.stops() )
|
||||||
|
{
|
||||||
|
QGradientStop s( stop.position(), stop.color() );
|
||||||
|
stops.append( s );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
horizontal is interpreted as in direction of the arc,
|
||||||
|
while vertical means from the inner to the outer border
|
||||||
|
*/
|
||||||
|
|
||||||
|
QBrush brush;
|
||||||
|
|
||||||
|
if( gradient.orientation() == QskGradient::Vertical )
|
||||||
|
{
|
||||||
|
QRadialGradient gradient( rect.center(), qMin( rect.width(), rect.height() ) );
|
||||||
|
gradient.setStops( stops );
|
||||||
|
|
||||||
|
brush = gradient;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QConicalGradient gradient( rect.center(), metrics.startAngle() / 16.0 );
|
||||||
|
gradient.setStops( stops );
|
||||||
|
|
||||||
|
brush = gradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
painter->setPen( QPen( brush, metrics.width(), Qt::SolidLine, Qt::FlatCap ) );
|
||||||
|
painter->drawArc( rect, metrics.startAngle(), metrics.spanAngle() );
|
||||||
|
}
|
||||||
|
|
@ -1,73 +1,24 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* QSkinny - Copyright (C) 2021 Uwe Rathmann
|
* QSkinny - Copyright (C) 2016 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
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef QSK_ARC_RENDERER_H
|
#ifndef QSK_ARC_RENDERER_H
|
||||||
#define QSK_ARC_RENDERER_H
|
#define QSK_ARC_RENDERER_H
|
||||||
|
|
||||||
#include "QskArcMetrics.h"
|
|
||||||
#include "QskGlobal.h"
|
#include "QskGlobal.h"
|
||||||
#include "QskGradient.h"
|
|
||||||
|
|
||||||
#include <QDebug>
|
class QskArcMetrics;
|
||||||
#include <QPainter>
|
class QskGradient;
|
||||||
#include <QRect>
|
|
||||||
|
class QPainter;
|
||||||
|
class QRectF;
|
||||||
|
|
||||||
class QSK_EXPORT QskArcRenderer
|
class QSK_EXPORT QskArcRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void renderArc( const QRectF& rect, const QskArcMetrics& metrics,
|
void renderArc( const QRectF&, const QskArcMetrics&,
|
||||||
const QskGradient& gradient, QPainter* );
|
const QskGradient&, QPainter* );
|
||||||
};
|
};
|
||||||
|
|
||||||
void QskArcRenderer::renderArc(const QRectF& rect,
|
|
||||||
const QskArcMetrics& metrics, const QskGradient& gradient,
|
|
||||||
QPainter* painter )
|
|
||||||
{
|
|
||||||
painter->setRenderHint( QPainter::Antialiasing, true );
|
|
||||||
|
|
||||||
QGradientStops stops;
|
|
||||||
|
|
||||||
for( const QskGradientStop& stop : gradient.stops() )
|
|
||||||
{
|
|
||||||
QGradientStop s( stop.position(), stop.color() );
|
|
||||||
stops.append( s );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( gradient.orientation() == QskGradient::Horizontal
|
|
||||||
|| gradient.orientation() == QskGradient::Vertical )
|
|
||||||
{
|
|
||||||
QPointF finalStop = ( gradient.orientation() == QskGradient::Horizontal )
|
|
||||||
? QPointF( rect.width(), 0 ) : QPointF( 0, rect.height() );
|
|
||||||
|
|
||||||
QLinearGradient linearGradient( { 0, 0 }, finalStop );
|
|
||||||
linearGradient.setStops( stops );
|
|
||||||
painter->setPen( QPen( linearGradient, metrics.width(), Qt::SolidLine,
|
|
||||||
Qt::FlatCap ) );
|
|
||||||
}
|
|
||||||
else if( gradient.orientation() == QskGradient::Diagonal )
|
|
||||||
{
|
|
||||||
qWarning() << "cannot paint a diagonal gradient with QPainter";
|
|
||||||
}
|
|
||||||
else if( gradient.orientation() == QskGradient::Radial )
|
|
||||||
{
|
|
||||||
QRadialGradient radialGradient( rect.center(), qMin( rect.width(),
|
|
||||||
rect.height() ) );
|
|
||||||
radialGradient.setStops( stops );
|
|
||||||
painter->setPen( QPen( radialGradient, metrics.width(), Qt::SolidLine,
|
|
||||||
Qt::FlatCap ) );
|
|
||||||
}
|
|
||||||
else if( gradient.orientation() == QskGradient::Conical )
|
|
||||||
{
|
|
||||||
QConicalGradient conicalGradient( rect.center(),
|
|
||||||
metrics.startAngle() / 16.0 );
|
|
||||||
conicalGradient.setStops( stops );
|
|
||||||
painter->setPen( QPen( conicalGradient, metrics.width(), Qt::SolidLine,
|
|
||||||
Qt::FlatCap ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
painter->drawArc( rect, metrics.startAngle(), metrics.spanAngle() );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
#include "QskBoxRendererColorMap.h"
|
#include "QskBoxRendererColorMap.h"
|
||||||
#include "QskBoxShapeMetrics.h"
|
#include "QskBoxShapeMetrics.h"
|
||||||
|
|
||||||
#include <qdebug.h>
|
|
||||||
#include <qmath.h>
|
#include <qmath.h>
|
||||||
#include <qsggeometry.h>
|
#include <qsggeometry.h>
|
||||||
|
|
||||||
|
|
@ -774,13 +773,6 @@ static inline int qskFillLineCount(
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QskGradient::Radial: // fall through
|
|
||||||
case QskGradient::Conical:
|
|
||||||
{
|
|
||||||
qWarning() << "radial and conical gradients are only supported"
|
|
||||||
<< "when rendering arcs";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// adding vertexes for the stops - beside the first/last
|
// adding vertexes for the stops - beside the first/last
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@
|
||||||
#include "QskGradient.h"
|
#include "QskGradient.h"
|
||||||
#include "QskVertex.h"
|
#include "QskVertex.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
using namespace QskVertex;
|
using namespace QskVertex;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
|
@ -378,13 +376,6 @@ static inline void qskCreateFillOrdered( const QskBoxRenderer::Quad& rect,
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QskGradient::Radial: // fall through
|
|
||||||
case QskGradient::Conical:
|
|
||||||
{
|
|
||||||
qWarning() << "radial and conical gradients are only supported"
|
|
||||||
<< "when rendering arcs";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ HEADERS += \
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
nodes/QskArcNode.cpp \
|
nodes/QskArcNode.cpp \
|
||||||
|
nodes/QskArcRenderer.cpp \
|
||||||
nodes/QskBoxNode.cpp \
|
nodes/QskBoxNode.cpp \
|
||||||
nodes/QskBoxClipNode.cpp \
|
nodes/QskBoxClipNode.cpp \
|
||||||
nodes/QskBoxRendererRect.cpp \
|
nodes/QskBoxRendererRect.cpp \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue