moveSkinHint introduced
This commit is contained in:
parent
46707cc507
commit
17f32546fd
|
@ -77,6 +77,12 @@ static inline bool qskSetMetric( QskSkinnable* skinnable,
|
||||||
return skinnable->setSkinHint( aspect | QskAspect::Metric, metric );
|
return skinnable->setSkinHint( aspect | QskAspect::Metric, metric );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool qskMoveMetric( QskSkinnable* skinnable,
|
||||||
|
const QskAspect aspect, const QVariant& metric )
|
||||||
|
{
|
||||||
|
return skinnable->moveSkinHint( aspect | QskAspect::Metric, metric );
|
||||||
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
static inline bool qskSetMetric( QskSkinnable* skinnable,
|
static inline bool qskSetMetric( QskSkinnable* skinnable,
|
||||||
QskAspect aspect, const T& metric )
|
QskAspect aspect, const T& metric )
|
||||||
|
@ -84,6 +90,13 @@ static inline bool qskSetMetric( QskSkinnable* skinnable,
|
||||||
return qskSetMetric( skinnable, aspect, QVariant::fromValue( metric ) );
|
return qskSetMetric( skinnable, aspect, QVariant::fromValue( metric ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template< typename T >
|
||||||
|
static inline bool qskMoveMetric( QskSkinnable* skinnable,
|
||||||
|
QskAspect aspect, const T& metric )
|
||||||
|
{
|
||||||
|
return qskMoveMetric( skinnable, aspect, QVariant::fromValue( metric ) );
|
||||||
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
static inline T qskMetric( const QskSkinnable* skinnable,
|
static inline T qskMetric( const QskSkinnable* skinnable,
|
||||||
QskAspect aspect, QskSkinHintStatus* status = nullptr )
|
QskAspect aspect, QskSkinHintStatus* status = nullptr )
|
||||||
|
@ -98,6 +111,12 @@ static inline bool qskSetColor( QskSkinnable* skinnable,
|
||||||
return skinnable->setSkinHint( aspect | QskAspect::Color, color );
|
return skinnable->setSkinHint( aspect | QskAspect::Color, color );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool qskMoveColor( QskSkinnable* skinnable,
|
||||||
|
const QskAspect aspect, const QVariant& color )
|
||||||
|
{
|
||||||
|
return skinnable->moveSkinHint( aspect | QskAspect::Color, color );
|
||||||
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
static inline bool qskSetColor( QskSkinnable* skinnable,
|
static inline bool qskSetColor( QskSkinnable* skinnable,
|
||||||
const QskAspect aspect, const T& color )
|
const QskAspect aspect, const T& color )
|
||||||
|
@ -105,6 +124,13 @@ static inline bool qskSetColor( QskSkinnable* skinnable,
|
||||||
return qskSetColor( skinnable, aspect, QVariant::fromValue( color ) );
|
return qskSetColor( skinnable, aspect, QVariant::fromValue( color ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template< typename T >
|
||||||
|
static inline bool qskMoveColor( QskSkinnable* skinnable,
|
||||||
|
const QskAspect aspect, const T& color )
|
||||||
|
{
|
||||||
|
return qskMoveColor( skinnable, aspect, QVariant::fromValue( color ) );
|
||||||
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
static inline T qskColor( const QskSkinnable* skinnable,
|
static inline T qskColor( const QskSkinnable* skinnable,
|
||||||
QskAspect aspect, QskSkinHintStatus* status = nullptr )
|
QskAspect aspect, QskSkinHintStatus* status = nullptr )
|
||||||
|
@ -378,6 +404,21 @@ bool QskSkinnable::setColor( const QskAspect aspect, QRgb rgb )
|
||||||
return qskSetColor( this, aspect, QColor::fromRgba( rgb ) );
|
return qskSetColor( this, aspect, QColor::fromRgba( rgb ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::moveColor( const QskAspect aspect, const QColor& color )
|
||||||
|
{
|
||||||
|
return qskMoveColor( this, aspect, color );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::moveColor( const QskAspect aspect, Qt::GlobalColor color )
|
||||||
|
{
|
||||||
|
return qskMoveColor( this, aspect, QColor( color ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::moveColor( const QskAspect aspect, QRgb rgb )
|
||||||
|
{
|
||||||
|
return qskMoveColor( this, aspect, QColor::fromRgba( rgb ) );
|
||||||
|
}
|
||||||
|
|
||||||
QColor QskSkinnable::color( const QskAspect aspect, QskSkinHintStatus* status ) const
|
QColor QskSkinnable::color( const QskAspect aspect, QskSkinHintStatus* status ) const
|
||||||
{
|
{
|
||||||
return qskColor< QColor >( this, aspect, status );
|
return qskColor< QColor >( this, aspect, status );
|
||||||
|
@ -388,11 +429,36 @@ bool QskSkinnable::setMetric( const QskAspect aspect, qreal metric )
|
||||||
return qskSetMetric( this, aspect, metric );
|
return qskSetMetric( this, aspect, metric );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::moveMetric( QskAspect aspect, qreal metric )
|
||||||
|
{
|
||||||
|
return qskMoveMetric( this, aspect, metric );
|
||||||
|
}
|
||||||
|
|
||||||
qreal QskSkinnable::metric( const QskAspect aspect, QskSkinHintStatus* status ) const
|
qreal QskSkinnable::metric( const QskAspect aspect, QskSkinHintStatus* status ) const
|
||||||
{
|
{
|
||||||
return qskMetric< qreal >( this, aspect, status );
|
return qskMetric< qreal >( this, aspect, status );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::setPositionHint( QskAspect aspect, qreal position )
|
||||||
|
{
|
||||||
|
return qskSetMetric( this, aspect | QskAspect::Position, position );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::movePositionHint( QskAspect aspect, qreal position )
|
||||||
|
{
|
||||||
|
return qskMoveMetric( this, aspect | QskAspect::Position, position );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::resetPositionHint( QskAspect aspect )
|
||||||
|
{
|
||||||
|
return resetMetric( aspect | QskAspect::Position );
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal QskSkinnable::positionHint( QskAspect aspect, QskSkinHintStatus* status ) const
|
||||||
|
{
|
||||||
|
return qskMetric< qreal >( this, aspect | QskAspect::Position, status );
|
||||||
|
}
|
||||||
|
|
||||||
bool QskSkinnable::setStrutSizeHint(
|
bool QskSkinnable::setStrutSizeHint(
|
||||||
const QskAspect aspect, qreal width, qreal height )
|
const QskAspect aspect, qreal width, qreal height )
|
||||||
{
|
{
|
||||||
|
@ -658,6 +724,11 @@ QskAnimationHint QskSkinnable::animationHint(
|
||||||
return effectiveSkinHint( aspect, status ).value< QskAnimationHint >();
|
return effectiveSkinHint( aspect, status ).value< QskAnimationHint >();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::hasAnimationHint( QskAspect aspect ) const
|
||||||
|
{
|
||||||
|
return animationHint( aspect ).isValid();
|
||||||
|
}
|
||||||
|
|
||||||
QskAnimationHint QskSkinnable::effectiveAnimation(
|
QskAnimationHint QskSkinnable::effectiveAnimation(
|
||||||
QskAspect::Type type, QskAspect::Subcontrol subControl,
|
QskAspect::Type type, QskAspect::Subcontrol subControl,
|
||||||
QskAspect::States states, QskSkinHintStatus* status ) const
|
QskAspect::States states, QskSkinHintStatus* status ) const
|
||||||
|
@ -761,6 +832,31 @@ QskSkinHintStatus QskSkinnable::hintStatus( QskAspect aspect ) const
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::moveSkinHint( QskAspect aspect,
|
||||||
|
const QVariant& oldValue, const QVariant& newValue )
|
||||||
|
{
|
||||||
|
if ( aspect.isAnimator() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const bool ok = setSkinHint( aspect, newValue );
|
||||||
|
|
||||||
|
if ( ok && oldValue.isValid() && newValue.isValid() )
|
||||||
|
{
|
||||||
|
const auto animation = animationHint( aspect.subControl() | aspect.type() );
|
||||||
|
if ( animation.isValid() )
|
||||||
|
{
|
||||||
|
if ( newValue != oldValue )
|
||||||
|
startTransition( aspect, animation, oldValue, newValue );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::moveSkinHint( QskAspect aspect, const QVariant& value )
|
||||||
|
{
|
||||||
|
return moveSkinHint( aspect, effectiveSkinHint( aspect ), value );
|
||||||
|
}
|
||||||
|
|
||||||
QVariant QskSkinnable::animatedValue(
|
QVariant QskSkinnable::animatedValue(
|
||||||
QskAspect aspect, QskSkinHintStatus* status ) const
|
QskAspect aspect, QskSkinHintStatus* status ) const
|
||||||
|
|
|
@ -87,10 +87,14 @@ class QSK_EXPORT QskSkinnable
|
||||||
|
|
||||||
bool setAnimationHint( QskAspect, QskAnimationHint );
|
bool setAnimationHint( QskAspect, QskAnimationHint );
|
||||||
QskAnimationHint animationHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
QskAnimationHint animationHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
bool hasAnimationHint( QskAspect ) const;
|
||||||
|
|
||||||
bool setSkinHint( QskAspect, const QVariant& );
|
bool setSkinHint( QskAspect, const QVariant& );
|
||||||
bool resetSkinHint( QskAspect );
|
bool resetSkinHint( QskAspect );
|
||||||
|
|
||||||
|
bool moveSkinHint( QskAspect, const QVariant& );
|
||||||
|
bool moveSkinHint( QskAspect, const QVariant&, const QVariant& );
|
||||||
|
|
||||||
QskAnimationHint effectiveAnimation( QskAspect::Type, QskAspect::Subcontrol,
|
QskAnimationHint effectiveAnimation( QskAspect::Type, QskAspect::Subcontrol,
|
||||||
QskAspect::States, QskSkinHintStatus* status = nullptr ) const;
|
QskAspect::States, QskSkinHintStatus* status = nullptr ) const;
|
||||||
|
|
||||||
|
@ -148,10 +152,16 @@ class QSK_EXPORT QskSkinnable
|
||||||
bool setColor( QskAspect, Qt::GlobalColor );
|
bool setColor( QskAspect, Qt::GlobalColor );
|
||||||
bool setColor( QskAspect, QRgb );
|
bool setColor( QskAspect, QRgb );
|
||||||
bool setColor( QskAspect, const QColor& );
|
bool setColor( QskAspect, const QColor& );
|
||||||
|
|
||||||
|
bool moveColor( QskAspect, Qt::GlobalColor );
|
||||||
|
bool moveColor( QskAspect, QRgb );
|
||||||
|
bool moveColor( QskAspect, const QColor& );
|
||||||
|
|
||||||
bool resetColor( QskAspect );
|
bool resetColor( QskAspect );
|
||||||
QColor color( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
QColor color( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
bool setMetric( QskAspect, qreal );
|
bool setMetric( QskAspect, qreal );
|
||||||
|
bool moveMetric( QskAspect, qreal );
|
||||||
bool resetMetric( QskAspect );
|
bool resetMetric( QskAspect );
|
||||||
qreal metric( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
qreal metric( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
|
@ -160,6 +170,11 @@ class QSK_EXPORT QskSkinnable
|
||||||
int flagHint( QskAspect ) const;
|
int flagHint( QskAspect ) const;
|
||||||
template< typename T > T flagHint( QskAspect, T = T() ) const;
|
template< typename T > T flagHint( QskAspect, T = T() ) const;
|
||||||
|
|
||||||
|
bool setPositionHint( QskAspect, qreal );
|
||||||
|
bool movePositionHint( QskAspect, qreal );
|
||||||
|
bool resetPositionHint( QskAspect );
|
||||||
|
qreal positionHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
bool setStrutSizeHint( QskAspect, const QSizeF& );
|
bool setStrutSizeHint( QskAspect, const QSizeF& );
|
||||||
bool setStrutSizeHint( QskAspect, qreal width, qreal height );
|
bool setStrutSizeHint( QskAspect, qreal width, qreal height );
|
||||||
bool resetStrutSizeHint( QskAspect );
|
bool resetStrutSizeHint( QskAspect );
|
||||||
|
|
Loading…
Reference in New Issue