style indoor temperature and humidity
This commit is contained in:
parent
e59bb2f772
commit
aa18cbbf44
|
@ -30,7 +30,7 @@ class Box : public QskLinearBox
|
||||||
Box( const QString& title, QQuickItem* parent );
|
Box( const QString& title, QQuickItem* parent );
|
||||||
|
|
||||||
QskAspect::Subcontrol effectiveSubcontrol(
|
QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
QskAspect::Subcontrol subControl ) const override final;
|
QskAspect::Subcontrol subControl ) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_title;
|
QString m_title;
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
#include "BoxWithButtons.h"
|
||||||
|
|
||||||
|
#include "RoundedIcon.h"
|
||||||
|
#include "Skin.h"
|
||||||
|
#include "UpAndDownButton.h"
|
||||||
|
|
||||||
|
#include <QskTextLabel.h>
|
||||||
|
|
||||||
|
QSK_SUBCONTROL( BoxWithButtons, Panel )
|
||||||
|
|
||||||
|
BoxWithButtons::BoxWithButtons( const QString& title, const QskGradient& gradient, QQuickItem* parent )
|
||||||
|
: Box( "", parent )
|
||||||
|
{
|
||||||
|
setPanel( true );
|
||||||
|
setSizePolicy( Qt::Vertical, QskSizePolicy::Maximum );
|
||||||
|
|
||||||
|
auto* layout = new QskLinearBox( Qt::Horizontal, this );
|
||||||
|
layout->setSpacing( 20 );
|
||||||
|
|
||||||
|
QString iconFile = title.toLower();
|
||||||
|
iconFile = iconFile.replace( ' ', '-' );
|
||||||
|
auto* icon = new RoundedIcon( iconFile, gradient, layout );
|
||||||
|
icon->setFixedSize( 68, 68 ); // ### fix properly
|
||||||
|
|
||||||
|
auto* titleAndValue = new QskLinearBox( Qt::Vertical, layout );
|
||||||
|
titleAndValue->setMargins( {0, 10, 0, 0} );
|
||||||
|
|
||||||
|
auto* titleLabel = new QskTextLabel( title, titleAndValue );
|
||||||
|
titleLabel->setFontRole( Skin::TitleFont );
|
||||||
|
|
||||||
|
auto* value = new QskTextLabel( "+24", titleAndValue );
|
||||||
|
value->setFontRole( QskSkin::HugeFont );
|
||||||
|
value->setTextColor( "#929CB2" );
|
||||||
|
|
||||||
|
new UpAndDownButton( layout );
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
#ifndef BOXWITHBUTTONS_H
|
||||||
|
#define BOXWITHBUTTONS_H
|
||||||
|
|
||||||
|
#include "Box.h"
|
||||||
|
|
||||||
|
class BoxWithButtons : public Box
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QSK_SUBCONTROLS( Panel )
|
||||||
|
|
||||||
|
BoxWithButtons( const QString& title, const QskGradient& gradient, QQuickItem* parent = nullptr );
|
||||||
|
|
||||||
|
QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
|
QskAspect::Subcontrol subControl ) const override final
|
||||||
|
{
|
||||||
|
if( subControl == QskBox::Panel )
|
||||||
|
{
|
||||||
|
return Panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
return subControl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class IndoorTemperature : public BoxWithButtons
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IndoorTemperature( QQuickItem* parent )
|
||||||
|
: BoxWithButtons( "Indoor Temperature", { QskGradient::Vertical, "#ff7d34", "#ff3122" }, parent )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Humidity: public BoxWithButtons
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Humidity( QQuickItem* parent )
|
||||||
|
: BoxWithButtons( "Humidity", { QskGradient::Vertical, "#6776FF", "#6100FF" }, parent )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BOXWITHBUTTONS_H
|
|
@ -1,39 +0,0 @@
|
||||||
#include "Humidity.h"
|
|
||||||
#include "Skin.h"
|
|
||||||
#include "RoundedIcon.h"
|
|
||||||
#include "UpAndDownButton.h"
|
|
||||||
|
|
||||||
#include <QskBoxShapeMetrics.h>
|
|
||||||
#include <QskGraphic.h>
|
|
||||||
#include <QskGraphicLabel.h>
|
|
||||||
#include <QskPushButton.h>
|
|
||||||
#include <QskTextLabel.h>
|
|
||||||
|
|
||||||
#include <QImage>
|
|
||||||
|
|
||||||
Humidity::Humidity( QQuickItem* parent )
|
|
||||||
: Box( "", parent )
|
|
||||||
{
|
|
||||||
setPanel( true );
|
|
||||||
setPaddingHint( Panel, 8 );
|
|
||||||
setSizePolicy( Qt::Vertical, QskSizePolicy::Maximum );
|
|
||||||
|
|
||||||
auto* layout = new QskLinearBox( Qt::Horizontal, this );
|
|
||||||
layout->setSpacing( 20 );
|
|
||||||
|
|
||||||
QskGradient gradient( QskGradient::Vertical, "#6776FF", "#6100FF" );
|
|
||||||
auto* icon = new RoundedIcon( "humidity", gradient, layout );
|
|
||||||
icon->setMinimumWidth( 68 );
|
|
||||||
icon->setFixedSize( 68, 68 ); // ### fix properly
|
|
||||||
|
|
||||||
auto* titleAndValue = new QskLinearBox( Qt::Vertical, layout );
|
|
||||||
|
|
||||||
auto* title = new QskTextLabel( "Humidity", titleAndValue );
|
|
||||||
title->setFontRole( DaytimeSkin::TitleFont );
|
|
||||||
|
|
||||||
auto* value = new QskTextLabel( "30%", titleAndValue );
|
|
||||||
value->setFontRole( QskSkin::HugeFont );
|
|
||||||
value->setTextColor( "#929CB2" );
|
|
||||||
|
|
||||||
/*auto* buttons =*/ new UpAndDownButton( layout );
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
#ifndef HUMIDITY_H
|
|
||||||
#define HUMIDITY_H
|
|
||||||
|
|
||||||
#include "Box.h"
|
|
||||||
|
|
||||||
class Humidity : public Box
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Humidity( QQuickItem* parent );
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // HUMIDITY_H
|
|
|
@ -1,41 +0,0 @@
|
||||||
#include "IndoorTemperature.h"
|
|
||||||
#include "Skin.h"
|
|
||||||
#include "RoundedIcon.h"
|
|
||||||
#include "UpAndDownButton.h"
|
|
||||||
|
|
||||||
#include <QskBoxShapeMetrics.h>
|
|
||||||
#include <QskGraphic.h>
|
|
||||||
#include <QskGraphicLabel.h>
|
|
||||||
#include <QskPushButton.h>
|
|
||||||
#include <QskTextLabel.h>
|
|
||||||
|
|
||||||
#include <QImage>
|
|
||||||
|
|
||||||
IndoorTemperature::IndoorTemperature( QQuickItem* parent )
|
|
||||||
: Box( "", parent )
|
|
||||||
{
|
|
||||||
setPanel( true );
|
|
||||||
setPaddingHint( Panel, 8 );
|
|
||||||
setSizePolicy( Qt::Vertical, QskSizePolicy::Maximum );
|
|
||||||
|
|
||||||
auto* layout = new QskLinearBox( Qt::Horizontal, this );
|
|
||||||
layout->setSpacing( 20 );
|
|
||||||
|
|
||||||
QskGradient gradient( QskGradient::Vertical, "#ff7d34", "#ff3122" );
|
|
||||||
auto* icon = new RoundedIcon( "indoor-temperature", gradient, layout );
|
|
||||||
icon->setMinimumWidth( 68 );
|
|
||||||
icon->setFixedSize( 68, 68 ); // ### fix properly
|
|
||||||
|
|
||||||
auto* titleAndValue = new QskLinearBox( Qt::Vertical, layout );
|
|
||||||
titleAndValue->setMargins( {0, 10, 0, 0} );
|
|
||||||
|
|
||||||
auto* title = new QskTextLabel( "Indoor Temperature", titleAndValue );
|
|
||||||
title->setFontRole( DaytimeSkin::TitleFont );
|
|
||||||
|
|
||||||
auto* value = new QskTextLabel( "+24", titleAndValue );
|
|
||||||
value->setFontRole( QskSkin::HugeFont );
|
|
||||||
value->setTextColor( "#929CB2" );
|
|
||||||
|
|
||||||
auto* buttons = new UpAndDownButton( layout );
|
|
||||||
Q_UNUSED( buttons );
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
#ifndef INDOORTEMPERATURE_H
|
|
||||||
#define INDOORTEMPERATURE_H
|
|
||||||
|
|
||||||
#include <Box.h>
|
|
||||||
|
|
||||||
class IndoorTemperature : public Box
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
IndoorTemperature( QQuickItem* parent );
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // INDOORTEMPERATURE_H
|
|
|
@ -1,9 +1,8 @@
|
||||||
#include "MainContent.h"
|
#include "MainContent.h"
|
||||||
|
|
||||||
#include "Box.h"
|
#include "Box.h"
|
||||||
|
#include "BoxWithButtons.h"
|
||||||
#include "Diagram.h"
|
#include "Diagram.h"
|
||||||
#include "Humidity.h"
|
|
||||||
#include "IndoorTemperature.h"
|
|
||||||
#include "LightIntensity.h"
|
#include "LightIntensity.h"
|
||||||
#include "MyDevices.h"
|
#include "MyDevices.h"
|
||||||
#include "PieChart.h"
|
#include "PieChart.h"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "Skin.h"
|
#include "Skin.h"
|
||||||
|
|
||||||
#include "Box.h"
|
#include "Box.h"
|
||||||
|
#include "BoxWithButtons.h"
|
||||||
#include "Diagram.h"
|
#include "Diagram.h"
|
||||||
#include "LightIntensity.h"
|
#include "LightIntensity.h"
|
||||||
#include "MainContent.h"
|
#include "MainContent.h"
|
||||||
|
@ -62,6 +63,9 @@ void Skin::initHints( const Palette& palette )
|
||||||
|
|
||||||
QskSkinHintTableEditor ed( &hintTable() );
|
QskSkinHintTableEditor ed( &hintTable() );
|
||||||
|
|
||||||
|
ed.setPadding( MainContentGridBox::Panel, {19, 0, 27, 24} );
|
||||||
|
|
||||||
|
// menu bar:
|
||||||
ed.setPadding( MenuBar::Panel, {0, 35, 0, 12} );
|
ed.setPadding( MenuBar::Panel, {0, 35, 0, 12} );
|
||||||
|
|
||||||
ed.setStrutSize( MenuItem::Panel | QskAspect::Size, {140, 40} );
|
ed.setStrutSize( MenuItem::Panel | QskAspect::Size, {140, 40} );
|
||||||
|
@ -72,8 +76,12 @@ void Skin::initHints( const Palette& palette )
|
||||||
color.setAlphaF( 0.14 );
|
color.setAlphaF( 0.14 );
|
||||||
ed.setGradient( MenuItem::Panel | MenuItem::Active, color );
|
ed.setGradient( MenuItem::Panel | MenuItem::Active, color );
|
||||||
|
|
||||||
ed.setPadding( MainContentGridBox::Panel, {19, 0, 27, 24} );
|
ed.setColor( MenuBarLabel::Text, Qt::white );
|
||||||
|
ed.setFontRole( MenuBarLabel::Text, QskSkin::SmallFont );
|
||||||
|
|
||||||
|
ed.setAlignment( MenuBarGraphicLabel::Graphic, Qt::AlignCenter );
|
||||||
|
|
||||||
|
// top bar:
|
||||||
ed.setPadding( TopBar::Panel, {25, 35, 25, 0} );
|
ed.setPadding( TopBar::Panel, {25, 35, 25, 0} );
|
||||||
|
|
||||||
ed.setColor( TopBarItem::Item1 | QskAspect::TextColor, "#ff3122" );
|
ed.setColor( TopBarItem::Item1 | QskAspect::TextColor, "#ff3122" );
|
||||||
|
@ -91,10 +99,8 @@ void Skin::initHints( const Palette& palette )
|
||||||
ed.setFontRole( TimeLabel::Text, QskSkin::HugeFont );
|
ed.setFontRole( TimeLabel::Text, QskSkin::HugeFont );
|
||||||
ed.setColor( TimeLabel::Text, "#6776FF" );
|
ed.setColor( TimeLabel::Text, "#6776FF" );
|
||||||
|
|
||||||
ed.setColor( MenuBarLabel::Text, Qt::white );
|
// content in boxes (indoor temperature, humidity etc.):
|
||||||
ed.setFontRole( MenuBarLabel::Text, QskSkin::SmallFont );
|
ed.setPadding( BoxWithButtons::Panel, 8 );
|
||||||
|
|
||||||
ed.setAlignment( MenuBarGraphicLabel::Graphic, Qt::AlignCenter );
|
|
||||||
|
|
||||||
// palette dependent skin hints:
|
// palette dependent skin hints:
|
||||||
ed.setGradient( MenuBar::Panel, palette.menuBar );
|
ed.setGradient( MenuBar::Panel, palette.menuBar );
|
||||||
|
|
|
@ -2,10 +2,9 @@ CONFIG += qskexample
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
Box.cpp \
|
Box.cpp \
|
||||||
|
BoxWithButtons.cpp \
|
||||||
CircularProgressBar.cpp \
|
CircularProgressBar.cpp \
|
||||||
Diagram.cpp \
|
Diagram.cpp \
|
||||||
Humidity.cpp \
|
|
||||||
IndoorTemperature.cpp \
|
|
||||||
LightIntensity.cpp \
|
LightIntensity.cpp \
|
||||||
MainContent.cpp \
|
MainContent.cpp \
|
||||||
MenuBar.cpp \
|
MenuBar.cpp \
|
||||||
|
@ -25,10 +24,9 @@ SOURCES += \
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
Box.h \
|
Box.h \
|
||||||
|
BoxWithButtons.h \
|
||||||
CircularProgressBar.h \
|
CircularProgressBar.h \
|
||||||
Diagram.h \
|
Diagram.h \
|
||||||
Humidity.h \
|
|
||||||
IndoorTemperature.h \
|
|
||||||
LightIntensity.h \
|
LightIntensity.h \
|
||||||
MainContent.h \
|
MainContent.h \
|
||||||
MainWindow.h \
|
MainWindow.h \
|
||||||
|
|
Loading…
Reference in New Issue