Merge branch 'master' into features/slider

This commit is contained in:
Uwe Rathmann 2024-10-23 13:54:17 +02:00
commit 52ac73111e
19 changed files with 97 additions and 98 deletions

View File

@ -1445,12 +1445,11 @@ void Editor::setupSliderMetrics()
setBoxShape( Q::Handle, 100, Qt::RelativeSize ); setBoxShape( Q::Handle, 100, Qt::RelativeSize );
setBoxBorderMetrics( Q::Handle, 1_px ); setBoxBorderMetrics( Q::Handle, 1_px );
setStrutSize( Q::Ripple, { 12_px, 12_px } ); setStrutSize( Q::Halo, { 12_px, 12_px } );
setBoxShape( Q::Ripple, 100, Qt::RelativeSize ); setBoxShape( Q::Halo, 100, Qt::RelativeSize );
setStrutSize( Q::Ripple | Q::Hovered, { 14_px, 14_px } ); setStrutSize( Q::Halo | Q::Hovered, { 14_px, 14_px } );
setStrutSize( Q::Halo | Q::Pressed, { 10_px, 10_px } );
setStrutSize( Q::Ripple | Q::Pressed, { 10_px, 10_px } );
} }
void Editor::setupSliderColors( void Editor::setupSliderColors(
@ -1470,32 +1469,32 @@ void Editor::setupSliderColors(
for ( auto state : { A::NoState, Q::Pressed, Q::Disabled } ) for ( auto state : { A::NoState, Q::Pressed, Q::Disabled } )
{ {
QRgb grooveColor, fillColor, rippleColor; QRgb grooveColor, fillColor, haloColor;
if ( state == A::NoState ) if ( state == A::NoState )
{ {
grooveColor = pal.fillColor.controlStrong.defaultColor; grooveColor = pal.fillColor.controlStrong.defaultColor;
fillColor = pal.fillColor.accent.defaultColor; fillColor = pal.fillColor.accent.defaultColor;
rippleColor = fillColor; haloColor = fillColor;
} }
else if ( state == Q::Pressed ) else if ( state == Q::Pressed )
{ {
grooveColor = pal.fillColor.controlStrong.defaultColor; grooveColor = pal.fillColor.controlStrong.defaultColor;
fillColor = pal.fillColor.accent.defaultColor; fillColor = pal.fillColor.accent.defaultColor;
rippleColor = pal.fillColor.accent.tertiary; haloColor = pal.fillColor.accent.tertiary;
} }
else if ( state == Q::Disabled ) else if ( state == Q::Disabled )
{ {
grooveColor = pal.fillColor.controlStrong.disabled; grooveColor = pal.fillColor.controlStrong.disabled;
fillColor = pal.fillColor.accent.disabled; fillColor = pal.fillColor.accent.disabled;
rippleColor = grooveColor; haloColor = grooveColor;
} }
grooveColor = rgbSolid( grooveColor, pal.background.solid.base ); grooveColor = rgbSolid( grooveColor, pal.background.solid.base );
setGradient( Q::Groove | section | state, grooveColor ); setGradient( Q::Groove | section | state, grooveColor );
setGradient( Q::Fill | section | state, fillColor ); setGradient( Q::Fill | section | state, fillColor );
setGradient( Q::Ripple | section | state, rippleColor ); setGradient( Q::Halo | section | state, haloColor );
} }
} }

View File

@ -489,7 +489,7 @@ void Editor::setupRadioBox()
setStrutSize( Q::CheckIndicatorPanel, 20_dp, 20_dp ); setStrutSize( Q::CheckIndicatorPanel, 20_dp, 20_dp );
for ( auto subControl : { Q::CheckIndicatorPanel, Q::CheckIndicator, Q::Ripple } ) for ( auto subControl : { Q::CheckIndicatorPanel, Q::CheckIndicator, Q::Halo } )
setBoxShape( subControl, 100, Qt::RelativeSize ); // circular setBoxShape( subControl, 100, Qt::RelativeSize ); // circular
setBoxBorderMetrics( Q::CheckIndicatorPanel, 1_dp ); setBoxBorderMetrics( Q::CheckIndicatorPanel, 1_dp );

View File

@ -232,9 +232,9 @@ void Editor::setupCheckBox()
setSymbol( aspect | Q::Error, checkMark ); setSymbol( aspect | Q::Error, checkMark );
} }
setStrutSize( Q::Ripple, 40_dp, 40_dp ); setStrutSize( Q::Halo, 40_dp, 40_dp );
setBoxShape( Q::Ripple, 100, Qt::RelativeSize ); setBoxShape( Q::Halo, 100, Qt::RelativeSize );
setGradient( Q::Ripple, Qt::transparent ); setGradient( Q::Halo, Qt::transparent );
setColor( Q::Text, m_pal.onBackground ); // not mentioned in the specs setColor( Q::Text, m_pal.onBackground ); // not mentioned in the specs
@ -252,25 +252,25 @@ void Editor::setupCheckBox()
// 3. Hovered // 3. Hovered
setGradient( Q::Ripple | Q::Hovered | Q::Checked, m_pal.primary8 ); setGradient( Q::Halo | Q::Hovered | Q::Checked, m_pal.primary8 );
setGradient( Q::Ripple | Q::Hovered, m_pal.onSurface8 ); setGradient( Q::Halo | Q::Hovered, m_pal.onSurface8 );
setGradient( Q::Ripple | Q::Error | Q::Hovered, m_pal.error8 ); setGradient( Q::Halo | Q::Error | Q::Hovered, m_pal.error8 );
setGradient( Q::Ripple | Q::Error | Q::Hovered | Q::Checked, m_pal.error8 ); setGradient( Q::Halo | Q::Error | Q::Hovered | Q::Checked, m_pal.error8 );
// 4. Focused // 4. Focused
setGradient( Q::Ripple | Q::Focused | Q::Checked, m_pal.primary12 ); setGradient( Q::Halo | Q::Focused | Q::Checked, m_pal.primary12 );
setGradient( Q::Ripple | Q::Focused, m_pal.onSurface12 ); setGradient( Q::Halo | Q::Focused, m_pal.onSurface12 );
setGradient( Q::Ripple | Q::Error | Q::Focused, m_pal.error12 ); setGradient( Q::Halo | Q::Error | Q::Focused, m_pal.error12 );
setGradient( Q::Ripple | Q::Error | Q::Focused | Q::Checked, m_pal.error12 ); setGradient( Q::Halo | Q::Error | Q::Focused | Q::Checked, m_pal.error12 );
// 5. Pressed // 5. Pressed
setGradient( Q::Ripple | Q::Pressed, m_pal.primary12 ); setGradient( Q::Halo | Q::Pressed, m_pal.primary12 );
setGradient( Q::Ripple | Q::Pressed | Q::Checked, m_pal.primary12 ); setGradient( Q::Halo | Q::Pressed | Q::Checked, m_pal.primary12 );
setGradient( Q::Ripple | Q::Hovered | Q::Pressed, m_pal.primary12 ); setGradient( Q::Halo | Q::Hovered | Q::Pressed, m_pal.primary12 );
setGradient( Q::Ripple | Q::Error | Q::Pressed, m_pal.error12 ); setGradient( Q::Halo | Q::Error | Q::Pressed, m_pal.error12 );
setGradient( Q::Ripple | Q::Error | Q::Pressed | Q::Checked, m_pal.error12 ); setGradient( Q::Halo | Q::Error | Q::Pressed | Q::Checked, m_pal.error12 );
} }
void Editor::setupComboBox() void Editor::setupComboBox()
@ -480,9 +480,9 @@ void Editor::setupRadioBox()
setSpacing( Q::Button, 10_dp ); setSpacing( Q::Button, 10_dp );
setStrutSize( Q::CheckIndicatorPanel, 20_dp, 20_dp ); setStrutSize( Q::CheckIndicatorPanel, 20_dp, 20_dp );
setStrutSize( Q::Ripple, 40_dp, 40_dp ); setStrutSize( Q::Halo, 40_dp, 40_dp );
for ( auto subControl : { Q::CheckIndicatorPanel, Q::CheckIndicator, Q::Ripple } ) for ( auto subControl : { Q::CheckIndicatorPanel, Q::CheckIndicator, Q::Halo } )
setBoxShape( subControl, 100, Qt::RelativeSize ); // circular setBoxShape( subControl, 100, Qt::RelativeSize ); // circular
setBoxBorderMetrics( Q::CheckIndicatorPanel, 2_dp ); setBoxBorderMetrics( Q::CheckIndicatorPanel, 2_dp );
@ -494,8 +494,8 @@ void Editor::setupRadioBox()
setColor( Q::Text, m_pal.onBackground ); setColor( Q::Text, m_pal.onBackground );
setColor( Q::Text | Q::Disabled, m_pal.onSurface38 ); setColor( Q::Text | Q::Disabled, m_pal.onSurface38 );
setColor( Q::Ripple, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) ); setColor( Q::Halo, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) );
setColor( Q::Ripple | Q::Selected, setColor( Q::Halo | Q::Selected,
stateLayerColor( m_pal.primary, m_pal.focusOpacity ) ); stateLayerColor( m_pal.primary, m_pal.focusOpacity ) );
setColor( Q::CheckIndicator, Qt::transparent); setColor( Q::CheckIndicator, Qt::transparent);
@ -509,7 +509,7 @@ void Editor::setupRadioBox()
setBoxBorderColors( setBoxBorderColors(
Q::CheckIndicatorPanel | Q::Disabled | Q::Selected, m_pal.onSurface38 ); Q::CheckIndicatorPanel | Q::Disabled | Q::Selected, m_pal.onSurface38 );
setAnimation( Q::Ripple | A::Metric | A::Position, qskDuration ); setAnimation( Q::Halo | A::Metric | A::Position, qskDuration );
} }
void Editor::setupFocusIndicator() void Editor::setupFocusIndicator()
@ -1028,13 +1028,13 @@ void Editor::setupSwitchButton()
setGradient( Q::Handle | Q::Disabled | Q::Checked, m_pal.surface ); setGradient( Q::Handle | Q::Disabled | Q::Checked, m_pal.surface );
// just to keep the strut size the same at all times: // just to keep the strut size the same at all times:
setStrutSize( Q::Ripple, 40_dp, 40_dp ); setStrutSize( Q::Halo, 40_dp, 40_dp );
setGradient( Q::Ripple, Qt::transparent ); setGradient( Q::Halo, Qt::transparent );
setStrutSize( Q::Ripple | Q::Hovered, 40_dp, 40_dp ); setStrutSize( Q::Halo | Q::Hovered, 40_dp, 40_dp );
setBoxShape( Q::Ripple, 100, Qt::RelativeSize ); setBoxShape( Q::Halo, 100, Qt::RelativeSize );
setGradient( Q::Ripple | Q::Hovered, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) ); setGradient( Q::Halo | Q::Hovered, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) );
setGradient( Q::Ripple | Q::Hovered | Q::Checked, setGradient( Q::Halo | Q::Hovered | Q::Checked,
stateLayerColor( m_pal.primary, m_pal.focusOpacity ) ); stateLayerColor( m_pal.primary, m_pal.focusOpacity ) );
setBoxBorderColors( Q::Handle, m_pal.outline ); setBoxBorderColors( Q::Handle, m_pal.outline );

View File

@ -9,7 +9,7 @@ QSK_SUBCONTROL( QskCheckBox, Panel )
QSK_SUBCONTROL( QskCheckBox, Box ) QSK_SUBCONTROL( QskCheckBox, Box )
QSK_SUBCONTROL( QskCheckBox, Indicator ) QSK_SUBCONTROL( QskCheckBox, Indicator )
QSK_SUBCONTROL( QskCheckBox, Text ) QSK_SUBCONTROL( QskCheckBox, Text )
QSK_SUBCONTROL( QskCheckBox, Ripple ) QSK_SUBCONTROL( QskCheckBox, Halo )
QSK_SYSTEM_STATE( QskCheckBox, Error, QskAspect::FirstSystemState << 1 ) QSK_SYSTEM_STATE( QskCheckBox, Error, QskAspect::FirstSystemState << 1 )

View File

@ -17,7 +17,7 @@ class QSK_EXPORT QskCheckBox : public QskAbstractButton
using Inherited = QskAbstractButton; using Inherited = QskAbstractButton;
public: public:
QSK_SUBCONTROLS( Panel, Box, Indicator, Text, Ripple ) QSK_SUBCONTROLS( Panel, Box, Indicator, Text, Halo )
QSK_STATES( Error ) QSK_STATES( Error )
QskCheckBox( QQuickItem* parent = nullptr ); QskCheckBox( QQuickItem* parent = nullptr );

View File

@ -11,7 +11,7 @@
QskCheckBoxSkinlet::QskCheckBoxSkinlet( QskSkin* skin ) QskCheckBoxSkinlet::QskCheckBoxSkinlet( QskSkin* skin )
: QskSkinlet( skin ) : QskSkinlet( skin )
{ {
setNodeRoles( { BoxRole, IndicatorRole, TextRole, RippleRole } ); setNodeRoles( { BoxRole, IndicatorRole, TextRole, HaloRole } );
} }
QskCheckBoxSkinlet::~QskCheckBoxSkinlet() QskCheckBoxSkinlet::~QskCheckBoxSkinlet()
@ -40,8 +40,8 @@ QRectF QskCheckBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
if ( subControl == Q::Text ) if ( subControl == Q::Text )
return textRect( checkBox, contentsRect ); return textRect( checkBox, contentsRect );
if ( subControl == Q::Ripple ) if ( subControl == Q::Halo )
return rippleRect( checkBox, contentsRect ); return haloRect( checkBox, contentsRect );
return contentsRect; return contentsRect;
} }
@ -83,14 +83,14 @@ QRectF QskCheckBoxSkinlet::boxRect(
return r; return r;
} }
QRectF QskCheckBoxSkinlet::rippleRect( QRectF QskCheckBoxSkinlet::haloRect(
const QskCheckBox* checkBox, const QRectF& rect ) const const QskCheckBox* checkBox, const QRectF& rect ) const
{ {
const auto rippleSize = checkBox->strutSizeHint( QskCheckBox::Ripple ); const auto haloSize = checkBox->strutSizeHint( QskCheckBox::Halo );
const auto boxSize = checkBox->strutSizeHint( QskCheckBox::Box ); const auto boxSize = checkBox->strutSizeHint( QskCheckBox::Box );
const auto w = ( rippleSize.width() - boxSize.width() ) / 2; const auto w = ( haloSize.width() - boxSize.width() ) / 2;
const auto h = ( rippleSize.height() - boxSize.height() ) / 2; const auto h = ( haloSize.height() - boxSize.height() ) / 2;
auto r = boxRect( checkBox, rect ); auto r = boxRect( checkBox, rect );
r = r.marginsAdded( { w, h, w, h } ); r = r.marginsAdded( { w, h, w, h } );
@ -119,8 +119,8 @@ QSGNode* QskCheckBoxSkinlet::updateSubNode(
case TextRole: case TextRole:
return updateTextNode( checkBox, node ); return updateTextNode( checkBox, node );
case RippleRole: case HaloRole:
return updateBoxNode( checkBox, node, Q::Ripple ); return updateBoxNode( checkBox, node, Q::Halo );
} }
return Inherited::updateSubNode( skinnable, nodeRole, node ); return Inherited::updateSubNode( skinnable, nodeRole, node );

View File

@ -23,7 +23,7 @@ class QSK_EXPORT QskCheckBoxSkinlet : public QskSkinlet
BoxRole, BoxRole,
IndicatorRole, IndicatorRole,
TextRole, TextRole,
RippleRole, HaloRole,
RoleCount RoleCount
}; };
@ -44,7 +44,7 @@ class QSK_EXPORT QskCheckBoxSkinlet : public QskSkinlet
private: private:
QRectF textRect( const QskCheckBox*, const QRectF& ) const; QRectF textRect( const QskCheckBox*, const QRectF& ) const;
QRectF boxRect( const QskCheckBox*, const QRectF& ) const; QRectF boxRect( const QskCheckBox*, const QRectF& ) const;
QRectF rippleRect( const QskCheckBox*, const QRectF& ) const; QRectF haloRect( const QskCheckBox*, const QRectF& ) const;
QSGNode* updateTextNode( const QskCheckBox*, QSGNode* ) const; QSGNode* updateTextNode( const QskCheckBox*, QSGNode* ) const;
}; };

View File

@ -13,7 +13,7 @@ QSK_SUBCONTROL( QskRadioBox, Button )
QSK_SUBCONTROL( QskRadioBox, CheckIndicatorPanel ) QSK_SUBCONTROL( QskRadioBox, CheckIndicatorPanel )
QSK_SUBCONTROL( QskRadioBox, CheckIndicator ) QSK_SUBCONTROL( QskRadioBox, CheckIndicator )
QSK_SUBCONTROL( QskRadioBox, Text ) QSK_SUBCONTROL( QskRadioBox, Text )
QSK_SUBCONTROL( QskRadioBox, Ripple ) QSK_SUBCONTROL( QskRadioBox, Halo )
QSK_STATE( QskRadioBox, Selected, QskAspect::FirstUserState << 1 ) QSK_STATE( QskRadioBox, Selected, QskAspect::FirstUserState << 1 )
QSK_STATE( QskRadioBox, Pressed, QskAspect::FirstUserState << 2 ) QSK_STATE( QskRadioBox, Pressed, QskAspect::FirstUserState << 2 )
@ -38,7 +38,7 @@ QskRadioBox::QskRadioBox( QQuickItem* parent )
setFocusPolicy( Qt::StrongFocus ); setFocusPolicy( Qt::StrongFocus );
setAcceptedMouseButtons( Qt::LeftButton ); setAcceptedMouseButtons( Qt::LeftButton );
setPositionHint( Ripple, -1 ); setPositionHint( Halo, -1 );
setAcceptHoverEvents( true ); setAcceptHoverEvents( true );
} }
@ -182,7 +182,7 @@ void QskRadioBox::keyPressEvent( QKeyEvent* event )
{ {
setFocusedIndex( nextTabIndex ); setFocusedIndex( nextTabIndex );
const auto aspect = Ripple | QskAspect::Metric | QskAspect::Position; const auto aspect = Halo | QskAspect::Metric | QskAspect::Position;
const auto hint = animationHint( aspect | skinStates() ); const auto hint = animationHint( aspect | skinStates() );
if( hint.isValid() ) if( hint.isValid() )
@ -277,7 +277,7 @@ void QskRadioBox::setHoveredIndex( int index )
return; return;
m_data->hoveredIndex = index; m_data->hoveredIndex = index;
setPositionHint( Ripple | Hovered, index ); setPositionHint( Halo | Hovered, index );
update(); update();
} }
@ -288,7 +288,7 @@ void QskRadioBox::setFocusedIndex( int index )
return; return;
m_data->focusedIndex = index; m_data->focusedIndex = index;
setPositionHint( Ripple, index ); setPositionHint( Halo, index );
update(); update();

View File

@ -22,7 +22,7 @@ class QSK_EXPORT QskRadioBox : public QskControl
using Inherited = QskControl; using Inherited = QskControl;
public: public:
QSK_SUBCONTROLS( Panel, Button, CheckIndicatorPanel, CheckIndicator, Text, Ripple ) QSK_SUBCONTROLS( Panel, Button, CheckIndicatorPanel, CheckIndicator, Text, Halo )
QSK_STATES( Selected, Pressed ) QSK_STATES( Selected, Pressed )
QskRadioBox( QQuickItem* parent = nullptr ); QskRadioBox( QQuickItem* parent = nullptr );

View File

@ -40,7 +40,7 @@ namespace
QskRadioBoxSkinlet::QskRadioBoxSkinlet( QskSkin* ) QskRadioBoxSkinlet::QskRadioBoxSkinlet( QskSkin* )
{ {
setNodeRoles( { PanelRole, ButtonRole, CheckPanelRole, setNodeRoles( { PanelRole, ButtonRole, CheckPanelRole,
CheckIndicatorRole, TextRole, RippleRole } ); CheckIndicatorRole, TextRole, HaloRole } );
} }
QskRadioBoxSkinlet::~QskRadioBoxSkinlet() QskRadioBoxSkinlet::~QskRadioBoxSkinlet()
@ -54,8 +54,8 @@ QRectF QskRadioBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
auto radioBox = static_cast< const QskRadioBox* >( skinnable ); auto radioBox = static_cast< const QskRadioBox* >( skinnable );
if( subcontrol == Q::Ripple ) if( subcontrol == Q::Halo )
return rippleRect( radioBox, contentsRect ); return haloRect( radioBox, contentsRect );
return contentsRect; return contentsRect;
} }
@ -82,8 +82,8 @@ QSGNode* QskRadioBoxSkinlet::updateSubNode( const QskSkinnable* skinnable,
case TextRole: case TextRole:
return updateSeriesNode( skinnable, Q::Text, node ); return updateSeriesNode( skinnable, Q::Text, node );
case RippleRole: case HaloRole:
return updateBoxNode( skinnable, node, Q::Ripple ); return updateBoxNode( skinnable, node, Q::Halo );
} }
return Inherited::updateSubNode( skinnable, nodeRole, node ); return Inherited::updateSubNode( skinnable, nodeRole, node );
@ -96,17 +96,17 @@ int QskRadioBoxSkinlet::sampleCount(
return radioBox->options().count(); return radioBox->options().count();
} }
QRectF QskRadioBoxSkinlet::rippleRect( QRectF QskRadioBoxSkinlet::haloRect(
const QskRadioBox* radioBox, const QRectF& rect ) const const QskRadioBox* radioBox, const QRectF& rect ) const
{ {
using Q = QskRadioBox; using Q = QskRadioBox;
const auto index = qFloor( radioBox->positionHint( Q::Ripple ) ); const auto index = qFloor( radioBox->positionHint( Q::Halo ) );
if( index < 0 ) if( index < 0 )
return QRectF(); return QRectF();
QRectF r; QRectF r;
r.setSize( radioBox->strutSizeHint( Q::Ripple ) ); r.setSize( radioBox->strutSizeHint( Q::Halo ) );
if ( !r.isEmpty() ) if ( !r.isEmpty() )
{ {
@ -219,12 +219,12 @@ QskAspect::States QskRadioBoxSkinlet::sampleStates(
states |= Q::Pressed; states |= Q::Pressed;
#if 1 #if 1
if( radioBox->positionHint( Q::Ripple | Q::Hovered ) == index ) if( radioBox->positionHint( Q::Halo | Q::Hovered ) == index )
states |= Q::Hovered; states |= Q::Hovered;
else else
states &= ~Q::Hovered; states &= ~Q::Hovered;
if( radioBox->positionHint( Q::Ripple ) == index ) if( radioBox->positionHint( Q::Halo ) == index )
states |= Q::Focused; states |= Q::Focused;
else else
states &= ~Q::Focused; states &= ~Q::Focused;

View File

@ -24,7 +24,7 @@ class QSK_EXPORT QskRadioBoxSkinlet : public QskSkinlet
CheckPanelRole, CheckPanelRole,
CheckIndicatorRole, CheckIndicatorRole,
TextRole, TextRole,
RippleRole, HaloRole,
RoleCount RoleCount
}; };
@ -58,7 +58,7 @@ class QSK_EXPORT QskRadioBoxSkinlet : public QskSkinlet
QRectF checkPanelRect( const QskRadioBox*, const QRectF&, int index ) const; QRectF checkPanelRect( const QskRadioBox*, const QRectF&, int index ) const;
QRectF buttonRect( const QskRadioBox*, const QRectF&, int index ) const; QRectF buttonRect( const QskRadioBox*, const QRectF&, int index ) const;
QRectF rippleRect( const QskRadioBox*, const QRectF& ) const; QRectF haloRect( const QskRadioBox*, const QRectF& ) const;
}; };
#endif #endif

View File

@ -14,7 +14,7 @@ QSK_SUBCONTROL( QskSlider, Groove )
QSK_SUBCONTROL( QskSlider, Fill ) QSK_SUBCONTROL( QskSlider, Fill )
QSK_SUBCONTROL( QskSlider, Scale ) QSK_SUBCONTROL( QskSlider, Scale )
QSK_SUBCONTROL( QskSlider, Handle ) QSK_SUBCONTROL( QskSlider, Handle )
QSK_SUBCONTROL( QskSlider, Ripple ) QSK_SUBCONTROL( QskSlider, Halo )
QSK_SUBCONTROL( QskSlider, GrooveStopIndicators ) QSK_SUBCONTROL( QskSlider, GrooveStopIndicators )
QSK_SUBCONTROL( QskSlider, FillStopIndicators ) QSK_SUBCONTROL( QskSlider, FillStopIndicators )
QSK_SUBCONTROL( QskSlider, LabelContainer ) QSK_SUBCONTROL( QskSlider, LabelContainer )

View File

@ -25,7 +25,7 @@ class QSK_EXPORT QskSlider : public QskBoundedValueInput
using Inherited = QskBoundedValueInput; using Inherited = QskBoundedValueInput;
public: public:
QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Handle, Ripple, GrooveStopIndicators, FillStopIndicators, QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Handle, Halo, GrooveStopIndicators, FillStopIndicators,
LabelContainer, LabelText ) LabelContainer, LabelText )
QSK_STATES( Pressed ) QSK_STATES( Pressed )

View File

@ -54,7 +54,7 @@ QskSliderSkinlet::QskSliderSkinlet( QskSkin* skin )
FillStopIndicatorsRole, FillStopIndicatorsRole,
GrooveStopIndicatorsRole, GrooveStopIndicatorsRole,
HandleRole, HandleRole,
RippleRole, HaloRole,
LabelContainerRole, LabelContainerRole,
LabelTextRole, LabelTextRole,
} ); } );
@ -94,9 +94,9 @@ QRectF QskSliderSkinlet::subControlRect( const QskSkinnable* skinnable,
return scaleRect( slider, contentsRect ); return scaleRect( slider, contentsRect );
} }
if ( subControl == Q::Ripple ) if ( subControl == QskSlider::Halo )
{ {
return rippleRect( slider, contentsRect ); return haloRect( slider, contentsRect );
} }
if ( subControl == Q::LabelContainer ) if ( subControl == Q::LabelContainer )
@ -213,9 +213,9 @@ QSGNode* QskSliderSkinlet::updateSubNode(
return updateBoxNode( slider, node, Q::Handle ); return updateBoxNode( slider, node, Q::Handle );
} }
case RippleRole: case HaloRole:
{ {
return updateBoxNode( slider, node, Q::Ripple ); return updateBoxNode( slider, node, Q::Halo );
} }
case LabelContainerRole: case LabelContainerRole:
@ -375,14 +375,14 @@ QRectF QskSliderSkinlet::handleRect(
return handleRect; return handleRect;
} }
QRectF QskSliderSkinlet::rippleRect( QRectF QskSliderSkinlet::haloRect(
const QskSlider* slider, const QRectF& rect ) const const QskSlider* slider, const QRectF& rect ) const
{ {
const auto rippleSize = slider->strutSizeHint( Q::Ripple ); const auto haloSize = slider->strutSizeHint( Q::Halo );
const auto handleSize = slider->strutSizeHint( Q::Handle ); const auto handleSize = slider->strutSizeHint( Q::Handle );
const auto w = ( rippleSize.width() - handleSize.width() ) / 2; const auto w = ( haloSize.width() - handleSize.width() ) / 2;
const auto h = ( rippleSize.height() - handleSize.height() ) / 2; const auto h = ( haloSize.height() - handleSize.height() ) / 2;
auto r = handleRect( slider, rect ); auto r = handleRect( slider, rect );
r = r.marginsAdded( { w, h, w, h } ); r = r.marginsAdded( { w, h, w, h } );

View File

@ -25,7 +25,7 @@ class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
GrooveStopIndicatorsRole, GrooveStopIndicatorsRole,
FillStopIndicatorsRole, FillStopIndicatorsRole,
HandleRole, HandleRole,
RippleRole, HaloRole,
LabelContainerRole, LabelContainerRole,
LabelTextRole, LabelTextRole,
@ -62,7 +62,7 @@ class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
QRectF fillRect( const QskSlider*, const QRectF& ) const; QRectF fillRect( const QskSlider*, const QRectF& ) const;
QRectF handleRect( const QskSlider*, const QRectF& ) const; QRectF handleRect( const QskSlider*, const QRectF& ) const;
QRectF scaleRect( const QskSlider*, const QRectF& ) const; QRectF scaleRect( const QskSlider*, const QRectF& ) const;
QRectF rippleRect( const QskSlider*, const QRectF& ) const; QRectF haloRect( const QskSlider*, const QRectF& ) const;
QRectF labelContainerRect( const QskSlider*, const QRectF& ) const; QRectF labelContainerRect( const QskSlider*, const QRectF& ) const;
QRectF innerRect( const QskSlider*, const QRectF&, QskAspect::Subcontrol ) const; QRectF innerRect( const QskSlider*, const QRectF&, QskAspect::Subcontrol ) const;

View File

@ -7,7 +7,7 @@
QSK_SUBCONTROL( QskSwitchButton, Handle ) QSK_SUBCONTROL( QskSwitchButton, Handle )
QSK_SUBCONTROL( QskSwitchButton, Groove ) QSK_SUBCONTROL( QskSwitchButton, Groove )
QSK_SUBCONTROL( QskSwitchButton, Ripple ) QSK_SUBCONTROL( QskSwitchButton, Halo )
struct QskSwitchButton::PrivateData struct QskSwitchButton::PrivateData
{ {

View File

@ -22,7 +22,7 @@ class QSK_EXPORT QskSwitchButton : public QskAbstractButton
WRITE setInverted NOTIFY invertedChanged FINAL ) WRITE setInverted NOTIFY invertedChanged FINAL )
public: public:
QSK_SUBCONTROLS( Groove, Handle, Ripple ) QSK_SUBCONTROLS( Groove, Handle, Halo )
QskSwitchButton( Qt::Orientation, QQuickItem* parent = nullptr ); QskSwitchButton( Qt::Orientation, QQuickItem* parent = nullptr );
QskSwitchButton( QQuickItem* parent = nullptr ); QskSwitchButton( QQuickItem* parent = nullptr );

View File

@ -26,7 +26,7 @@ static inline qreal qskEffectivePosition( const QskSwitchButton* switchButton )
QskSwitchButtonSkinlet::QskSwitchButtonSkinlet( QskSkin* skin ) QskSwitchButtonSkinlet::QskSwitchButtonSkinlet( QskSkin* skin )
: Inherited( skin ) : Inherited( skin )
{ {
setNodeRoles( { GrooveRole, HandleRole, RippleRole } ); setNodeRoles( { GrooveRole, HandleRole, HaloRole } );
} }
QskSwitchButtonSkinlet::~QskSwitchButtonSkinlet() QskSwitchButtonSkinlet::~QskSwitchButtonSkinlet()
@ -48,9 +48,9 @@ QRectF QskSwitchButtonSkinlet::subControlRect( const QskSkinnable* skinnable,
return grooveRect( skinnable, contentsRect ); return grooveRect( skinnable, contentsRect );
} }
if ( subControl == Q::Ripple ) if ( subControl == Q::Halo )
{ {
return rippleRect( skinnable, contentsRect ); return haloRect( skinnable, contentsRect );
} }
@ -63,12 +63,12 @@ QSizeF QskSwitchButtonSkinlet::sizeHint( const QskSkinnable* skinnable,
if ( which != Qt::PreferredSize ) if ( which != Qt::PreferredSize )
return QSizeF(); return QSizeF();
auto grooveHint = skinnable->strutSizeHint( QskSwitchButton::Groove ); const auto grooveHint = skinnable->strutSizeHint( QskSwitchButton::Groove );
auto handleHint = skinnable->strutSizeHint( QskSwitchButton::Handle ); const auto handleHint = skinnable->strutSizeHint( QskSwitchButton::Handle );
auto rippleHint = skinnable->strutSizeHint( QskSwitchButton::Ripple ); const auto haloHint = skinnable->strutSizeHint( QskSwitchButton::Halo );
auto hint = grooveHint; auto hint = grooveHint;
hint = hint.expandedTo( rippleHint ); hint = hint.expandedTo( haloHint );
hint = hint.expandedTo( handleHint ); hint = hint.expandedTo( handleHint );
return hint; return hint;
@ -81,8 +81,8 @@ QSGNode* QskSwitchButtonSkinlet::updateSubNode( const QskSkinnable* skinnable,
switch ( nodeRole ) switch ( nodeRole )
{ {
case RippleRole: case HaloRole:
return updateBoxNode( skinnable, node, Q::Ripple ); return updateBoxNode( skinnable, node, Q::Halo );
case HandleRole: case HandleRole:
return updateBoxNode( skinnable, node, Q::Handle ); return updateBoxNode( skinnable, node, Q::Handle );
@ -166,7 +166,7 @@ QRectF QskSwitchButtonSkinlet::handleRect(
return r; return r;
} }
QRectF QskSwitchButtonSkinlet::rippleRect( QRectF QskSwitchButtonSkinlet::haloRect(
const QskSkinnable* skinnable, const QRectF& contentsRect ) const const QskSkinnable* skinnable, const QRectF& contentsRect ) const
{ {
using Q = QskSwitchButton; using Q = QskSwitchButton;
@ -176,7 +176,7 @@ QRectF QskSwitchButtonSkinlet::rippleRect(
const auto grooveRect = subControlRect( skinnable, contentsRect, Q::Groove ); const auto grooveRect = subControlRect( skinnable, contentsRect, Q::Groove );
const auto pos = qskEffectivePosition( switchButton ); const auto pos = qskEffectivePosition( switchButton );
const auto sizeHandle = skinnable->strutSizeHint( Q::Handle ); const auto sizeHandle = skinnable->strutSizeHint( Q::Handle );
const auto sizeRipple = skinnable->strutSizeHint( Q::Ripple ); const auto sizeHalo = skinnable->strutSizeHint( Q::Halo );
qreal cx, cy; qreal cx, cy;
@ -198,7 +198,7 @@ QRectF QskSwitchButtonSkinlet::rippleRect(
} }
QRectF r; QRectF r;
r.setSize( sizeRipple ); r.setSize( sizeHalo );
r.moveCenter( QPointF( cx, cy ) ); r.moveCenter( QPointF( cx, cy ) );
return r; return r;

View File

@ -19,7 +19,7 @@ class QSK_EXPORT QskSwitchButtonSkinlet : public QskSkinlet
{ {
GrooveRole, GrooveRole,
HandleRole, HandleRole,
RippleRole, HaloRole,
RoleCount RoleCount
}; };
@ -40,7 +40,7 @@ class QSK_EXPORT QskSwitchButtonSkinlet : public QskSkinlet
private: private:
QRectF grooveRect( const QskSkinnable*, const QRectF& ) const; QRectF grooveRect( const QskSkinnable*, const QRectF& ) const;
QRectF handleRect( const QskSkinnable*, const QRectF& ) const; QRectF handleRect( const QskSkinnable*, const QRectF& ) const;
QRectF rippleRect( const QskSkinnable*, const QRectF& ) const; QRectF haloRect( const QskSkinnable*, const QRectF& ) const;
}; };
#endif #endif