M3 buttons: Fix icons

Also for the gallery use the ones from M3.
This commit is contained in:
Peter Hartmann 2023-01-15 08:44:57 +01:00 committed by uwerat
parent 84156b138e
commit f98af6d298
6 changed files with 17 additions and 6 deletions

View File

@ -30,7 +30,6 @@ namespace
void populate() void populate()
{ {
const char* texts[] = { "Press Me", "Check Me" }; const char* texts[] = { "Press Me", "Check Me" };
const char* graphics[] = { "diamond/khaki", "ellipse/sandybrown" };
for ( int i = 0; i < 6; i++ ) for ( int i = 0; i < 6; i++ )
{ {
@ -42,7 +41,7 @@ namespace
if ( i > 1 ) if ( i > 1 )
{ {
auto src = QStringLiteral( "image://shapes/" ) + graphics[ index ]; auto src = QStringLiteral( "plus" );
button->setGraphicSource( src ); button->setGraphicSource( src );
} }

View File

@ -48,3 +48,6 @@ HEADERS += \
SOURCES += \ SOURCES += \
Page.cpp \ Page.cpp \
main.cpp main.cpp
RESOURCES += \
icons.qrc \

View File

@ -0,0 +1,5 @@
<RCC>
<qresource>
<file>icons/qvg/plus.qvg</file>
</qresource>
</RCC>

View File

@ -0,0 +1,4 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 6.75H6.75V12H5.25V6.75H0V5.25H5.25V0H6.75V5.25H12V6.75Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

View File

@ -559,20 +559,20 @@ void Editor::setupPushButton()
setFlagHint( Q::Panel | QskAspect::Direction, Qsk::LeftToRight ); setFlagHint( Q::Panel | QskAspect::Direction, Qsk::LeftToRight );
setStrutSize( Q::Panel, -1, 40_dp ); setStrutSize( Q::Panel, -1, 40_dp );
setSpacing( Q::Panel, 4_dp ); setSpacing( Q::Panel, 8_dp );
setPadding( Q::Panel, { 24_dp, 0, 24_dp, 0 } ); setPadding( Q::Panel, { 24_dp, 0, 24_dp, 0 } );
setBoxShape( Q::Panel, 100, Qt::RelativeSize ); setBoxShape( Q::Panel, 100, Qt::RelativeSize );
setAlignment( Q::Graphic, Qt::AlignCenter ); setAlignment( Q::Graphic, Qt::AlignCenter );
setStrutSize( Q::Graphic, 18_dp, 18_dp ); setStrutSize( Q::Graphic, 18_dp, 18_dp );
setPadding( Q::Graphic, 0 ); setPadding( Q::Graphic, { 0, 0, 8_dp, 0 } );
setGraphicRole( Q::Graphic, QskMaterial3Skin::GraphicRoleOnPrimary );
setFontRole( Q::Text, QskMaterial3Skin::M3LabelLarge ); setFontRole( Q::Text, QskMaterial3Skin::M3LabelLarge );
setPadding( Q::Text, 0 ); setPadding( Q::Text, 0 );
setAlignment( Q::Text | A::Vertical, Qt::AlignCenter ); setAlignment( Q::Text, Qt::AlignCenter );
setAlignment( Q::Text | A::Horizontal, Qt::AlignLeft | Qt::AlignVCenter );
// normal buttons (i.e. Filled): // normal buttons (i.e. Filled):