M3 radiobox setup simplified
This commit is contained in:
parent
99b4bddac9
commit
33980a5887
@ -501,32 +501,11 @@ void Editor::setupRadioBox()
|
|||||||
|
|
||||||
setShadowMetrics( aspect, { 10_dp, 0 } );
|
setShadowMetrics( aspect, { 10_dp, 0 } );
|
||||||
|
|
||||||
QRgb rgb;
|
auto rgb = ( state2 == Q::Selected ) ? m_pal.primary : m_pal.onSurface;
|
||||||
|
rgb = stateLayerColor( rgb, m_pal.stateOpacity( state1 ) );
|
||||||
if ( state1 == Q::Hovered )
|
|
||||||
{
|
|
||||||
rgb = ( state2 == Q::Selected ) ? m_pal.primary8 : m_pal.onSurface8;
|
|
||||||
rgb = stateLayerColor( rgb, m_pal.hoverOpacity );
|
|
||||||
|
|
||||||
setShadowColor( aspect, rgb );
|
setShadowColor( aspect, rgb );
|
||||||
}
|
}
|
||||||
else if ( state1 == Q::Focused )
|
|
||||||
{
|
|
||||||
rgb = ( state2 == Q::Selected ) ? m_pal.primary12 : m_pal.onSurface12;
|
|
||||||
rgb = stateLayerColor( rgb, m_pal.focusOpacity );
|
|
||||||
|
|
||||||
setShadowColor( aspect, rgb );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rgb = ( state2 == Q::Selected ) ? m_pal.onSurface12 : m_pal.primary12;
|
|
||||||
rgb = stateLayerColor( rgb, m_pal.pressedOpacity );
|
|
||||||
|
|
||||||
setShadowColor( aspect, rgb );
|
|
||||||
setShadowColor( aspect | Q::Focused, rgb );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setColor( Q::CheckIndicator, Qt::transparent );
|
setColor( Q::CheckIndicator, Qt::transparent );
|
||||||
@ -1518,6 +1497,9 @@ qreal QskMaterial3Theme::stateOpacity( int state ) const
|
|||||||
if ( state == QskControl::Focused )
|
if ( state == QskControl::Focused )
|
||||||
return focusOpacity;
|
return focusOpacity;
|
||||||
|
|
||||||
|
if ( state == QskControl::Disabled )
|
||||||
|
return disabledOpacity;
|
||||||
|
|
||||||
return state ? pressedOpacity : 0.0;
|
return state ? pressedOpacity : 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ class QSK_MATERIAL3_EXPORT QskMaterial3Theme
|
|||||||
const qreal focusOpacity = 0.12;
|
const qreal focusOpacity = 0.12;
|
||||||
const qreal pressedOpacity = 0.12;
|
const qreal pressedOpacity = 0.12;
|
||||||
const qreal draggedOpacity = 0.16;
|
const qreal draggedOpacity = 0.16;
|
||||||
|
const qreal disabledOpacity = 0.38;
|
||||||
|
|
||||||
qreal stateOpacity( int state ) const;
|
qreal stateOpacity( int state ) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user