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