put the rest in a box
This commit is contained in:
parent
116376a77a
commit
1839a4c58b
|
@ -109,10 +109,12 @@ namespace
|
||||||
static constexpr int segments = 7;
|
static constexpr int segments = 7;
|
||||||
|
|
||||||
Diagram::Diagram( QQuickItem* parent )
|
Diagram::Diagram( QQuickItem* parent )
|
||||||
: QskLinearBox( Qt::Vertical, parent )
|
: Box( "", parent )
|
||||||
, m_weekdays( new QskGridBox( this ) )
|
, m_weekdays( new QskGridBox( this ) )
|
||||||
, m_content( new DiagramContent( this ) )
|
, m_content( new DiagramContent( this ) )
|
||||||
{
|
{
|
||||||
|
setMarginsHint( Panel | QskAspect::Padding, 0 );
|
||||||
|
|
||||||
setAutoAddChildren( false );
|
setAutoAddChildren( false );
|
||||||
setAutoLayoutChildren( true );
|
setAutoLayoutChildren( true );
|
||||||
|
|
||||||
|
@ -138,7 +140,7 @@ Diagram::Diagram( QQuickItem* parent )
|
||||||
m_caption = new QskLinearBox( Qt::Horizontal, this );
|
m_caption = new QskLinearBox( Qt::Horizontal, this );
|
||||||
addItem( m_caption, Qt::AlignRight );
|
addItem( m_caption, Qt::AlignRight );
|
||||||
m_caption->setSizePolicy( QskSizePolicy::Maximum, QskSizePolicy::Maximum );
|
m_caption->setSizePolicy( QskSizePolicy::Maximum, QskSizePolicy::Maximum );
|
||||||
m_caption->setMargins( {10, 0, 10, 0} );
|
m_caption->setMargins( {10, 10, 20, 0} );
|
||||||
m_caption->setSpacing( 30 );
|
m_caption->setSpacing( 30 );
|
||||||
m_caption->addItem( new CaptionItem( "#6776ff", "Water", this ) );
|
m_caption->addItem( new CaptionItem( "#6776ff", "Water", this ) );
|
||||||
m_caption->addItem( new CaptionItem( "#ff3122", "Electricity", this ) );
|
m_caption->addItem( new CaptionItem( "#ff3122", "Electricity", this ) );
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#ifndef DIAGRAM_H
|
#ifndef DIAGRAM_H
|
||||||
#define DIAGRAM_H
|
#define DIAGRAM_H
|
||||||
|
|
||||||
#include <QskLinearBox.h>
|
#include "Box.h"
|
||||||
|
|
||||||
#include <QQuickPaintedItem>
|
#include <QQuickPaintedItem>
|
||||||
|
|
||||||
class DiagramContent;
|
class DiagramContent;
|
||||||
class QskGridBox;
|
class QskGridBox;
|
||||||
|
|
||||||
class Diagram : public QskLinearBox
|
class Diagram : public Box
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
|
@ -97,12 +97,7 @@ void LightDisplay::updateLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
LightIntensity::LightIntensity( QQuickItem* parent )
|
LightIntensity::LightIntensity( QQuickItem* parent )
|
||||||
: QskLinearBox( Qt::Vertical, parent )
|
: Box( "Light intensity", parent )
|
||||||
{
|
{
|
||||||
setMargins( 17 );
|
|
||||||
|
|
||||||
auto* title = new QskTextLabel( "Light Intensity", this );
|
|
||||||
title->setFontRole( DaytimeSkin::TitleFont );
|
|
||||||
|
|
||||||
new LightDisplay( this );
|
new LightDisplay( this );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef LIGHTINTENSITY_H
|
#ifndef LIGHTINTENSITY_H
|
||||||
#define LIGHTINTENSITY_H
|
#define LIGHTINTENSITY_H
|
||||||
|
|
||||||
#include <QskLinearBox.h>
|
#include "Box.h"
|
||||||
|
|
||||||
#include <QQuickPaintedItem>
|
#include <QQuickPaintedItem>
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class LightDisplay : public QskControl
|
||||||
LightDimmer* m_dimmer;
|
LightDimmer* m_dimmer;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LightIntensity : public QskLinearBox
|
class LightIntensity : public Box
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
|
@ -56,13 +56,9 @@ namespace
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
MyDevices::MyDevices( QQuickItem* parent ) : QskLinearBox( Qt::Vertical, parent )
|
MyDevices::MyDevices( QQuickItem* parent )
|
||||||
|
: Box( "My devices", parent )
|
||||||
{
|
{
|
||||||
setMargins( 17 );
|
|
||||||
|
|
||||||
auto* title = new QskTextLabel( "My Devices", this );
|
|
||||||
title->setFontRole( DaytimeSkin::TitleFont );
|
|
||||||
|
|
||||||
auto* content = new QskGridBox( this );
|
auto* content = new QskGridBox( this );
|
||||||
|
|
||||||
QskGradient gradient1( QskGradient::Vertical, "#FF3122", "#FF7D34" );
|
QskGradient gradient1( QskGradient::Vertical, "#FF3122", "#FF7D34" );
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#ifndef MYDEVICES_H
|
#ifndef MYDEVICES_H
|
||||||
#define MYDEVICES_H
|
#define MYDEVICES_H
|
||||||
|
|
||||||
#include <QskLinearBox.h>
|
#include "Box.h"
|
||||||
|
|
||||||
class MyDevices : public QskLinearBox
|
class MyDevices : public Box
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyDevices( QQuickItem* parent);
|
MyDevices( QQuickItem* parent );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MYDEVICES_H
|
#endif // MYDEVICES_H
|
||||||
|
|
Loading…
Reference in New Issue