Merge branch 'uwerat-master' into material-theme

This commit is contained in:
Peter Hartmann 2022-06-13 14:40:06 +02:00
commit 3df987894e
7 changed files with 106 additions and 0 deletions

View File

@ -35,6 +35,8 @@ class QSK_EXPORT QskShadowMetrics
constexpr bool operator==( const QskShadowMetrics& ) const noexcept;
constexpr bool operator!=( const QskShadowMetrics& ) const noexcept;
bool isNull() const noexcept;
void setSpreadRadius( qreal ) noexcept;
constexpr qreal spreadRadius() const noexcept;
@ -158,6 +160,12 @@ inline constexpr QPointF QskShadowMetrics::offset() const noexcept
return m_offset;
}
inline bool QskShadowMetrics::isNull() const noexcept
{
return m_offset.isNull() &&
( m_spreadRadius == 0.0 ) && ( m_blurRadius == 0.0 );
}
#ifndef QT_NO_DEBUG_STREAM
QSK_EXPORT QDebug operator<<( QDebug, const QskShadowMetrics& );

View File

@ -520,6 +520,35 @@ QskShadowMetrics QskSkinHintTableEditor::shadowMetrics( QskAspect aspect ) const
return metricHint< QskShadowMetrics >( aspectShadow( aspect ) );
}
void QskSkinHintTableEditor::setShadowColor( QskAspect aspect,
const QColor& color, QskStateCombination combination )
{
setColorHint( aspectShadow( aspect ), color, combination );
}
void QskSkinHintTableEditor::setShadowColor( QskAspect aspect,
Qt::GlobalColor color, QskStateCombination combination )
{
setColorHint( aspectShadow( aspect ), QColor( color ), combination );
}
void QskSkinHintTableEditor::setShadowColor( QskAspect aspect,
QRgb rgb, QskStateCombination combination )
{
setColorHint( aspectShadow( aspect ), QColor::fromRgba( rgb ), combination );
}
bool QskSkinHintTableEditor::removeShadowColor(
QskAspect aspect, QskStateCombination combination )
{
return removeColorHint( aspectShadow( aspect ), combination );
}
QColor QskSkinHintTableEditor::shadowColor( QskAspect aspect ) const
{
return colorHint< QColor >( aspectShadow( aspect ) );
}
void QskSkinHintTableEditor::setArcMetrics( QskAspect aspect, qreal width,
qreal startAngle, qreal spanAngle, Qt::SizeMode sizeMode )
{

View File

@ -247,6 +247,20 @@ class QSK_EXPORT QskSkinHintTableEditor
QskShadowMetrics shadowMetrics( QskAspect ) const;
// shadowColor
void setShadowColor( QskAspect,
const QColor&, QskStateCombination = QskStateCombination() );
void setShadowColor( QskAspect,
Qt::GlobalColor, QskStateCombination = QskStateCombination() );
void setShadowColor( QskAspect,
QRgb, QskStateCombination = QskStateCombination() );
bool removeShadowColor( QskAspect, QskStateCombination = QskStateCombination() );
QColor shadowColor( QskAspect ) const;
// arcMetrics
void setArcMetrics( QskAspect, qreal, qreal, qreal, Qt::SizeMode = Qt::AbsoluteSize );

View File

@ -22,6 +22,7 @@
#include "QskBoxShapeMetrics.h"
#include "QskBoxBorderMetrics.h"
#include "QskBoxBorderColors.h"
#include "QskShadowMetrics.h"
#include "QskBoxHints.h"
#include "QskGradient.h"
@ -575,6 +576,39 @@ QskBoxBorderColors QskSkinnable::boxBorderColorsHint(
this, aspect | QskAspect::Border, status );
}
bool QskSkinnable::setShadowMetricsHint(
QskAspect aspect, const QskShadowMetrics& metrics )
{
return qskSetMetric( this, aspect | QskAspect::Shadow, metrics );
}
bool QskSkinnable::resetShadowMetricsHint( QskAspect aspect )
{
return resetMetric( aspect | QskAspect::Shadow );
}
QskShadowMetrics QskSkinnable::shadowMetricsHint(
QskAspect aspect, QskSkinHintStatus* status ) const
{
return qskMetric< QskShadowMetrics >(
this, aspect | QskAspect::Shadow, status );
}
bool QskSkinnable::setShadowColorHint( QskAspect aspect, const QColor& color )
{
return qskSetColor( this, aspect | QskAspect::Shadow, color );
}
bool QskSkinnable::resetShadowColorHint( QskAspect aspect )
{
return resetColor( aspect | QskAspect::Shadow );
}
QColor QskSkinnable::shadowColorHint( QskAspect aspect, QskSkinHintStatus* status ) const
{
return qskColor< QColor >( this, aspect | QskAspect::Shadow, status );
}
QskBoxHints QskSkinnable::boxHints( QskAspect aspect ) const
{
return QskBoxHints(

View File

@ -28,6 +28,7 @@ class QskColorFilter;
class QskBoxShapeMetrics;
class QskBoxBorderMetrics;
class QskBoxBorderColors;
class QskShadowMetrics;
class QskBoxHints;
class QskGradient;
@ -208,6 +209,14 @@ class QSK_EXPORT QskSkinnable
bool resetBoxBorderColorsHint( QskAspect );
QskBoxBorderColors boxBorderColorsHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
bool setShadowMetricsHint( QskAspect, const QskShadowMetrics& );
bool resetShadowMetricsHint( QskAspect );
QskShadowMetrics shadowMetricsHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
bool setShadowColorHint( QskAspect, const QColor& );
bool resetShadowColorHint( QskAspect );
QColor shadowColorHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
QskBoxHints boxHints( QskAspect ) const;
bool setArcMetricsHint( QskAspect, const QskArcMetrics& );

View File

@ -100,6 +100,17 @@ QSGNode* QskSGNode::findChildNode( QSGNode* parent, quint8 role )
return nullptr;
}
bool QskSGNode::removeChildNode( QSGNode* parent, quint8 role )
{
if ( auto node = findChildNode( parent, role ) )
{
qskRemoveChildNode( parent, node );
return true;
}
return false;
}
void QskSGNode::removeAllChildNodesAfter( QSGNode* parent, QSGNode* child )
{
if ( parent && child && child->parent() == parent )

View File

@ -43,6 +43,7 @@ namespace QskSGNode
}
QSK_EXPORT QSGNode* findChildNode( QSGNode* parent, quint8 role );
QSK_EXPORT bool removeChildNode( QSGNode* parent, quint8 role );
// nodeRoles: sort order
QSK_EXPORT void replaceChildNode(