style menu bar icons

This commit is contained in:
Peter Hartmann 2021-04-07 16:35:35 +02:00
parent 56a9f6dffe
commit 2c1fe52712
2 changed files with 3 additions and 2 deletions

View File

@ -26,12 +26,12 @@ MenuItem::MenuItem( const QString& name, QQuickItem* parent ) : QskLinearBox( Qt
setAcceptHoverEvents( true );
setPanel( true );
QString fileName = ":/images/" + name.toLower() + ".png"; // width: 14
QString fileName = ":/images/" + name.toLower() + ".png";
QImage image( fileName );
auto graphic = QskGraphic::fromImage( image );
auto* graphicLabel = new MenuBarGraphicLabel( graphic, this );
graphicLabel->setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
graphicLabel->setFixedWidth( 14 );
graphicLabel->setFixedWidth( metric( MenuBarGraphicLabel::Graphic | QskAspect::Size ) );
new MenuBarLabel( name, this );
}

View File

@ -81,6 +81,7 @@ void Skin::initHints( const Palette& palette )
ed.setMargin( MenuBarTopLabel::Graphic, { 50, 0, 50, 54 } );
ed.setMetric( MenuBarGraphicLabel::Graphic | QskAspect::Size, 14 );
ed.setAlignment( MenuBarGraphicLabel::Graphic, Qt::AlignCenter );
// top bar: