QskAspect::Flag replaced by QskAspect::NoType. Flag was a leftover from
the very early stages of this project and its semantics had become wrong in the meantime
This commit is contained in:
parent
99eb5c3695
commit
a32204cd8c
@ -117,7 +117,7 @@ class MySkinEditor : public QskSkinHintTableEditor
|
||||
setGraphicRole( subControl, role1 );
|
||||
setGraphicRole( subControl | Q::Checked, role2 );
|
||||
|
||||
setAnimation( subControl | A::Flag, animator() );
|
||||
setAnimation( subControl, animator() );
|
||||
}
|
||||
|
||||
setGradient( Q::Panel, baseColor );
|
||||
|
@ -350,7 +350,7 @@ void Editor::setupPopup()
|
||||
using A = QskAspect;
|
||||
using Q = QskPopup;
|
||||
|
||||
setFlagHint( Q::Overlay | A::Style, true );
|
||||
setHint( Q::Overlay | A::Style, true );
|
||||
setGradient( Q::Overlay, stateLayerColor( m_pal.outline, 0.8 ) );
|
||||
}
|
||||
|
||||
@ -359,7 +359,7 @@ void Editor::setupMenu()
|
||||
using A = QskAspect;
|
||||
using Q = QskMenu;
|
||||
|
||||
setFlagHint( Q::Overlay | A::Style, false );
|
||||
setHint( Q::Overlay | A::Style, false );
|
||||
setGradient( Q::Overlay, stateLayerColor( m_pal.outline, 0.8 ) );
|
||||
|
||||
setBoxShape( Q::Panel, 4_dp );
|
||||
@ -651,7 +651,7 @@ void Editor::setupPushButton()
|
||||
using Q = QskPushButton;
|
||||
using M3 = QskMaterial3Skin;
|
||||
|
||||
setFlagHint( Q::Panel | QskAspect::Direction, Qsk::LeftToRight );
|
||||
setHint( Q::Panel | QskAspect::Direction, Qsk::LeftToRight );
|
||||
setStrutSize( Q::Panel, -1, 40_dp );
|
||||
setSpacing( Q::Panel, 8_dp );
|
||||
setPadding( Q::Panel, { 24_dp, 0, 24_dp, 0 } );
|
||||
@ -873,7 +873,7 @@ void Editor::setupSpinBox()
|
||||
{
|
||||
using Q = QskSpinBox;
|
||||
|
||||
setFlagHint( Q::Panel | QskAspect::Style, Q::Buttons );
|
||||
setHint( Q::Panel | QskAspect::Style, Q::Buttons );
|
||||
setSpacing( Q::Panel, 4_dp );
|
||||
|
||||
setStrutSize( Q::TextPanel, 80_dp, 40_dp );
|
||||
@ -1083,7 +1083,7 @@ void Editor::setupTabBar()
|
||||
setGradient( Q::Panel, m_pal.secondaryContainer );
|
||||
setPadding( Q::Panel, 0 );
|
||||
|
||||
setFlagHint( Q::Panel | A::Style, Qt::BottomEdge );
|
||||
setHint( Q::Panel | A::Style, Qt::BottomEdge );
|
||||
|
||||
// when flicking
|
||||
setAnimation( Q::Panel | A::Metric, QskAnimationHint( 200, QEasingCurve::InCubic ) );
|
||||
@ -1195,7 +1195,7 @@ void Editor::setupSubWindow()
|
||||
// TitleBarPanel
|
||||
setBoxShape( Q::TitleBarPanel, { 28_dp, 28_dp, 0, 0 } );
|
||||
setPadding( Q::TitleBarPanel, { 24_dp, 24_dp, 24_dp, 16_dp } );
|
||||
setFlagHint( Q::TitleBarPanel | QskAspect::Style,
|
||||
setHint( Q::TitleBarPanel | QskAspect::Style,
|
||||
Q::TitleBar | Q::Title | Q::Symbol );
|
||||
|
||||
setGradient( Q::TitleBarPanel, m_pal.secondaryContainer );
|
||||
|
@ -328,7 +328,7 @@ void Editor::setupCheckBox()
|
||||
|
||||
setTextOptions( Q::Text, Qt::ElideMiddle, QskTextOptions::NoWrap );
|
||||
|
||||
setFlagHint( Q::Text | Q::Disabled | A::Style, Qsk::Sunken );
|
||||
setHint( Q::Text | Q::Disabled | A::Style, Qsk::Sunken );
|
||||
setColor( Q::Text, m_pal.themeForeground );
|
||||
setColor( Q::Text | Q::Disabled, m_pal.darker200 );
|
||||
|
||||
@ -340,7 +340,7 @@ void Editor::setupPopup()
|
||||
using A = QskAspect;
|
||||
using Q = QskPopup;
|
||||
|
||||
setFlagHint( Q::Overlay | A::Style, true );
|
||||
setHint( Q::Overlay | A::Style, true );
|
||||
setGradient( Q::Overlay, QColor( 220, 220, 220, 150 ) );
|
||||
}
|
||||
|
||||
@ -349,7 +349,7 @@ void Editor::setupMenu()
|
||||
using A = QskAspect;
|
||||
using Q = QskMenu;
|
||||
|
||||
setFlagHint( Q::Overlay | A::Style, true );
|
||||
setHint( Q::Overlay | A::Style, true );
|
||||
setGradient( Q::Overlay, QColor( 220, 220, 220, 100 ) );
|
||||
|
||||
setBoxShape( Q::Panel, qskDpiScaled( 4 ) );
|
||||
@ -359,7 +359,7 @@ void Editor::setupMenu()
|
||||
setGradient( Q::Panel, m_pal.lighter110 );
|
||||
|
||||
const bool isCascading = qskMaybeDesktopPlatform();
|
||||
setFlagHint( Q::Panel | A::Style, isCascading );
|
||||
setHint( Q::Panel | A::Style, isCascading );
|
||||
|
||||
setMetric( Q::Separator | A::Size, qskDpiScaled( 2 ) );
|
||||
setSeparator( Q::Separator );
|
||||
@ -585,7 +585,7 @@ void Editor::setupPushButton()
|
||||
using Q = QskPushButton;
|
||||
|
||||
// Panel
|
||||
setFlagHint( Q::Panel | QskAspect::Direction, Qsk::TopToBottom );
|
||||
setHint( Q::Panel | QskAspect::Direction, Qsk::TopToBottom );
|
||||
setStrutSize( Q::Panel, qskDpiScaled( 75.0 ), qskDpiScaled( 23.0 ) );
|
||||
|
||||
setMargin( Q::Panel, 0 );
|
||||
@ -611,7 +611,7 @@ void Editor::setupPushButton()
|
||||
|
||||
setTextOptions( Q::Text, Qt::ElideMiddle, QskTextOptions::NoWrap );
|
||||
|
||||
setFlagHint( Q::Text | Q::Disabled | A::Style, Qsk::Sunken );
|
||||
setHint( Q::Text | Q::Disabled | A::Style, Qsk::Sunken );
|
||||
|
||||
setAlignment( Q::Text, Qt::AlignCenter );
|
||||
|
||||
@ -1000,7 +1000,7 @@ void Editor::setupSubWindow()
|
||||
|
||||
// TitleBarPanel
|
||||
|
||||
setFlagHint( Q::TitleBarPanel | QskAspect::Style,
|
||||
setHint( Q::TitleBarPanel | QskAspect::Style,
|
||||
Q::TitleBar | Q::Title | Q::Symbol );
|
||||
|
||||
setGradient( Q::TitleBarPanel | Q::Focused, m_pal.highlighted );
|
||||
@ -1028,7 +1028,7 @@ void Editor::setupSpinBox()
|
||||
using A = QskAspect;
|
||||
using Q = QskSpinBox;
|
||||
|
||||
setFlagHint( Q::Panel | A::Style, Q::UpDownControl );
|
||||
setHint( Q::Panel | A::Style, Q::UpDownControl );
|
||||
setSpacing( Q::Panel, 2 );
|
||||
|
||||
setPadding( Q::TextPanel, 5 );
|
||||
|
@ -313,26 +313,8 @@ void qskDebugAspect( QDebug debug, const QMetaObject* metaObject, QskAspect aspe
|
||||
if ( aspect.isAnimator() )
|
||||
debug << "(A)";
|
||||
|
||||
switch ( aspect.type() )
|
||||
{
|
||||
case QskAspect::Color:
|
||||
{
|
||||
if ( aspect.colorPrimitive() != 0 )
|
||||
debug << ", " << qskEnumString( "ColorPrimitive", aspect.colorPrimitive() );
|
||||
break;
|
||||
}
|
||||
case QskAspect::Metric:
|
||||
{
|
||||
if ( aspect.metricPrimitive() != 0 )
|
||||
debug << ", " << qskEnumString( "MetricPrimitive", aspect.metricPrimitive() );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if ( aspect.flagPrimitive() != 0 )
|
||||
debug << ", " << qskEnumString( "FlagPrimitive", aspect.flagPrimitive() );
|
||||
}
|
||||
}
|
||||
if ( aspect.primitive() != 0 )
|
||||
debug << ", " << qskEnumString( "Primitive", aspect.primitive() );
|
||||
|
||||
if ( aspect.variation() != QskAspect::NoVariation )
|
||||
debug << ", " << qskEnumString( "Variation", aspect.variation() );
|
||||
|
@ -19,7 +19,8 @@ class QSK_EXPORT QskAspect
|
||||
|
||||
enum Type : quint8
|
||||
{
|
||||
Flag = 0,
|
||||
NoType = 0,
|
||||
|
||||
Metric = 1,
|
||||
Color = 2,
|
||||
};
|
||||
@ -169,7 +170,6 @@ class QSK_EXPORT QskAspect
|
||||
|
||||
constexpr bool isMetric() const noexcept;
|
||||
constexpr bool isColor() const noexcept;
|
||||
constexpr bool isFlag() const noexcept;
|
||||
|
||||
constexpr Variation variation() const noexcept;
|
||||
void setVariation( Variation ) noexcept;
|
||||
@ -188,7 +188,6 @@ class QSK_EXPORT QskAspect
|
||||
void setPrimitive( Type, Primitive primitive ) noexcept;
|
||||
void clearPrimitive() noexcept;
|
||||
|
||||
constexpr Primitive flagPrimitive() const noexcept;
|
||||
constexpr Primitive colorPrimitive() const noexcept;
|
||||
constexpr Primitive metricPrimitive() const noexcept;
|
||||
|
||||
@ -250,17 +249,17 @@ constexpr inline QskAspect::State operator>>( QskAspect::State a, const int b )
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::QskAspect() noexcept
|
||||
: QskAspect( NoSubcontrol, Body, Flag, NoVariation )
|
||||
: QskAspect( NoSubcontrol, Body, NoType, NoVariation )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::QskAspect( Subcontrol subControl ) noexcept
|
||||
: QskAspect( subControl, Body, Flag, NoVariation )
|
||||
: QskAspect( subControl, Body, NoType, NoVariation )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::QskAspect( Section section ) noexcept
|
||||
: QskAspect( NoSubcontrol, section, Flag, NoVariation )
|
||||
: QskAspect( NoSubcontrol, section, NoType, NoVariation )
|
||||
{
|
||||
}
|
||||
|
||||
@ -270,7 +269,7 @@ inline constexpr QskAspect::QskAspect( Type type ) noexcept
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::QskAspect( Variation variation ) noexcept
|
||||
: QskAspect( NoSubcontrol, Body, Flag, variation )
|
||||
: QskAspect( NoSubcontrol, Body, NoType, variation )
|
||||
{
|
||||
}
|
||||
|
||||
@ -456,11 +455,6 @@ inline constexpr bool QskAspect::isColor() const noexcept
|
||||
return type() == Color;
|
||||
}
|
||||
|
||||
inline constexpr bool QskAspect::isFlag() const noexcept
|
||||
{
|
||||
return type() == Flag;
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::States QskAspect::states() const noexcept
|
||||
{
|
||||
return static_cast< States >( m_bits.states );
|
||||
@ -502,12 +496,6 @@ inline void QskAspect::setPrimitive( Type type, QskAspect::Primitive primitive )
|
||||
m_bits.primitive = primitive;
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::Primitive QskAspect::flagPrimitive() const noexcept
|
||||
{
|
||||
return ( m_bits.type == Flag )
|
||||
? static_cast< Primitive >( m_bits.primitive ) : NoPrimitive;
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::Primitive QskAspect::colorPrimitive() const noexcept
|
||||
{
|
||||
return ( m_bits.type == Color )
|
||||
|
@ -105,7 +105,7 @@ void QskMenu::setCascading( bool on )
|
||||
|
||||
void QskMenu::resetCascading()
|
||||
{
|
||||
if ( resetFlagHint( QskMenu::Panel | QskAspect::Style ) )
|
||||
if ( resetSkinHint( QskMenu::Panel | QskAspect::Style ) )
|
||||
Q_EMIT cascadingChanged( isCascading() );
|
||||
}
|
||||
|
||||
|
@ -419,7 +419,7 @@ void QskPopup::setOverlay( bool on )
|
||||
|
||||
void QskPopup::resetOverlay()
|
||||
{
|
||||
if ( resetFlagHint( Overlay | QskAspect::Style ) )
|
||||
if ( resetSkinHint( Overlay | QskAspect::Style ) )
|
||||
Q_EMIT overlayChanged( hasOverlay() );
|
||||
}
|
||||
|
||||
|
@ -178,12 +178,12 @@ bool QskSkinHintTableEditor::removeHint(
|
||||
void QskSkinHintTableEditor::setFlag(
|
||||
QskAspect aspect, int flag, QskStateCombination combination )
|
||||
{
|
||||
setFlagHint( aspect, flag, combination );
|
||||
setHint( aspect, flag, combination );
|
||||
}
|
||||
|
||||
int QskSkinHintTableEditor::flag( QskAspect aspect ) const
|
||||
{
|
||||
return flagHint< int >( aspect );
|
||||
return hint< int >( aspect );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setMetric(
|
||||
@ -372,53 +372,52 @@ qreal QskSkinHintTableEditor::spacing( QskAspect aspect ) const
|
||||
void QskSkinHintTableEditor::setAlignment(
|
||||
QskAspect aspect, Qt::Alignment alignment, QskStateCombination combination )
|
||||
{
|
||||
setFlagHint( aspectAlignment( aspect ),
|
||||
static_cast< int >( alignment ), combination );
|
||||
setHint( aspectAlignment( aspect ), alignment, combination );
|
||||
}
|
||||
|
||||
bool QskSkinHintTableEditor::removeAlignment(
|
||||
QskAspect aspect, QskStateCombination combination )
|
||||
{
|
||||
return removeFlagHint( aspectAlignment( aspect ), combination );
|
||||
return removeHint( aspectAlignment( aspect ), combination );
|
||||
}
|
||||
|
||||
Qt::Alignment QskSkinHintTableEditor::alignment( QskAspect aspect ) const
|
||||
{
|
||||
return flagHint< Qt::Alignment >( aspectAlignment( aspect ) );
|
||||
return hint< Qt::Alignment >( aspectAlignment( aspect ) );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setFontRole(
|
||||
QskAspect aspect, int fontRole, QskStateCombination combination )
|
||||
{
|
||||
setFlagHint( aspectFontRole( aspect ), fontRole, combination );
|
||||
setHint( aspectFontRole( aspect ), fontRole, combination );
|
||||
}
|
||||
|
||||
bool QskSkinHintTableEditor::removeFontRole(
|
||||
QskAspect aspect, QskStateCombination combination )
|
||||
{
|
||||
return removeFlagHint( aspectFontRole( aspect ), combination );
|
||||
return removeHint( aspectFontRole( aspect ), combination );
|
||||
}
|
||||
|
||||
int QskSkinHintTableEditor::fontRole( QskAspect aspect ) const
|
||||
{
|
||||
return flagHint< int >( aspectFontRole( aspect ) );
|
||||
return hint< int >( aspectFontRole( aspect ) );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setGraphicRole(
|
||||
QskAspect aspect, int graphicRole, QskStateCombination combination )
|
||||
{
|
||||
setFlagHint( aspectGraphicRole( aspect ), graphicRole, combination );
|
||||
setHint( aspectGraphicRole( aspect ), graphicRole, combination );
|
||||
}
|
||||
|
||||
bool QskSkinHintTableEditor::removeGraphicRole(
|
||||
QskAspect aspect, QskStateCombination combination )
|
||||
{
|
||||
return removeFlagHint( aspectGraphicRole( aspect ), combination );
|
||||
return removeHint( aspectGraphicRole( aspect ), combination );
|
||||
}
|
||||
|
||||
int QskSkinHintTableEditor::graphicRole( QskAspect aspect ) const
|
||||
{
|
||||
return flagHint< int >( aspectGraphicRole( aspect ) );
|
||||
return hint< int >( aspectGraphicRole( aspect ) );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setBoxShape(
|
||||
@ -603,16 +602,16 @@ void QskSkinHintTableEditor::setTextOptions( QskAspect aspect,
|
||||
void QskSkinHintTableEditor::setTextOptions( QskAspect aspect,
|
||||
const QskTextOptions& textOptions, QskStateCombination combination )
|
||||
{
|
||||
setFlagHint( aspectOption( aspect ), textOptions, combination );
|
||||
setHint( aspectOption( aspect ), textOptions, combination );
|
||||
}
|
||||
|
||||
bool QskSkinHintTableEditor::removeTextOptions(
|
||||
QskAspect aspect, QskStateCombination combination )
|
||||
{
|
||||
return removeFlagHint( aspectOption( aspect ), combination );
|
||||
return removeHint( aspectOption( aspect ), combination );
|
||||
}
|
||||
|
||||
QskTextOptions QskSkinHintTableEditor::textOptions( QskAspect aspect ) const
|
||||
{
|
||||
return flagHint< QskTextOptions >( aspectOption( aspect ) );
|
||||
return hint< QskTextOptions >( aspectOption( aspect ) );
|
||||
}
|
||||
|
@ -57,19 +57,6 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||
|
||||
QskAnimationHint animation( QskAspect ) const;
|
||||
|
||||
// flag
|
||||
|
||||
void setFlagHint( QskAspect, const QVariant&,
|
||||
QskStateCombination = QskStateCombination() );
|
||||
|
||||
template< typename T > void setFlagHint( QskAspect, const T&,
|
||||
QskStateCombination = QskStateCombination() );
|
||||
|
||||
bool removeFlagHint( QskAspect, QskStateCombination = QskStateCombination() );
|
||||
|
||||
QVariant flagHint( QskAspect ) const;
|
||||
template< typename T > T flagHint( QskAspect ) const;
|
||||
|
||||
// metric
|
||||
|
||||
void setMetricHint( QskAspect, const QVariant&,
|
||||
@ -322,38 +309,6 @@ inline bool QskSkinHintTableEditor::hasHint( QskAspect aspect ) const
|
||||
return m_table->hasHint( aspect );
|
||||
}
|
||||
|
||||
// --- flag ---
|
||||
|
||||
inline void QskSkinHintTableEditor::setFlagHint(
|
||||
QskAspect aspect, const QVariant& hint, QskStateCombination combination )
|
||||
{
|
||||
setHint( aspect | QskAspect::Flag, hint, combination );
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
inline void QskSkinHintTableEditor::setFlagHint(
|
||||
QskAspect aspect, const T& hint, QskStateCombination combination )
|
||||
{
|
||||
setHint( aspect | QskAspect::Flag, hint, combination );
|
||||
}
|
||||
|
||||
inline bool QskSkinHintTableEditor::removeFlagHint(
|
||||
QskAspect aspect, QskStateCombination combination )
|
||||
{
|
||||
return removeHint( aspect | QskAspect::Flag, combination );
|
||||
}
|
||||
|
||||
inline QVariant QskSkinHintTableEditor::flagHint( QskAspect aspect ) const
|
||||
{
|
||||
return hint( aspect | QskAspect::Flag );
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
inline T QskSkinHintTableEditor::flagHint( QskAspect aspect ) const
|
||||
{
|
||||
return hint< T >( aspect | QskAspect::Flag );
|
||||
}
|
||||
|
||||
// --- metric ---
|
||||
|
||||
inline void QskSkinHintTableEditor::setMetricHint(
|
||||
|
@ -44,14 +44,14 @@ static void qskAddCandidates( const QskSkinTransition::Type mask,
|
||||
|
||||
switch( aspect.type() )
|
||||
{
|
||||
case QskAspect::Flag:
|
||||
case QskAspect::NoType:
|
||||
{
|
||||
if ( aspect.flagPrimitive() == QskAspect::GraphicRole )
|
||||
if ( aspect.primitive() == QskAspect::GraphicRole )
|
||||
{
|
||||
isCandidate = mask & QskSkinTransition::Color;
|
||||
}
|
||||
#if 0
|
||||
else if ( aspect.flagPrimitive() == QskAspect::FontRole )
|
||||
else if ( aspect.primitive() == QskAspect::FontRole )
|
||||
{
|
||||
isCandidate = mask & QskSkinTransition::Metric;
|
||||
}
|
||||
|
@ -43,13 +43,13 @@ static inline bool qskIsControl( const QskSkinnable* skinnable )
|
||||
static inline bool qskSetFlag( QskSkinnable* skinnable,
|
||||
const QskAspect aspect, int flag )
|
||||
{
|
||||
return skinnable->setSkinHint( aspect | QskAspect::Flag, QVariant( flag ) );
|
||||
return skinnable->setSkinHint( aspect, QVariant( flag ) );
|
||||
}
|
||||
|
||||
static inline int qskFlag( const QskSkinnable* skinnable,
|
||||
const QskAspect aspect, QskSkinHintStatus* status = nullptr )
|
||||
{
|
||||
return skinnable->effectiveSkinHint( aspect | QskAspect::Flag, status ).toInt();
|
||||
return skinnable->effectiveSkinHint( aspect, status ).toInt();
|
||||
}
|
||||
|
||||
static inline bool qskSetMetric( QskSkinnable* skinnable,
|
||||
@ -161,9 +161,9 @@ static inline void qskTriggerUpdates( QskAspect aspect, QskControl* control )
|
||||
break;
|
||||
}
|
||||
|
||||
case A::Flag:
|
||||
case A::NoType:
|
||||
{
|
||||
switch( aspect.flagPrimitive() )
|
||||
switch( aspect.primitive() )
|
||||
{
|
||||
case A::GraphicRole:
|
||||
case A::FontRole:
|
||||
@ -356,11 +356,6 @@ bool QskSkinnable::setFlagHint( const QskAspect aspect, int flag )
|
||||
return qskSetFlag( this, aspect, flag );
|
||||
}
|
||||
|
||||
int QskSkinnable::flagHint( const QskAspect aspect ) const
|
||||
{
|
||||
return effectiveSkinHint( aspect ).toInt();
|
||||
}
|
||||
|
||||
bool QskSkinnable::setAlignmentHint( const QskAspect aspect, Qt::Alignment alignment )
|
||||
{
|
||||
return qskSetFlag( this, aspect | QskAspect::Alignment, alignment );
|
||||
@ -368,7 +363,7 @@ bool QskSkinnable::setAlignmentHint( const QskAspect aspect, Qt::Alignment align
|
||||
|
||||
bool QskSkinnable::resetAlignmentHint( const QskAspect aspect )
|
||||
{
|
||||
return resetFlagHint( aspect | QskAspect::Alignment );
|
||||
return resetSkinHint( aspect | QskAspect::Alignment );
|
||||
}
|
||||
|
||||
bool QskSkinnable::setColor( const QskAspect aspect, const QColor& color )
|
||||
@ -655,20 +650,20 @@ qreal QskSkinnable::spacingHint(
|
||||
bool QskSkinnable::setTextOptionsHint(
|
||||
const QskAspect aspect, const QskTextOptions& options )
|
||||
{
|
||||
return setSkinHint( aspect | QskAspect::Flag | QskAspect::Option,
|
||||
return setSkinHint( aspect | QskAspect::NoType | QskAspect::Option,
|
||||
QVariant::fromValue( options ) );
|
||||
}
|
||||
|
||||
bool QskSkinnable::resetTextOptionsHint( const QskAspect aspect )
|
||||
{
|
||||
return resetFlagHint( aspect | QskAspect::Option );
|
||||
return resetSkinHint( aspect | QskAspect::Option );
|
||||
}
|
||||
|
||||
QskTextOptions QskSkinnable::textOptionsHint(
|
||||
const QskAspect aspect, QskSkinHintStatus* status ) const
|
||||
{
|
||||
return effectiveSkinHint(
|
||||
aspect | QskAspect::Flag | QskAspect::Option, status ).value< QskTextOptions >();
|
||||
aspect | QskAspect::NoType | QskAspect::Option, status ).value< QskTextOptions >();
|
||||
}
|
||||
|
||||
bool QskSkinnable::setFontRoleHint( const QskAspect aspect, int role )
|
||||
@ -678,7 +673,7 @@ bool QskSkinnable::setFontRoleHint( const QskAspect aspect, int role )
|
||||
|
||||
bool QskSkinnable::resetFontRoleHint( const QskAspect aspect )
|
||||
{
|
||||
return resetFlagHint( aspect | QskAspect::FontRole );
|
||||
return resetSkinHint( aspect | QskAspect::FontRole );
|
||||
}
|
||||
|
||||
int QskSkinnable::fontRoleHint(
|
||||
@ -705,7 +700,7 @@ bool QskSkinnable::setGraphicRoleHint( const QskAspect aspect, int role )
|
||||
|
||||
bool QskSkinnable::resetGraphicRoleHint( const QskAspect aspect )
|
||||
{
|
||||
return resetFlagHint( aspect | QskAspect::GraphicRole );
|
||||
return resetSkinHint( aspect | QskAspect::GraphicRole );
|
||||
}
|
||||
|
||||
int QskSkinnable::graphicRoleHint(
|
||||
@ -1242,7 +1237,8 @@ void QskSkinnable::startHintTransition( QskAspect aspect, int index,
|
||||
auto v1 = from;
|
||||
auto v2 = to;
|
||||
|
||||
if ( aspect.flagPrimitive() == QskAspect::GraphicRole )
|
||||
if ( aspect.type() == QskAspect::NoType &&
|
||||
aspect.primitive() == QskAspect::GraphicRole )
|
||||
{
|
||||
const auto skin = effectiveSkin();
|
||||
|
||||
|
@ -173,8 +173,6 @@ class QSK_EXPORT QskSkinnable
|
||||
qreal metric( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||
|
||||
bool setFlagHint( QskAspect, int flag );
|
||||
bool resetFlagHint( QskAspect );
|
||||
int flagHint( QskAspect ) const;
|
||||
template< typename T > T flagHint( QskAspect, T = T() ) const;
|
||||
|
||||
bool setPositionHint( QskAspect, qreal );
|
||||
@ -300,9 +298,4 @@ inline bool QskSkinnable::resetMetric( QskAspect aspect )
|
||||
return resetSkinHint( aspect | QskAspect::Metric );
|
||||
}
|
||||
|
||||
inline bool QskSkinnable::resetFlagHint( QskAspect aspect )
|
||||
{
|
||||
return resetSkinHint( aspect | QskAspect::Flag );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -41,12 +41,12 @@ namespace
|
||||
|
||||
inline QskAspect aspectDecoration()
|
||||
{
|
||||
return QskSpinBox::Panel | QskAspect::Flag | QskAspect::Style;
|
||||
return QskSpinBox::Panel | QskAspect::NoType | QskAspect::Style;
|
||||
}
|
||||
|
||||
inline QskAspect aspectTextAlignment()
|
||||
{
|
||||
return QskSpinBox::TextPanel | QskAspect::Flag | QskAspect::Alignment;
|
||||
return QskSpinBox::TextPanel | QskAspect::NoType | QskAspect::Alignment;
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ void QskSpinBox::setDecoration( Decoration decoration )
|
||||
|
||||
void QskSpinBox::resetDecoration()
|
||||
{
|
||||
if ( resetFlagHint( aspectDecoration() ) )
|
||||
if ( resetSkinHint( aspectDecoration() ) )
|
||||
Q_EMIT decorationChanged( decoration() );
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ void QskSpinBox::setTextAlignment( Qt::Alignment alignment )
|
||||
|
||||
void QskSpinBox::resetTextAlignment()
|
||||
{
|
||||
if ( resetFlagHint( aspectTextAlignment() ) )
|
||||
if ( resetSkinHint( aspectTextAlignment() ) )
|
||||
Q_EMIT textAlignmentChanged( textAlignment() );
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace
|
||||
{
|
||||
inline QskAspect aspectDecoration()
|
||||
{
|
||||
return QskSubWindow::TitleBarPanel | QskAspect::Flag | QskAspect::Style;
|
||||
return QskSubWindow::TitleBarPanel | QskAspect::NoType | QskAspect::Style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ void QskSubWindow::setDecoration( Decoration decoration, bool on )
|
||||
|
||||
void QskSubWindow::resetDecorations()
|
||||
{
|
||||
if ( resetFlagHint( aspectDecoration() ) )
|
||||
if ( resetSkinHint( aspectDecoration() ) )
|
||||
Q_EMIT decorationsChanged( decorations() );
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ void QskTabBar::setEdge( Qt::Edge edge )
|
||||
|
||||
void QskTabBar::resetEdge()
|
||||
{
|
||||
if ( resetFlagHint( Panel | QskAspect::Style ) )
|
||||
if ( resetSkinHint( Panel | QskAspect::Style ) )
|
||||
Q_EMIT edgeChanged( edge() );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user