From 2c1fe52712350d34a47caea9b1d2d4b49edd1d4f Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 7 Apr 2021 16:35:35 +0200 Subject: [PATCH] style menu bar icons --- examples/iot-dashboard/MenuBar.cpp | 4 ++-- examples/iot-dashboard/Skin.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/iot-dashboard/MenuBar.cpp b/examples/iot-dashboard/MenuBar.cpp index 35853d57..caaf76fd 100644 --- a/examples/iot-dashboard/MenuBar.cpp +++ b/examples/iot-dashboard/MenuBar.cpp @@ -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 ); } diff --git a/examples/iot-dashboard/Skin.cpp b/examples/iot-dashboard/Skin.cpp index 93effa34..398a1c41 100644 --- a/examples/iot-dashboard/Skin.cpp +++ b/examples/iot-dashboard/Skin.cpp @@ -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: