mehods renamed to setXYZForAllStateCombinations
This commit is contained in:
parent
2bed344f52
commit
decbce4bdd
|
@ -14,7 +14,15 @@
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
inline void setHintForAllCombinations(
|
inline QskAspect::State lowestState( QskAspect::State mask )
|
||||||
|
{
|
||||||
|
using StateInt = typename std::underlying_type< QskAspect::State >::type;
|
||||||
|
|
||||||
|
const auto count = qCountTrailingZeroBits( static_cast< StateInt >( mask ) );
|
||||||
|
return static_cast< QskAspect::State >( 1 << count );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void setHintStateMask(
|
||||||
QskSkinHintTable* table, QskAspect aspect, const QVariant& hint,
|
QskSkinHintTable* table, QskAspect aspect, const QVariant& hint,
|
||||||
QskAspect::State state, QskAspect::State mask )
|
QskAspect::State state, QskAspect::State mask )
|
||||||
{
|
{
|
||||||
|
@ -26,16 +34,15 @@ namespace
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto stateBit = static_cast< QskAspect::State >(
|
const auto stateBit = lowestState( mask );
|
||||||
1 << qCountTrailingZeroBits( mask ) );
|
|
||||||
|
|
||||||
mask &= ~stateBit;
|
mask &= ~stateBit;
|
||||||
|
|
||||||
setHintForAllCombinations( table, aspect, hint, state, mask );
|
setHintStateMask( table, aspect, hint, state, mask );
|
||||||
setHintForAllCombinations( table, aspect, hint, state | stateBit, mask );
|
setHintStateMask( table, aspect, hint, state | stateBit, mask );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool removeHintForAllCombinations(
|
inline bool removeHintStateMask(
|
||||||
QskSkinHintTable* table, QskAspect aspect,
|
QskSkinHintTable* table, QskAspect aspect,
|
||||||
QskAspect::State state, QskAspect::State mask )
|
QskAspect::State state, QskAspect::State mask )
|
||||||
{
|
{
|
||||||
|
@ -52,8 +59,8 @@ namespace
|
||||||
|
|
||||||
mask &= ~stateBit;
|
mask &= ~stateBit;
|
||||||
|
|
||||||
bool ret = removeHintForAllCombinations( table, aspect, state, mask );
|
bool ret = removeHintStateMask( table, aspect, state, mask );
|
||||||
ret |= removeHintForAllCombinations( table, aspect, state | stateBit, mask );
|
ret |= removeHintStateMask( table, aspect, state | stateBit, mask );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -119,34 +126,34 @@ QskSkinHintTable* QskSkinHintTableEditor::table() const
|
||||||
return m_table;
|
return m_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setHintForCombinations(
|
void QskSkinHintTableEditor::setHintForAllStateCombinations(
|
||||||
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
::setHintForAllCombinations( m_table, aspect, hint, QskAspect::NoState, stateMask );
|
setHintStateMask( m_table, aspect, hint, QskAspect::NoState, stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QskSkinHintTableEditor::removeHintForCombinations(
|
bool QskSkinHintTableEditor::removeHintForAllStateCombinations(
|
||||||
QskAspect aspect, QskAspect::State stateMask )
|
QskAspect aspect, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
return ::removeHintForAllCombinations( m_table, aspect, QskAspect::NoState, stateMask );
|
return removeHintStateMask( m_table, aspect, QskAspect::NoState, stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setFlagHintForCombinations(
|
void QskSkinHintTableEditor::setFlagHintForAllStateCombinations(
|
||||||
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
setHintForCombinations( aspect | QskAspect::Flag, hint, stateMask );
|
setHintForAllStateCombinations( aspect | QskAspect::Flag, hint, stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setMetricHintForCombinations(
|
void QskSkinHintTableEditor::setMetricHintForAllStateCombinations(
|
||||||
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
setHintForCombinations( aspect | QskAspect::Metric, hint, stateMask );
|
setHintForAllStateCombinations( aspect | QskAspect::Metric, hint, stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setColorHintForCombinations(
|
void QskSkinHintTableEditor::setColorHintForAllStateCombinations(
|
||||||
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
QskAspect aspect, const QVariant& hint, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
setHintForCombinations( aspect | QskAspect::Color, hint, stateMask );
|
setHintForAllStateCombinations( aspect | QskAspect::Color, hint, stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setFlag( QskAspect aspect, int flag )
|
void QskSkinHintTableEditor::setFlag( QskAspect aspect, int flag )
|
||||||
|
@ -206,10 +213,10 @@ void QskSkinHintTableEditor::setGradient( QskAspect aspect, const QskGradient& g
|
||||||
setColorHint( aspect, gradient );
|
setColorHint( aspect, gradient );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setGradientForCombinations(
|
void QskSkinHintTableEditor::setGradientForAllStateCombinations(
|
||||||
QskAspect aspect, const QskGradient& gradient, QskAspect::State stateMask )
|
QskAspect aspect, const QskGradient& gradient, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
setColorHintForCombinations( aspect, QVariant::fromValue( gradient ), stateMask );
|
setColorHintForAllStateCombinations( aspect, QVariant::fromValue( gradient ), stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
QskGradient QskSkinHintTableEditor::gradient( QskAspect aspect ) const
|
QskGradient QskSkinHintTableEditor::gradient( QskAspect aspect ) const
|
||||||
|
@ -359,10 +366,10 @@ void QskSkinHintTableEditor::setBoxShape(
|
||||||
setMetricHint( aspectShape( aspect ), shape );
|
setMetricHint( aspectShape( aspect ), shape );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setBoxShapeForCombinations(
|
void QskSkinHintTableEditor::setBoxShapeForAllStateCombinations(
|
||||||
QskAspect aspect, const QskBoxShapeMetrics& shape, QskAspect::State stateMask )
|
QskAspect aspect, const QskBoxShapeMetrics& shape, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
setMetricHintForCombinations(
|
setMetricHintForAllStateCombinations(
|
||||||
aspectShape( aspect ), QVariant::fromValue( shape ), stateMask );
|
aspectShape( aspect ), QVariant::fromValue( shape ), stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,10 +403,10 @@ void QskSkinHintTableEditor::setBoxBorderMetrics(
|
||||||
setMetricHint( aspectBorder( aspect ), borderMetrics );
|
setMetricHint( aspectBorder( aspect ), borderMetrics );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setBoxBorderMetricsForCombinations(
|
void QskSkinHintTableEditor::setBoxBorderMetricsForAllStateCombinations(
|
||||||
QskAspect aspect, const QskBoxBorderMetrics& borderMetrics, QskAspect::State stateMask )
|
QskAspect aspect, const QskBoxBorderMetrics& borderMetrics, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
setMetricHintForCombinations( aspectBorder( aspect ),
|
setMetricHintForAllStateCombinations( aspectBorder( aspect ),
|
||||||
QVariant::fromValue( borderMetrics ), stateMask );
|
QVariant::fromValue( borderMetrics ), stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,10 +426,10 @@ void QskSkinHintTableEditor::setBoxBorderColors(
|
||||||
setColorHint( aspectBorder( aspect ), borderColors );
|
setColorHint( aspectBorder( aspect ), borderColors );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setBoxBorderColorsForCombinations(
|
void QskSkinHintTableEditor::setBoxBorderColorsForAllStateCombinations(
|
||||||
QskAspect aspect, const QskBoxBorderColors& borderColors, QskAspect::State stateMask )
|
QskAspect aspect, const QskBoxBorderColors& borderColors, QskAspect::State stateMask )
|
||||||
{
|
{
|
||||||
setColorHintForCombinations( aspectBorder( aspect ),
|
setColorHintForAllStateCombinations( aspectBorder( aspect ),
|
||||||
QVariant::fromValue( borderColors ), stateMask );
|
QVariant::fromValue( borderColors ), stateMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
|
|
||||||
void setHint( QskAspect, const QVariant& );
|
void setHint( QskAspect, const QVariant& );
|
||||||
const QVariant& hint( QskAspect ) const;
|
const QVariant& hint( QskAspect ) const;
|
||||||
void setHintForCombinations( QskAspect, const QVariant&, QskAspect::State );
|
void setHintForAllStateCombinations( QskAspect, const QVariant&, QskAspect::State );
|
||||||
|
|
||||||
bool removeHint( QskAspect );
|
bool removeHint( QskAspect );
|
||||||
bool removeHintForCombinations( QskAspect, QskAspect::State );
|
bool removeHintForAllStateCombinations( QskAspect, QskAspect::State );
|
||||||
|
|
||||||
QVariant takeHint( QskAspect );
|
QVariant takeHint( QskAspect );
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
// flag/metric/color
|
// flag/metric/color
|
||||||
|
|
||||||
void setFlagHint( QskAspect, const QVariant& );
|
void setFlagHint( QskAspect, const QVariant& );
|
||||||
void setFlagHintForCombinations( QskAspect, const QVariant&, QskAspect::State );
|
void setFlagHintForAllStateCombinations( QskAspect, const QVariant&, QskAspect::State );
|
||||||
void removeFlagHint( QskAspect );
|
void removeFlagHint( QskAspect );
|
||||||
QVariant flagHint( QskAspect ) const;
|
QVariant flagHint( QskAspect ) const;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
template< typename T > T flagHint( QskAspect ) const;
|
template< typename T > T flagHint( QskAspect ) const;
|
||||||
|
|
||||||
void setMetricHint( QskAspect, const QVariant& );
|
void setMetricHint( QskAspect, const QVariant& );
|
||||||
void setMetricHintForCombinations( QskAspect, const QVariant&, QskAspect::State );
|
void setMetricHintForAllStateCombinations( QskAspect, const QVariant&, QskAspect::State );
|
||||||
void removeMetricHint( QskAspect );
|
void removeMetricHint( QskAspect );
|
||||||
QVariant metricHint( QskAspect ) const;
|
QVariant metricHint( QskAspect ) const;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
template< typename T > T metricHint( QskAspect ) const;
|
template< typename T > T metricHint( QskAspect ) const;
|
||||||
|
|
||||||
void setColorHint( QskAspect, const QVariant& );
|
void setColorHint( QskAspect, const QVariant& );
|
||||||
void setColorHintForCombinations( QskAspect, const QVariant&, QskAspect::State );
|
void setColorHintForAllStateCombinations( QskAspect, const QVariant&, QskAspect::State );
|
||||||
void removeColorHint( QskAspect );
|
void removeColorHint( QskAspect );
|
||||||
QVariant colorHint( QskAspect ) const;
|
QVariant colorHint( QskAspect ) const;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
void setHGradient( QskAspect, const QColor&, const QColor& );
|
void setHGradient( QskAspect, const QColor&, const QColor& );
|
||||||
void setVGradient( QskAspect, const QColor&, const QColor& );
|
void setVGradient( QskAspect, const QColor&, const QColor& );
|
||||||
void setGradient( QskAspect, const QskGradient& );
|
void setGradient( QskAspect, const QskGradient& );
|
||||||
void setGradientForCombinations( QskAspect, const QskGradient&, QskAspect::State );
|
void setGradientForAllStateCombinations( QskAspect, const QskGradient&, QskAspect::State );
|
||||||
QskGradient gradient( QskAspect ) const;
|
QskGradient gradient( QskAspect ) const;
|
||||||
|
|
||||||
void setStrutSize( QskAspect, const QSizeF& );
|
void setStrutSize( QskAspect, const QSizeF& );
|
||||||
|
@ -130,7 +130,7 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
void setBoxShape( QskAspect, qreal topLeft, qreal topRight,
|
void setBoxShape( QskAspect, qreal topLeft, qreal topRight,
|
||||||
qreal bottomLeft, qreal bottomRight, Qt::SizeMode = Qt::AbsoluteSize );
|
qreal bottomLeft, qreal bottomRight, Qt::SizeMode = Qt::AbsoluteSize );
|
||||||
void setBoxShape( QskAspect, const QskBoxShapeMetrics& );
|
void setBoxShape( QskAspect, const QskBoxShapeMetrics& );
|
||||||
void setBoxShapeForCombinations( QskAspect, const QskBoxShapeMetrics&, QskAspect::State );
|
void setBoxShapeForAllStateCombinations( QskAspect, const QskBoxShapeMetrics&, QskAspect::State );
|
||||||
void removeBoxShape( QskAspect );
|
void removeBoxShape( QskAspect );
|
||||||
QskBoxShapeMetrics boxShape( QskAspect ) const;
|
QskBoxShapeMetrics boxShape( QskAspect ) const;
|
||||||
|
|
||||||
|
@ -139,12 +139,12 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
void setBoxBorderMetrics( QskAspect, qreal left, qreal top,
|
void setBoxBorderMetrics( QskAspect, qreal left, qreal top,
|
||||||
qreal right, qreal bottom, Qt::SizeMode = Qt::AbsoluteSize );
|
qreal right, qreal bottom, Qt::SizeMode = Qt::AbsoluteSize );
|
||||||
void setBoxBorderMetrics( QskAspect, const QskBoxBorderMetrics& );
|
void setBoxBorderMetrics( QskAspect, const QskBoxBorderMetrics& );
|
||||||
void setBoxBorderMetricsForCombinations( QskAspect, const QskBoxBorderMetrics&, QskAspect::State );
|
void setBoxBorderMetricsForAllStateCombinations( QskAspect, const QskBoxBorderMetrics&, QskAspect::State );
|
||||||
void removeBoxBorderMetric( QskAspect );
|
void removeBoxBorderMetric( QskAspect );
|
||||||
QskBoxBorderMetrics boxBorderMetrics( QskAspect ) const;
|
QskBoxBorderMetrics boxBorderMetrics( QskAspect ) const;
|
||||||
|
|
||||||
void setBoxBorderColors( QskAspect, const QskBoxBorderColors& );
|
void setBoxBorderColors( QskAspect, const QskBoxBorderColors& );
|
||||||
void setBoxBorderColorsForCombinations( QskAspect, const QskBoxBorderColors&, QskAspect::State );
|
void setBoxBorderColorsForAllStateCombinations( QskAspect, const QskBoxBorderColors&, QskAspect::State );
|
||||||
void setBoxBorderColors( QskAspect, const QColor& left, const QColor& top,
|
void setBoxBorderColors( QskAspect, const QColor& left, const QColor& top,
|
||||||
const QColor& right, const QColor& bottom );
|
const QColor& right, const QColor& bottom );
|
||||||
void removeBoxBorderColors( QskAspect );
|
void removeBoxBorderColors( QskAspect );
|
||||||
|
|
Loading…
Reference in New Issue