From d34e5a47d9968afcffea8ce3320fb1b6b48805a5 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 7 Apr 2021 14:49:51 +0200 Subject: [PATCH] fix light intensity layout and other stuff --- examples/iot-dashboard/Box.cpp | 2 +- examples/iot-dashboard/LightIntensity.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/iot-dashboard/Box.cpp b/examples/iot-dashboard/Box.cpp index 38caa143..9cf26b35 100644 --- a/examples/iot-dashboard/Box.cpp +++ b/examples/iot-dashboard/Box.cpp @@ -68,7 +68,7 @@ Box::Box( const QString& title, QQuickItem* parent ) // auto* t = new QskTextLabel( "bla", r ); - m_label->setFontRole( DaytimeSkin::TitleFont ); + m_label->setFontRole( Skin::TitleFont ); if( m_label->text().isEmpty() ) { diff --git a/examples/iot-dashboard/LightIntensity.cpp b/examples/iot-dashboard/LightIntensity.cpp index 84a5905d..637dd24d 100644 --- a/examples/iot-dashboard/LightIntensity.cpp +++ b/examples/iot-dashboard/LightIntensity.cpp @@ -146,7 +146,7 @@ LightDisplay::LightDisplay( QQuickItem* parent ) m_leftLabel->setSizePolicy( Qt::Horizontal, QskSizePolicy::Maximum ); m_centreLabel->setSizePolicy( Qt::Horizontal, QskSizePolicy::Maximum ); m_centreLabel->setZ( 1 ); - m_centreLabel->setFontRole( DaytimeSkin::LargeFont ); + m_centreLabel->setFontRole( QskSkin::LargeFont ); m_centreLabel->setTextColor( "#929cb2" ); m_rightLabel->setSizePolicy( Qt::Horizontal, QskSizePolicy::Maximum ); m_rightLabel->setZ( 1 ); @@ -174,7 +174,8 @@ QskAspect::Subcontrol LightDisplay::effectiveSubcontrol( QskAspect::Subcontrol s void LightDisplay::updateLayout() { - const int r = qMin( width(), height() ); + const qreal w = width() - ( m_leftLabel->width() + m_rightLabel->width() ); + const int r = qMin( w, height() ); m_dimmer->setContentsSize( {r - 4, r - 4} ); // for some reason we need some padding, hence the 4 m_dimmer->setSize( QSizeF( r, r ) ); const qreal padding = 8;