simplify temperature and humidity
This commit is contained in:
parent
aa18cbbf44
commit
c74845e562
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <QskTextLabel.h>
|
#include <QskTextLabel.h>
|
||||||
|
|
||||||
|
QSK_SUBCONTROL( BigRoundedIcon, Panel )
|
||||||
|
|
||||||
QSK_SUBCONTROL( BoxWithButtons, Panel )
|
QSK_SUBCONTROL( BoxWithButtons, Panel )
|
||||||
|
|
||||||
BoxWithButtons::BoxWithButtons( const QString& title, const QskGradient& gradient, QQuickItem* parent )
|
BoxWithButtons::BoxWithButtons( const QString& title, const QskGradient& gradient, QQuickItem* parent )
|
||||||
|
@ -19,7 +21,7 @@ BoxWithButtons::BoxWithButtons( const QString& title, const QskGradient& gradien
|
||||||
|
|
||||||
QString iconFile = title.toLower();
|
QString iconFile = title.toLower();
|
||||||
iconFile = iconFile.replace( ' ', '-' );
|
iconFile = iconFile.replace( ' ', '-' );
|
||||||
auto* icon = new RoundedIcon( iconFile, gradient, layout );
|
auto* icon = new BigRoundedIcon( iconFile, gradient, layout );
|
||||||
icon->setFixedSize( 68, 68 ); // ### fix properly
|
icon->setFixedSize( 68, 68 ); // ### fix properly
|
||||||
|
|
||||||
auto* titleAndValue = new QskLinearBox( Qt::Vertical, layout );
|
auto* titleAndValue = new QskLinearBox( Qt::Vertical, layout );
|
||||||
|
|
|
@ -2,6 +2,33 @@
|
||||||
#define BOXWITHBUTTONS_H
|
#define BOXWITHBUTTONS_H
|
||||||
|
|
||||||
#include "Box.h"
|
#include "Box.h"
|
||||||
|
#include "RoundedIcon.h"
|
||||||
|
|
||||||
|
#include <QskBoxShapeMetrics.h>
|
||||||
|
|
||||||
|
class BigRoundedIcon : public RoundedIcon
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QSK_SUBCONTROLS( Panel )
|
||||||
|
|
||||||
|
BigRoundedIcon( const QString& iconName, const QskGradient& gradient, QQuickItem* parent = nullptr )
|
||||||
|
: RoundedIcon( iconName, gradient, parent )
|
||||||
|
{
|
||||||
|
setGradientHint( Panel, gradient );
|
||||||
|
setBoxShapeHint( Panel, 6 );
|
||||||
|
}
|
||||||
|
|
||||||
|
QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
|
QskAspect::Subcontrol subControl ) const override final
|
||||||
|
{
|
||||||
|
if( subControl == QskBox::Panel )
|
||||||
|
{
|
||||||
|
return Panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
return subControl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class BoxWithButtons : public Box
|
class BoxWithButtons : public Box
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
|
||||||
|
QSK_SUBCONTROL( RoundedIcon, Panel )
|
||||||
|
|
||||||
RoundedIcon::RoundedIcon( const QString& iconName, const QskGradient& gradient, QQuickItem* parent )
|
RoundedIcon::RoundedIcon( const QString& iconName, const QskGradient& gradient, QQuickItem* parent )
|
||||||
: QskBox( parent )
|
: QskBox( parent )
|
||||||
, m_iconName( iconName )
|
, m_iconName( iconName )
|
||||||
|
@ -13,8 +15,6 @@ RoundedIcon::RoundedIcon( const QString& iconName, const QskGradient& gradient,
|
||||||
{
|
{
|
||||||
setPanel( true );
|
setPanel( true );
|
||||||
setPolishOnResize( true );
|
setPolishOnResize( true );
|
||||||
setGradientHint( Panel, gradient );
|
|
||||||
setBoxShapeHint( Panel, 6 );
|
|
||||||
|
|
||||||
setSizePolicy( QskSizePolicy::Minimum, QskSizePolicy::Constrained );
|
setSizePolicy( QskSizePolicy::Minimum, QskSizePolicy::Constrained );
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,21 @@ class RoundedIcon : public QskBox
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QSK_SUBCONTROLS( Panel )
|
||||||
|
|
||||||
RoundedIcon( const QString& iconName, const QskGradient& gradient, QQuickItem* parent = nullptr );
|
RoundedIcon( const QString& iconName, const QskGradient& gradient, QQuickItem* parent = nullptr );
|
||||||
|
|
||||||
|
QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
|
QskAspect::Subcontrol subControl ) const override
|
||||||
|
{
|
||||||
|
if( subControl == QskBox::Panel )
|
||||||
|
{
|
||||||
|
return Panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
return subControl;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void updateLayout() override;
|
void updateLayout() override;
|
||||||
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||||
|
|
Loading…
Reference in New Issue