windows style: Allow icons for push buttons after all
This commit is contained in:
parent
09f0bd02a1
commit
dda0629523
@ -275,7 +275,11 @@ void Editor::setupPushButton()
|
||||
setBoxShape( Q::Panel, 4 );
|
||||
setBoxBorderMetrics( Q::Panel, 1 );
|
||||
|
||||
setStrutSize( Q::Icon, { 0, 0 } );
|
||||
// Windows buttons don't really have icons,
|
||||
// but for the sake of compatibility with the
|
||||
// gallery app, let's define their style here as well:
|
||||
setStrutSize( Q::Icon, 12, 12 );
|
||||
setPadding( Q::Icon, { 0, 0, 8, 0 } );
|
||||
|
||||
setFontRole( Q::Text, QskWindowsSkin::Body );
|
||||
|
||||
@ -292,6 +296,7 @@ void Editor::setupPushButton()
|
||||
|
||||
setGradient( Q::Panel | W::Accent, theme.palette.fillColor.accent.defaultColor );
|
||||
setColor( Q::Text | W::Accent, theme.palette.fillColor.textOnAccent.primary );
|
||||
setGraphicRole( Q::Icon | W::Accent, QskWindowsSkin::GraphicRoleFillColorTextOnAccentPrimary );
|
||||
|
||||
|
||||
const QRgb accentHoveredBorderColor1 = flattenedColor( theme.palette.elevation.accentControl.border[ 0 ],
|
||||
@ -308,6 +313,7 @@ void Editor::setupPushButton()
|
||||
|
||||
setGradient( Q::Panel | W::Accent | Q::Pressed, theme.palette.fillColor.accent.tertiary );
|
||||
setColor( Q::Text | W::Accent | Q::Pressed, theme.palette.fillColor.textOnAccent.secondary );
|
||||
setGraphicRole( Q::Icon | W::Accent | Q::Pressed, QskWindowsSkin::GraphicRoleFillColorTextOnAccentSecondary );
|
||||
|
||||
const QRgb accentPressedBorderColor = flattenedColor( theme.palette.strokeColor.controlStroke.onAccentDefault,
|
||||
theme.palette.fillColor.accent.tertiary );
|
||||
@ -317,6 +323,7 @@ void Editor::setupPushButton()
|
||||
|
||||
setGradient( Q::Panel | W::Accent | Q::Disabled, theme.palette.fillColor.accent.disabled );
|
||||
setColor( Q::Text | W::Accent | Q::Disabled, theme.palette.fillColor.textOnAccent.disabled );
|
||||
setGraphicRole( Q::Icon | W::Accent | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextOnAccentDisabled );
|
||||
setBoxBorderMetrics( Q::Panel | W::Accent | Q::Disabled, 0 );
|
||||
|
||||
|
||||
@ -333,6 +340,7 @@ void Editor::setupPushButton()
|
||||
|
||||
setGradient( Q::Panel, theme.palette.fillColor.control.defaultColor );
|
||||
setColor( Q::Text, theme.palette.fillColor.text.primary );
|
||||
setGraphicRole( Q::Icon, QskWindowsSkin::GraphicRoleFillColorTextPrimary );
|
||||
|
||||
|
||||
const QRgb standardHoveredBorderColor1 = flattenedColor( theme.palette.elevation.control.border[ 0 ],
|
||||
@ -354,6 +362,7 @@ void Editor::setupPushButton()
|
||||
|
||||
setGradient( Q::Panel | Q::Pressed, theme.palette.fillColor.control.tertiary );
|
||||
setColor( Q::Text | Q::Pressed, theme.palette.fillColor.text.secondary );
|
||||
setGraphicRole( Q::Icon | Q::Pressed, QskWindowsSkin::GraphicRoleFillColorTextSecondary );
|
||||
|
||||
|
||||
const QRgb standardDisabledBorderColor = flattenedColor( theme.palette.strokeColor.controlStroke.defaultColor,
|
||||
@ -363,6 +372,7 @@ void Editor::setupPushButton()
|
||||
|
||||
setGradient( Q::Panel | Q::Disabled, theme.palette.fillColor.control.disabled );
|
||||
setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled );
|
||||
setGraphicRole( Q::Icon | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextDisabled );
|
||||
}
|
||||
|
||||
void Editor::setupRadioBox()
|
||||
@ -963,16 +973,19 @@ void QskWindowsSkin::setGraphicColor( GraphicRole role, QRgb rgb )
|
||||
{
|
||||
QskColorFilter colorFilter;
|
||||
colorFilter.setMask( QskRgb::RGBAMask );
|
||||
colorFilter.addColorSubstitution( QskRgb::White, rgb );
|
||||
colorFilter.addColorSubstitution( QskRgb::Black, rgb );
|
||||
|
||||
setGraphicFilter( role, colorFilter );
|
||||
}
|
||||
|
||||
void QskWindowsSkin::setupGraphicFilters( const QskWindowsTheme& theme )
|
||||
{
|
||||
setGraphicColor( GraphicRoleFillColorTextDisabled, theme.palette.fillColor.text.disabled );
|
||||
setGraphicColor( GraphicRoleFillColorTextOnAccentDisabled, theme.palette.fillColor.textOnAccent.disabled );
|
||||
setGraphicColor( GraphicRoleFillColorTextOnAccentPrimary, theme.palette.fillColor.textOnAccent.primary );
|
||||
setGraphicColor( GraphicRoleFillColorTextOnAccentSecondary, theme.palette.fillColor.textOnAccent.secondary );
|
||||
setGraphicColor( GraphicRoleFillColorTextPrimary, theme.palette.fillColor.text.primary );
|
||||
setGraphicColor( GraphicRoleFillColorTextSecondary, theme.palette.fillColor.text.secondary );
|
||||
}
|
||||
|
||||
#include "moc_QskWindowsSkin.cpp"
|
||||
|
@ -339,9 +339,12 @@ class QSK_WINDOWS_EXPORT QskWindowsSkin : public QskSkin
|
||||
|
||||
enum GraphicRole
|
||||
{
|
||||
GraphicRoleFillColorTextDisabled,
|
||||
GraphicRoleFillColorTextOnAccentDisabled,
|
||||
GraphicRoleFillColorTextOnAccentPrimary,
|
||||
GraphicRoleFillColorTextOnAccentSecondary,
|
||||
GraphicRoleFillColorTextPrimary,
|
||||
GraphicRoleFillColorTextSecondary,
|
||||
};
|
||||
|
||||
enum FontRole
|
||||
|
@ -1,4 +1,4 @@
|
||||
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0.00195312 3.49805C0.00195312 3.36133 0.0507812 3.24414 0.148438 3.14648C0.246094 3.04883 0.363281 3 0.5 3C0.636719 3 0.753906 3.04883 0.851562 3.14648L3.5 5.79492L9.14844 0.146484C9.24609 0.0488281 9.36328 0 9.5 0C9.57031 0 9.63477 0.0136719 9.69336 0.0410156C9.75586 0.0644531 9.80859 0.0996094 9.85156 0.146484C9.89844 0.189453 9.93555 0.242187 9.96289 0.304688C9.99023 0.363281 10.0039 0.427734 10.0039 0.498047C10.0039 0.634766 9.95312 0.753906 9.85156 0.855469L3.85156 6.85547C3.75391 6.95312 3.63672 7.00195 3.5 7.00195C3.36328 7.00195 3.24609 6.95312 3.14844 6.85547L0.148438 3.85547C0.0507812 3.75781 0.00195312 3.63867 0.00195312 3.49805Z" fill="white"/>
|
||||
<path d="M0.00195312 3.49805C0.00195312 3.36133 0.0507812 3.24414 0.148438 3.14648C0.246094 3.04883 0.363281 3 0.5 3C0.636719 3 0.753906 3.04883 0.851562 3.14648L3.5 5.79492L9.14844 0.146484C9.24609 0.0488281 9.36328 0 9.5 0C9.57031 0 9.63477 0.0136719 9.69336 0.0410156C9.75586 0.0644531 9.80859 0.0996094 9.85156 0.146484C9.89844 0.189453 9.93555 0.242187 9.96289 0.304688C9.99023 0.363281 10.0039 0.427734 10.0039 0.498047C10.0039 0.634766 9.95312 0.753906 9.85156 0.855469L3.85156 6.85547C3.75391 6.95312 3.63672 7.00195 3.5 7.00195C3.36328 7.00195 3.24609 6.95312 3.14844 6.85547L0.148438 3.85547C0.0507812 3.75781 0.00195312 3.63867 0.00195312 3.49805Z" fill="black"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 777 B |
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user