support for QskIntervalF added
This commit is contained in:
parent
c4006f655b
commit
606a3e2ce2
@ -13,6 +13,7 @@
|
|||||||
#include "QskBoxShapeMetrics.h"
|
#include "QskBoxShapeMetrics.h"
|
||||||
#include "QskGradient.h"
|
#include "QskGradient.h"
|
||||||
#include "QskMargins.h"
|
#include "QskMargins.h"
|
||||||
|
#include "QskIntervalF.h"
|
||||||
|
|
||||||
#include <qcolor.h>
|
#include <qcolor.h>
|
||||||
#include <qvariant.h>
|
#include <qvariant.h>
|
||||||
@ -53,6 +54,9 @@ class QSK_EXPORT QskSkinHintTable
|
|||||||
void setBoxBorderColors( QskAspect::Aspect, const QskBoxBorderColors& );
|
void setBoxBorderColors( QskAspect::Aspect, const QskBoxBorderColors& );
|
||||||
QskBoxBorderColors boxBorderColors( QskAspect::Aspect ) const;
|
QskBoxBorderColors boxBorderColors( QskAspect::Aspect ) const;
|
||||||
|
|
||||||
|
void setInterval( QskAspect::Aspect, const QskIntervalF& );
|
||||||
|
QskIntervalF interval( QskAspect::Aspect ) const;
|
||||||
|
|
||||||
void setAnimation( QskAspect::Aspect, QskAnimationHint animation );
|
void setAnimation( QskAspect::Aspect, QskAnimationHint animation );
|
||||||
QskAnimationHint animation( QskAspect::Aspect ) const;
|
QskAnimationHint animation( QskAspect::Aspect ) const;
|
||||||
|
|
||||||
@ -223,6 +227,19 @@ inline QskBoxBorderColors QskSkinHintTable::boxBorderColors( QskAspect::Aspect a
|
|||||||
return hint( aspect | Border | Color ).value< QskBoxBorderColors >();
|
return hint( aspect | Border | Color ).value< QskBoxBorderColors >();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void QskSkinHintTable::setInterval(
|
||||||
|
QskAspect::Aspect aspect, const QskIntervalF& interval )
|
||||||
|
{
|
||||||
|
using namespace QskAspect;
|
||||||
|
setHint( aspect | Metric, QVariant::fromValue( interval ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QskIntervalF QskSkinHintTable::interval( QskAspect::Aspect aspect ) const
|
||||||
|
{
|
||||||
|
using namespace QskAspect;
|
||||||
|
return hint( aspect | Metric ).value< QskIntervalF >();
|
||||||
|
}
|
||||||
|
|
||||||
inline QskAnimationHint QskSkinHintTable::animation( QskAspect::Aspect aspect ) const
|
inline QskAnimationHint QskSkinHintTable::animation( QskAspect::Aspect aspect ) const
|
||||||
{
|
{
|
||||||
aspect.setAnimator( true );
|
aspect.setAnimator( true );
|
||||||
|
@ -291,6 +291,18 @@ QskBoxBorderColors QskSkinnable::boxBorderColorsHint(
|
|||||||
return effectiveHint( aspect | Color | Border, status ).value< QskBoxBorderColors >();
|
return effectiveHint( aspect | Color | Border, status ).value< QskBoxBorderColors >();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QskSkinnable::setIntervalHint(
|
||||||
|
QskAspect::Aspect aspect, const QskIntervalF& interval )
|
||||||
|
{
|
||||||
|
m_data->hintTable.setInterval( aspect, interval );
|
||||||
|
}
|
||||||
|
|
||||||
|
QskIntervalF QskSkinnable::intervalHint(
|
||||||
|
QskAspect::Aspect aspect, QskSkinHintStatus* status ) const
|
||||||
|
{
|
||||||
|
return effectiveHint( aspect | QskAspect::Metric, status ).value< QskIntervalF >();
|
||||||
|
}
|
||||||
|
|
||||||
void QskSkinnable::setFontRole( QskAspect::Aspect aspect, int role )
|
void QskSkinnable::setFontRole( QskAspect::Aspect aspect, int role )
|
||||||
{
|
{
|
||||||
m_data->hintTable.setFontRole( aspect, role );
|
m_data->hintTable.setFontRole( aspect, role );
|
||||||
@ -739,7 +751,7 @@ QSizeF QskSkinnable::outerBoxSize(
|
|||||||
QRectF QskSkinnable::outerBox(
|
QRectF QskSkinnable::outerBox(
|
||||||
QskAspect::Aspect aspect, const QRectF& innerBox ) const
|
QskAspect::Aspect aspect, const QRectF& innerBox ) const
|
||||||
{
|
{
|
||||||
const QMarginsF m = qskEffectivePadding( this, aspect, innerBox.size(), false );
|
const auto m = qskEffectivePadding( this, aspect, innerBox.size(), false );
|
||||||
return innerBox.marginsAdded( m );
|
return innerBox.marginsAdded( m );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -764,7 +776,7 @@ void QskSkinnable::startTransition( QskAspect::Aspect aspect,
|
|||||||
if ( animationHint.duration <= 0 || ( from == to ) )
|
if ( animationHint.duration <= 0 || ( from == to ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QskControl* control = this->owningControl();
|
auto control = this->owningControl();
|
||||||
if ( control->window() == nullptr || !isTransitionAccepted( aspect ) )
|
if ( control->window() == nullptr || !isTransitionAccepted( aspect ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ class QskBoxShapeMetrics;
|
|||||||
class QskBoxBorderMetrics;
|
class QskBoxBorderMetrics;
|
||||||
class QskBoxBorderColors;
|
class QskBoxBorderColors;
|
||||||
class QskGradient;
|
class QskGradient;
|
||||||
|
class QskIntervalF;
|
||||||
|
|
||||||
class QskSkin;
|
class QskSkin;
|
||||||
class QskSkinlet;
|
class QskSkinlet;
|
||||||
@ -94,6 +95,9 @@ class QSK_EXPORT QskSkinnable
|
|||||||
void setBoxBorderColorsHint( QskAspect::Aspect, const QskBoxBorderColors& );
|
void setBoxBorderColorsHint( QskAspect::Aspect, const QskBoxBorderColors& );
|
||||||
QskBoxBorderColors boxBorderColorsHint( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
QskBoxBorderColors boxBorderColorsHint( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
|
void setIntervalHint( QskAspect::Aspect, const QskIntervalF & );
|
||||||
|
QskIntervalF intervalHint( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
void setFlagHint( QskAspect::Aspect, int flag );
|
void setFlagHint( QskAspect::Aspect, int flag );
|
||||||
int flagHint( QskAspect::Aspect ) const;
|
int flagHint( QskAspect::Aspect ) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user