using halo instead of ripple
This commit is contained in:
parent
c5f8c549d3
commit
f3aed21a23
@ -1445,12 +1445,11 @@ void Editor::setupSliderMetrics()
|
||||
setBoxShape( Q::Handle, 100, Qt::RelativeSize );
|
||||
setBoxBorderMetrics( Q::Handle, 1_px );
|
||||
|
||||
setStrutSize( Q::Ripple, { 12_px, 12_px } );
|
||||
setBoxShape( Q::Ripple, 100, Qt::RelativeSize );
|
||||
setStrutSize( Q::Halo, { 12_px, 12_px } );
|
||||
setBoxShape( Q::Halo, 100, Qt::RelativeSize );
|
||||
|
||||
setStrutSize( Q::Ripple | Q::Hovered, { 14_px, 14_px } );
|
||||
|
||||
setStrutSize( Q::Ripple | Q::Pressed, { 10_px, 10_px } );
|
||||
setStrutSize( Q::Halo | Q::Hovered, { 14_px, 14_px } );
|
||||
setStrutSize( Q::Halo | Q::Pressed, { 10_px, 10_px } );
|
||||
}
|
||||
|
||||
void Editor::setupSliderColors(
|
||||
@ -1470,32 +1469,32 @@ void Editor::setupSliderColors(
|
||||
|
||||
for ( auto state : { A::NoState, Q::Pressed, Q::Disabled } )
|
||||
{
|
||||
QRgb grooveColor, fillColor, rippleColor;
|
||||
QRgb grooveColor, fillColor, haloColor;
|
||||
|
||||
if ( state == A::NoState )
|
||||
{
|
||||
grooveColor = pal.fillColor.controlStrong.defaultColor;
|
||||
fillColor = pal.fillColor.accent.defaultColor;
|
||||
rippleColor = fillColor;
|
||||
haloColor = fillColor;
|
||||
}
|
||||
else if ( state == Q::Pressed )
|
||||
{
|
||||
grooveColor = pal.fillColor.controlStrong.defaultColor;
|
||||
fillColor = pal.fillColor.accent.defaultColor;
|
||||
rippleColor = pal.fillColor.accent.tertiary;
|
||||
haloColor = pal.fillColor.accent.tertiary;
|
||||
}
|
||||
else if ( state == Q::Disabled )
|
||||
{
|
||||
grooveColor = pal.fillColor.controlStrong.disabled;
|
||||
fillColor = pal.fillColor.accent.disabled;
|
||||
rippleColor = grooveColor;
|
||||
haloColor = grooveColor;
|
||||
}
|
||||
|
||||
grooveColor = rgbSolid( grooveColor, pal.background.solid.base );
|
||||
|
||||
setGradient( Q::Groove | section | state, grooveColor );
|
||||
setGradient( Q::Fill | section | state, fillColor );
|
||||
setGradient( Q::Ripple | section | state, rippleColor );
|
||||
setGradient( Q::Halo | section | state, haloColor );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -489,7 +489,7 @@ void Editor::setupRadioBox()
|
||||
|
||||
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
|
||||
|
||||
setBoxBorderMetrics( Q::CheckIndicatorPanel, 1_dp );
|
||||
|
@ -232,9 +232,9 @@ void Editor::setupCheckBox()
|
||||
setSymbol( aspect | Q::Error, checkMark );
|
||||
}
|
||||
|
||||
setStrutSize( Q::Ripple, 40_dp, 40_dp );
|
||||
setBoxShape( Q::Ripple, 100, Qt::RelativeSize );
|
||||
setGradient( Q::Ripple, Qt::transparent );
|
||||
setStrutSize( Q::Halo, 40_dp, 40_dp );
|
||||
setBoxShape( Q::Halo, 100, Qt::RelativeSize );
|
||||
setGradient( Q::Halo, Qt::transparent );
|
||||
|
||||
setColor( Q::Text, m_pal.onBackground ); // not mentioned in the specs
|
||||
|
||||
@ -252,25 +252,25 @@ void Editor::setupCheckBox()
|
||||
|
||||
// 3. Hovered
|
||||
|
||||
setGradient( Q::Ripple | Q::Hovered | Q::Checked, m_pal.primary8 );
|
||||
setGradient( Q::Ripple | Q::Hovered, m_pal.onSurface8 );
|
||||
setGradient( Q::Ripple | Q::Error | Q::Hovered, m_pal.error8 );
|
||||
setGradient( Q::Ripple | Q::Error | Q::Hovered | Q::Checked, m_pal.error8 );
|
||||
setGradient( Q::Halo | Q::Hovered | Q::Checked, m_pal.primary8 );
|
||||
setGradient( Q::Halo | Q::Hovered, m_pal.onSurface8 );
|
||||
setGradient( Q::Halo | Q::Error | Q::Hovered, m_pal.error8 );
|
||||
setGradient( Q::Halo | Q::Error | Q::Hovered | Q::Checked, m_pal.error8 );
|
||||
|
||||
// 4. Focused
|
||||
|
||||
setGradient( Q::Ripple | Q::Focused | Q::Checked, m_pal.primary12 );
|
||||
setGradient( Q::Ripple | Q::Focused, m_pal.onSurface12 );
|
||||
setGradient( Q::Ripple | Q::Error | Q::Focused, m_pal.error12 );
|
||||
setGradient( Q::Ripple | Q::Error | Q::Focused | Q::Checked, m_pal.error12 );
|
||||
setGradient( Q::Halo | Q::Focused | Q::Checked, m_pal.primary12 );
|
||||
setGradient( Q::Halo | Q::Focused, m_pal.onSurface12 );
|
||||
setGradient( Q::Halo | Q::Error | Q::Focused, m_pal.error12 );
|
||||
setGradient( Q::Halo | Q::Error | Q::Focused | Q::Checked, m_pal.error12 );
|
||||
|
||||
// 5. Pressed
|
||||
|
||||
setGradient( Q::Ripple | Q::Pressed, m_pal.primary12 );
|
||||
setGradient( Q::Ripple | Q::Pressed | Q::Checked, m_pal.primary12 );
|
||||
setGradient( Q::Ripple | Q::Hovered | Q::Pressed, m_pal.primary12 );
|
||||
setGradient( Q::Ripple | Q::Error | Q::Pressed, m_pal.error12 );
|
||||
setGradient( Q::Ripple | Q::Error | Q::Pressed | Q::Checked, m_pal.error12 );
|
||||
setGradient( Q::Halo | Q::Pressed, m_pal.primary12 );
|
||||
setGradient( Q::Halo | Q::Pressed | Q::Checked, m_pal.primary12 );
|
||||
setGradient( Q::Halo | Q::Hovered | Q::Pressed, m_pal.primary12 );
|
||||
setGradient( Q::Halo | Q::Error | Q::Pressed, m_pal.error12 );
|
||||
setGradient( Q::Halo | Q::Error | Q::Pressed | Q::Checked, m_pal.error12 );
|
||||
}
|
||||
|
||||
void Editor::setupComboBox()
|
||||
@ -480,9 +480,9 @@ void Editor::setupRadioBox()
|
||||
setSpacing( Q::Button, 10_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
|
||||
|
||||
setBoxBorderMetrics( Q::CheckIndicatorPanel, 2_dp );
|
||||
@ -494,8 +494,8 @@ void Editor::setupRadioBox()
|
||||
setColor( Q::Text, m_pal.onBackground );
|
||||
setColor( Q::Text | Q::Disabled, m_pal.onSurface38 );
|
||||
|
||||
setColor( Q::Ripple, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) );
|
||||
setColor( Q::Ripple | Q::Selected,
|
||||
setColor( Q::Halo, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) );
|
||||
setColor( Q::Halo | Q::Selected,
|
||||
stateLayerColor( m_pal.primary, m_pal.focusOpacity ) );
|
||||
|
||||
setColor( Q::CheckIndicator, Qt::transparent);
|
||||
@ -509,7 +509,7 @@ void Editor::setupRadioBox()
|
||||
setBoxBorderColors(
|
||||
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()
|
||||
@ -881,11 +881,11 @@ void Editor::setupSlider()
|
||||
const auto disabledColor = flattenedColor( m_pal.onSurface, m_pal.background, 0.38 );
|
||||
setGradient( Q::Handle | Q::Disabled, disabledColor );
|
||||
|
||||
setStrutSize( Q::Ripple, 40_dp, 40_dp );
|
||||
setBoxShape( Q::Ripple, 100, Qt::RelativeSize );
|
||||
setGradient( Q::Ripple, Qt::transparent );
|
||||
setGradient( Q::Ripple | Q::Hovered, m_pal.primary12 );
|
||||
setGradient( Q::Ripple | Q::Pressed, m_pal.primary12 );
|
||||
setStrutSize( Q::Halo, 40_dp, 40_dp );
|
||||
setBoxShape( Q::Halo, 100, Qt::RelativeSize );
|
||||
setGradient( Q::Halo, Qt::transparent );
|
||||
setGradient( Q::Halo | Q::Hovered, m_pal.primary12 );
|
||||
setGradient( Q::Halo | Q::Pressed, m_pal.primary12 );
|
||||
|
||||
// move the handle smoothly, when using keys
|
||||
setAnimation( Q::Handle | A::Metric | A::Position, 2 * qskDuration );
|
||||
@ -1003,13 +1003,13 @@ void Editor::setupSwitchButton()
|
||||
setGradient( Q::Handle | Q::Disabled | Q::Checked, m_pal.surface );
|
||||
|
||||
// just to keep the strut size the same at all times:
|
||||
setStrutSize( Q::Ripple, 40_dp, 40_dp );
|
||||
setGradient( Q::Ripple, Qt::transparent );
|
||||
setStrutSize( Q::Halo, 40_dp, 40_dp );
|
||||
setGradient( Q::Halo, Qt::transparent );
|
||||
|
||||
setStrutSize( Q::Ripple | Q::Hovered, 40_dp, 40_dp );
|
||||
setBoxShape( Q::Ripple, 100, Qt::RelativeSize );
|
||||
setGradient( Q::Ripple | Q::Hovered, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) );
|
||||
setGradient( Q::Ripple | Q::Hovered | Q::Checked,
|
||||
setStrutSize( Q::Halo | Q::Hovered, 40_dp, 40_dp );
|
||||
setBoxShape( Q::Halo, 100, Qt::RelativeSize );
|
||||
setGradient( Q::Halo | Q::Hovered, stateLayerColor( m_pal.onSurface, m_pal.focusOpacity ) );
|
||||
setGradient( Q::Halo | Q::Hovered | Q::Checked,
|
||||
stateLayerColor( m_pal.primary, m_pal.focusOpacity ) );
|
||||
|
||||
setBoxBorderColors( Q::Handle, m_pal.outline );
|
||||
|
@ -9,7 +9,7 @@ QSK_SUBCONTROL( QskCheckBox, Panel )
|
||||
QSK_SUBCONTROL( QskCheckBox, Box )
|
||||
QSK_SUBCONTROL( QskCheckBox, Indicator )
|
||||
QSK_SUBCONTROL( QskCheckBox, Text )
|
||||
QSK_SUBCONTROL( QskCheckBox, Ripple )
|
||||
QSK_SUBCONTROL( QskCheckBox, Halo )
|
||||
|
||||
QSK_SYSTEM_STATE( QskCheckBox, Error, QskAspect::FirstSystemState << 1 )
|
||||
|
||||
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskCheckBox : public QskAbstractButton
|
||||
using Inherited = QskAbstractButton;
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Box, Indicator, Text, Ripple )
|
||||
QSK_SUBCONTROLS( Panel, Box, Indicator, Text, Halo )
|
||||
QSK_STATES( Error )
|
||||
|
||||
QskCheckBox( QQuickItem* parent = nullptr );
|
||||
|
@ -11,7 +11,7 @@
|
||||
QskCheckBoxSkinlet::QskCheckBoxSkinlet( QskSkin* skin )
|
||||
: QskSkinlet( skin )
|
||||
{
|
||||
setNodeRoles( { BoxRole, IndicatorRole, TextRole, RippleRole } );
|
||||
setNodeRoles( { BoxRole, IndicatorRole, TextRole, HaloRole } );
|
||||
}
|
||||
|
||||
QskCheckBoxSkinlet::~QskCheckBoxSkinlet()
|
||||
@ -40,8 +40,8 @@ QRectF QskCheckBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
if ( subControl == Q::Text )
|
||||
return textRect( checkBox, contentsRect );
|
||||
|
||||
if ( subControl == Q::Ripple )
|
||||
return rippleRect( checkBox, contentsRect );
|
||||
if ( subControl == Q::Halo )
|
||||
return haloRect( checkBox, contentsRect );
|
||||
|
||||
return contentsRect;
|
||||
}
|
||||
@ -83,14 +83,14 @@ QRectF QskCheckBoxSkinlet::boxRect(
|
||||
return r;
|
||||
}
|
||||
|
||||
QRectF QskCheckBoxSkinlet::rippleRect(
|
||||
QRectF QskCheckBoxSkinlet::haloRect(
|
||||
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 w = ( rippleSize.width() - boxSize.width() ) / 2;
|
||||
const auto h = ( rippleSize.height() - boxSize.height() ) / 2;
|
||||
const auto w = ( haloSize.width() - boxSize.width() ) / 2;
|
||||
const auto h = ( haloSize.height() - boxSize.height() ) / 2;
|
||||
|
||||
auto r = boxRect( checkBox, rect );
|
||||
r = r.marginsAdded( { w, h, w, h } );
|
||||
@ -119,8 +119,8 @@ QSGNode* QskCheckBoxSkinlet::updateSubNode(
|
||||
case TextRole:
|
||||
return updateTextNode( checkBox, node );
|
||||
|
||||
case RippleRole:
|
||||
return updateBoxNode( checkBox, node, Q::Ripple );
|
||||
case HaloRole:
|
||||
return updateBoxNode( checkBox, node, Q::Halo );
|
||||
}
|
||||
|
||||
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
||||
|
@ -23,7 +23,7 @@ class QSK_EXPORT QskCheckBoxSkinlet : public QskSkinlet
|
||||
BoxRole,
|
||||
IndicatorRole,
|
||||
TextRole,
|
||||
RippleRole,
|
||||
HaloRole,
|
||||
|
||||
RoleCount
|
||||
};
|
||||
@ -44,7 +44,7 @@ class QSK_EXPORT QskCheckBoxSkinlet : public QskSkinlet
|
||||
private:
|
||||
QRectF textRect( 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;
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ QSK_SUBCONTROL( QskRadioBox, Button )
|
||||
QSK_SUBCONTROL( QskRadioBox, CheckIndicatorPanel )
|
||||
QSK_SUBCONTROL( QskRadioBox, CheckIndicator )
|
||||
QSK_SUBCONTROL( QskRadioBox, Text )
|
||||
QSK_SUBCONTROL( QskRadioBox, Ripple )
|
||||
QSK_SUBCONTROL( QskRadioBox, Halo )
|
||||
|
||||
QSK_STATE( QskRadioBox, Selected, QskAspect::FirstUserState << 1 )
|
||||
QSK_STATE( QskRadioBox, Pressed, QskAspect::FirstUserState << 2 )
|
||||
@ -38,7 +38,7 @@ QskRadioBox::QskRadioBox( QQuickItem* parent )
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
setAcceptedMouseButtons( Qt::LeftButton );
|
||||
|
||||
setPositionHint( Ripple, -1 );
|
||||
setPositionHint( Halo, -1 );
|
||||
|
||||
setAcceptHoverEvents( true );
|
||||
}
|
||||
@ -182,7 +182,7 @@ void QskRadioBox::keyPressEvent( QKeyEvent* event )
|
||||
{
|
||||
setFocusedIndex( nextTabIndex );
|
||||
|
||||
const auto aspect = Ripple | QskAspect::Metric | QskAspect::Position;
|
||||
const auto aspect = Halo | QskAspect::Metric | QskAspect::Position;
|
||||
const auto hint = animationHint( aspect | skinStates() );
|
||||
|
||||
if( hint.isValid() )
|
||||
@ -277,7 +277,7 @@ void QskRadioBox::setHoveredIndex( int index )
|
||||
return;
|
||||
|
||||
m_data->hoveredIndex = index;
|
||||
setPositionHint( Ripple | Hovered, index );
|
||||
setPositionHint( Halo | Hovered, index );
|
||||
|
||||
update();
|
||||
}
|
||||
@ -288,7 +288,7 @@ void QskRadioBox::setFocusedIndex( int index )
|
||||
return;
|
||||
|
||||
m_data->focusedIndex = index;
|
||||
setPositionHint( Ripple, index );
|
||||
setPositionHint( Halo, index );
|
||||
|
||||
update();
|
||||
|
||||
|
@ -22,7 +22,7 @@ class QSK_EXPORT QskRadioBox : public QskControl
|
||||
using Inherited = QskControl;
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Button, CheckIndicatorPanel, CheckIndicator, Text, Ripple )
|
||||
QSK_SUBCONTROLS( Panel, Button, CheckIndicatorPanel, CheckIndicator, Text, Halo )
|
||||
QSK_STATES( Selected, Pressed )
|
||||
|
||||
QskRadioBox( QQuickItem* parent = nullptr );
|
||||
|
@ -40,7 +40,7 @@ namespace
|
||||
QskRadioBoxSkinlet::QskRadioBoxSkinlet( QskSkin* )
|
||||
{
|
||||
setNodeRoles( { PanelRole, ButtonRole, CheckPanelRole,
|
||||
CheckIndicatorRole, TextRole, RippleRole } );
|
||||
CheckIndicatorRole, TextRole, HaloRole } );
|
||||
}
|
||||
|
||||
QskRadioBoxSkinlet::~QskRadioBoxSkinlet()
|
||||
@ -54,8 +54,8 @@ QRectF QskRadioBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
|
||||
auto radioBox = static_cast< const QskRadioBox* >( skinnable );
|
||||
|
||||
if( subcontrol == Q::Ripple )
|
||||
return rippleRect( radioBox, contentsRect );
|
||||
if( subcontrol == Q::Halo )
|
||||
return haloRect( radioBox, contentsRect );
|
||||
|
||||
return contentsRect;
|
||||
}
|
||||
@ -82,8 +82,8 @@ QSGNode* QskRadioBoxSkinlet::updateSubNode( const QskSkinnable* skinnable,
|
||||
case TextRole:
|
||||
return updateSeriesNode( skinnable, Q::Text, node );
|
||||
|
||||
case RippleRole:
|
||||
return updateBoxNode( skinnable, node, Q::Ripple );
|
||||
case HaloRole:
|
||||
return updateBoxNode( skinnable, node, Q::Halo );
|
||||
}
|
||||
|
||||
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
||||
@ -96,17 +96,17 @@ int QskRadioBoxSkinlet::sampleCount(
|
||||
return radioBox->options().count();
|
||||
}
|
||||
|
||||
QRectF QskRadioBoxSkinlet::rippleRect(
|
||||
QRectF QskRadioBoxSkinlet::haloRect(
|
||||
const QskRadioBox* radioBox, const QRectF& rect ) const
|
||||
{
|
||||
using Q = QskRadioBox;
|
||||
|
||||
const auto index = qFloor( radioBox->positionHint( Q::Ripple ) );
|
||||
const auto index = qFloor( radioBox->positionHint( Q::Halo ) );
|
||||
if( index < 0 )
|
||||
return QRectF();
|
||||
|
||||
QRectF r;
|
||||
r.setSize( radioBox->strutSizeHint( Q::Ripple ) );
|
||||
r.setSize( radioBox->strutSizeHint( Q::Halo ) );
|
||||
|
||||
if ( !r.isEmpty() )
|
||||
{
|
||||
@ -219,12 +219,12 @@ QskAspect::States QskRadioBoxSkinlet::sampleStates(
|
||||
states |= Q::Pressed;
|
||||
|
||||
#if 1
|
||||
if( radioBox->positionHint( Q::Ripple | Q::Hovered ) == index )
|
||||
if( radioBox->positionHint( Q::Halo | Q::Hovered ) == index )
|
||||
states |= Q::Hovered;
|
||||
else
|
||||
states &= ~Q::Hovered;
|
||||
|
||||
if( radioBox->positionHint( Q::Ripple ) == index )
|
||||
if( radioBox->positionHint( Q::Halo ) == index )
|
||||
states |= Q::Focused;
|
||||
else
|
||||
states &= ~Q::Focused;
|
||||
|
@ -24,7 +24,7 @@ class QSK_EXPORT QskRadioBoxSkinlet : public QskSkinlet
|
||||
CheckPanelRole,
|
||||
CheckIndicatorRole,
|
||||
TextRole,
|
||||
RippleRole,
|
||||
HaloRole,
|
||||
|
||||
RoleCount
|
||||
};
|
||||
@ -58,7 +58,7 @@ class QSK_EXPORT QskRadioBoxSkinlet : public QskSkinlet
|
||||
QRectF checkPanelRect( 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
|
||||
|
@ -14,7 +14,7 @@ QSK_SUBCONTROL( QskSlider, Groove )
|
||||
QSK_SUBCONTROL( QskSlider, Fill )
|
||||
QSK_SUBCONTROL( QskSlider, Scale )
|
||||
QSK_SUBCONTROL( QskSlider, Handle )
|
||||
QSK_SUBCONTROL( QskSlider, Ripple )
|
||||
QSK_SUBCONTROL( QskSlider, Halo )
|
||||
|
||||
QSK_SYSTEM_STATE( QskSlider, Pressed, QskAspect::FirstSystemState << 2 )
|
||||
|
||||
|
@ -25,7 +25,7 @@ class QSK_EXPORT QskSlider : public QskBoundedValueInput
|
||||
using Inherited = QskBoundedValueInput;
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Handle, Ripple )
|
||||
QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Handle, Halo )
|
||||
QSK_STATES( Pressed )
|
||||
|
||||
explicit QskSlider( QQuickItem* parent = nullptr );
|
||||
|
@ -31,7 +31,7 @@ static inline QRectF qskInnerPanelRect(
|
||||
QskSliderSkinlet::QskSliderSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
setNodeRoles( { PanelRole, GrooveRole, FillRole, HandleRole, RippleRole } );
|
||||
setNodeRoles( { PanelRole, GrooveRole, FillRole, HandleRole, HaloRole } );
|
||||
}
|
||||
|
||||
QskSliderSkinlet::~QskSliderSkinlet()
|
||||
@ -68,9 +68,9 @@ QRectF QskSliderSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
return scaleRect( slider, contentsRect );
|
||||
}
|
||||
|
||||
if ( subControl == QskSlider::Ripple )
|
||||
if ( subControl == QskSlider::Halo )
|
||||
{
|
||||
return rippleRect( slider, contentsRect );
|
||||
return haloRect( slider, contentsRect );
|
||||
}
|
||||
|
||||
return Inherited::subControlRect( skinnable, contentsRect, subControl );
|
||||
@ -103,9 +103,9 @@ QSGNode* QskSliderSkinlet::updateSubNode(
|
||||
return updateBoxNode( slider, node, QskSlider::Handle );
|
||||
}
|
||||
|
||||
case RippleRole:
|
||||
case HaloRole:
|
||||
{
|
||||
return updateBoxNode( slider, node, QskSlider::Ripple );
|
||||
return updateBoxNode( slider, node, QskSlider::Halo );
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,14 +233,14 @@ QRectF QskSliderSkinlet::handleRect(
|
||||
return handleRect;
|
||||
}
|
||||
|
||||
QRectF QskSliderSkinlet::rippleRect(
|
||||
QRectF QskSliderSkinlet::haloRect(
|
||||
const QskSlider* slider, const QRectF& rect ) const
|
||||
{
|
||||
const auto rippleSize = slider->strutSizeHint( QskSlider::Ripple );
|
||||
const auto haloSize = slider->strutSizeHint( QskSlider::Halo );
|
||||
const auto handleSize = slider->strutSizeHint( QskSlider::Handle );
|
||||
|
||||
const auto w = ( rippleSize.width() - handleSize.width() ) / 2;
|
||||
const auto h = ( rippleSize.height() - handleSize.height() ) / 2;
|
||||
const auto w = ( haloSize.width() - handleSize.width() ) / 2;
|
||||
const auto h = ( haloSize.height() - handleSize.height() ) / 2;
|
||||
|
||||
auto r = handleRect( slider, rect );
|
||||
r = r.marginsAdded( { w, h, w, h } );
|
||||
|
@ -23,7 +23,7 @@ class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
|
||||
GrooveRole,
|
||||
FillRole,
|
||||
HandleRole,
|
||||
RippleRole,
|
||||
HaloRole,
|
||||
|
||||
RoleCount
|
||||
};
|
||||
@ -47,7 +47,7 @@ class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
|
||||
QRectF fillRect( const QskSlider*, const QRectF& ) const;
|
||||
QRectF handleRect( 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 innerRect( const QskSlider*, const QRectF&, QskAspect::Subcontrol ) const;
|
||||
};
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
QSK_SUBCONTROL( QskSwitchButton, Handle )
|
||||
QSK_SUBCONTROL( QskSwitchButton, Groove )
|
||||
QSK_SUBCONTROL( QskSwitchButton, Ripple )
|
||||
QSK_SUBCONTROL( QskSwitchButton, Halo )
|
||||
|
||||
struct QskSwitchButton::PrivateData
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ class QSK_EXPORT QskSwitchButton : public QskAbstractButton
|
||||
WRITE setInverted NOTIFY invertedChanged FINAL )
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Groove, Handle, Ripple )
|
||||
QSK_SUBCONTROLS( Groove, Handle, Halo )
|
||||
|
||||
QskSwitchButton( Qt::Orientation, QQuickItem* parent = nullptr );
|
||||
QskSwitchButton( QQuickItem* parent = nullptr );
|
||||
|
@ -26,7 +26,7 @@ static inline qreal qskEffectivePosition( const QskSwitchButton* switchButton )
|
||||
QskSwitchButtonSkinlet::QskSwitchButtonSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
setNodeRoles( { GrooveRole, HandleRole, RippleRole } );
|
||||
setNodeRoles( { GrooveRole, HandleRole, HaloRole } );
|
||||
}
|
||||
|
||||
QskSwitchButtonSkinlet::~QskSwitchButtonSkinlet()
|
||||
@ -48,9 +48,9 @@ QRectF QskSwitchButtonSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
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 )
|
||||
return QSizeF();
|
||||
|
||||
auto grooveHint = skinnable->strutSizeHint( QskSwitchButton::Groove );
|
||||
auto handleHint = skinnable->strutSizeHint( QskSwitchButton::Handle );
|
||||
auto rippleHint = skinnable->strutSizeHint( QskSwitchButton::Ripple );
|
||||
const auto grooveHint = skinnable->strutSizeHint( QskSwitchButton::Groove );
|
||||
const auto handleHint = skinnable->strutSizeHint( QskSwitchButton::Handle );
|
||||
const auto haloHint = skinnable->strutSizeHint( QskSwitchButton::Halo );
|
||||
|
||||
auto hint = grooveHint;
|
||||
hint = hint.expandedTo( rippleHint );
|
||||
hint = hint.expandedTo( haloHint );
|
||||
hint = hint.expandedTo( handleHint );
|
||||
|
||||
return hint;
|
||||
@ -81,8 +81,8 @@ QSGNode* QskSwitchButtonSkinlet::updateSubNode( const QskSkinnable* skinnable,
|
||||
|
||||
switch ( nodeRole )
|
||||
{
|
||||
case RippleRole:
|
||||
return updateBoxNode( skinnable, node, Q::Ripple );
|
||||
case HaloRole:
|
||||
return updateBoxNode( skinnable, node, Q::Halo );
|
||||
|
||||
case HandleRole:
|
||||
return updateBoxNode( skinnable, node, Q::Handle );
|
||||
@ -166,7 +166,7 @@ QRectF QskSwitchButtonSkinlet::handleRect(
|
||||
return r;
|
||||
}
|
||||
|
||||
QRectF QskSwitchButtonSkinlet::rippleRect(
|
||||
QRectF QskSwitchButtonSkinlet::haloRect(
|
||||
const QskSkinnable* skinnable, const QRectF& contentsRect ) const
|
||||
{
|
||||
using Q = QskSwitchButton;
|
||||
@ -176,7 +176,7 @@ QRectF QskSwitchButtonSkinlet::rippleRect(
|
||||
const auto grooveRect = subControlRect( skinnable, contentsRect, Q::Groove );
|
||||
const auto pos = qskEffectivePosition( switchButton );
|
||||
const auto sizeHandle = skinnable->strutSizeHint( Q::Handle );
|
||||
const auto sizeRipple = skinnable->strutSizeHint( Q::Ripple );
|
||||
const auto sizeHalo = skinnable->strutSizeHint( Q::Halo );
|
||||
|
||||
qreal cx, cy;
|
||||
|
||||
@ -198,7 +198,7 @@ QRectF QskSwitchButtonSkinlet::rippleRect(
|
||||
}
|
||||
|
||||
QRectF r;
|
||||
r.setSize( sizeRipple );
|
||||
r.setSize( sizeHalo );
|
||||
r.moveCenter( QPointF( cx, cy ) );
|
||||
|
||||
return r;
|
||||
|
@ -19,7 +19,7 @@ class QSK_EXPORT QskSwitchButtonSkinlet : public QskSkinlet
|
||||
{
|
||||
GrooveRole,
|
||||
HandleRole,
|
||||
RippleRole,
|
||||
HaloRole,
|
||||
|
||||
RoleCount
|
||||
};
|
||||
@ -40,7 +40,7 @@ class QSK_EXPORT QskSwitchButtonSkinlet : public QskSkinlet
|
||||
private:
|
||||
QRectF grooveRect( 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user