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