Put indoor temperature inside a box

This commit is contained in:
Peter Hartmann 2020-09-17 16:22:47 +02:00
parent af16ec3696
commit ba1ffbbac1
3 changed files with 46 additions and 39 deletions

View File

@ -23,4 +23,9 @@ Box::Box( const QString& title, QQuickItem* parent )
setBoxBorderColorsHint( QskBox::Panel, borderColors ); setBoxBorderColorsHint( QskBox::Panel, borderColors );
m_label->setFontRole( DaytimeSkin::TitleFont ); m_label->setFontRole( DaytimeSkin::TitleFont );
if( m_label->text().isEmpty() )
{
m_label->setVisible( false );
}
} }

View File

@ -11,17 +11,19 @@
#include <QImage> #include <QImage>
IndoorTemperature::IndoorTemperature( QQuickItem* parent ) IndoorTemperature::IndoorTemperature( QQuickItem* parent )
: QskLinearBox(Qt::Horizontal, parent) : Box( "", parent )
{ {
setMargins(17); setMarginsHint( Panel | QskAspect::Padding, 10 );
setSpacing(20);
auto* layout = new QskLinearBox( Qt::Horizontal, this );
layout->setSpacing( 20 );
QskGradient gradient( QskGradient::Vertical, "#ff7d34", "#ff3122" ); QskGradient gradient( QskGradient::Vertical, "#ff7d34", "#ff3122" );
auto* icon = new RoundedIcon("indoor-temperature", gradient, this); auto* icon = new RoundedIcon( "indoor-temperature", gradient, layout );
icon->setMinimumWidth( 68 ); icon->setMinimumWidth( 68 );
icon->setFixedSize( 68, 68 ); // ### fix properly icon->setFixedSize( 68, 68 ); // ### fix properly
auto *titleAndValue = new QskLinearBox(Qt::Vertical, this); auto* titleAndValue = new QskLinearBox( Qt::Vertical, layout );
auto* title = new QskTextLabel( "Indoor Temperature", titleAndValue ); auto* title = new QskTextLabel( "Indoor Temperature", titleAndValue );
title->setFontRole( DaytimeSkin::TitleFont ); title->setFontRole( DaytimeSkin::TitleFont );
@ -30,7 +32,7 @@ IndoorTemperature::IndoorTemperature(QQuickItem *parent)
value->setFontRole( QskSkin::HugeFont ); value->setFontRole( QskSkin::HugeFont );
value->setTextColor( "#929CB2" ); value->setTextColor( "#929CB2" );
auto* buttons = new QskLinearBox(Qt::Vertical, this); auto* buttons = new QskLinearBox( Qt::Vertical, layout );
buttons->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed ); buttons->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
buttons->setSpacing( 0 ); buttons->setSpacing( 0 );

View File

@ -1,9 +1,9 @@
#ifndef INDOORTEMPERATURE_H #ifndef INDOORTEMPERATURE_H
#define INDOORTEMPERATURE_H #define INDOORTEMPERATURE_H
#include <QskLinearBox.h> #include <Box.h>
class IndoorTemperature : public QskLinearBox class IndoorTemperature : public Box
{ {
public: public:
IndoorTemperature( QQuickItem* parent ); IndoorTemperature( QQuickItem* parent );