style usage spacer
This commit is contained in:
parent
68ee161d98
commit
e87eb7ef08
|
@ -9,6 +9,7 @@
|
||||||
#include "PieChartPainted.h"
|
#include "PieChartPainted.h"
|
||||||
#include "TopBar.h"
|
#include "TopBar.h"
|
||||||
#include "UpAndDownButton.h"
|
#include "UpAndDownButton.h"
|
||||||
|
#include "Usage.h"
|
||||||
|
|
||||||
#include <QskBoxBorderMetrics.h>
|
#include <QskBoxBorderMetrics.h>
|
||||||
#include <QskBoxBorderColors.h>
|
#include <QskBoxBorderColors.h>
|
||||||
|
@ -110,6 +111,9 @@ void Skin::initHints( const Palette& palette )
|
||||||
|
|
||||||
|
|
||||||
// content in boxes (indoor temperature, humidity etc.):
|
// content in boxes (indoor temperature, humidity etc.):
|
||||||
|
ed.setFontRole( UsageSpacer::Text, QskSkin::SmallFont );
|
||||||
|
ed.setColor( UsageSpacer::Text, "#dddddd" );
|
||||||
|
|
||||||
ed.setPadding( BoxWithButtons::Panel, 8 );
|
ed.setPadding( BoxWithButtons::Panel, 8 );
|
||||||
|
|
||||||
ed.setBoxShape( RoundedIcon::Panel, 6 );
|
ed.setBoxShape( RoundedIcon::Panel, 6 );
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include <QskTextLabel.h>
|
#include <QskTextLabel.h>
|
||||||
|
|
||||||
|
QSK_SUBCONTROL( UsageSpacer, Text )
|
||||||
|
|
||||||
Usage::Usage( QQuickItem* parent )
|
Usage::Usage( QQuickItem* parent )
|
||||||
: Box( "Usage", parent )
|
: Box( "Usage", parent )
|
||||||
{
|
{
|
||||||
|
@ -11,24 +13,21 @@ Usage::Usage( QQuickItem* parent )
|
||||||
auto* today = new QskLinearBox( Qt::Horizontal, content );
|
auto* today = new QskLinearBox( Qt::Horizontal, content );
|
||||||
auto* todayText = new QskTextLabel( "Usage today", today );
|
auto* todayText = new QskTextLabel( "Usage today", today );
|
||||||
todayText->setFontRole( QskSkin::SmallFont );
|
todayText->setFontRole( QskSkin::SmallFont );
|
||||||
auto* todaySpacer = new QskTextLabel( "_____", today );
|
new UsageSpacer( today );
|
||||||
todaySpacer->setTextColor( "#dddddd" );
|
|
||||||
auto* todayValue = new QskTextLabel( "0,5 kwH", today );
|
auto* todayValue = new QskTextLabel( "0,5 kwH", today );
|
||||||
todayValue->setFontRole( QskSkin::SmallFont );
|
todayValue->setFontRole( QskSkin::SmallFont );
|
||||||
|
|
||||||
auto* month = new QskLinearBox( Qt::Horizontal, content );
|
auto* month = new QskLinearBox( Qt::Horizontal, content );
|
||||||
auto* monthText = new QskTextLabel( "Usage this month", month );
|
auto* monthText = new QskTextLabel( "Usage this month", month );
|
||||||
monthText->setFontRole( QskSkin::SmallFont );
|
monthText->setFontRole( QskSkin::SmallFont );
|
||||||
auto* monthSpacer = new QskTextLabel( "_____", month );
|
new UsageSpacer( month );
|
||||||
monthSpacer->setTextColor( "#dddddd" );
|
|
||||||
auto* monthValue = new QskTextLabel( "66 kwH", month );
|
auto* monthValue = new QskTextLabel( "66 kwH", month );
|
||||||
monthValue->setFontRole( QskSkin::SmallFont );
|
monthValue->setFontRole( QskSkin::SmallFont );
|
||||||
|
|
||||||
auto* total = new QskLinearBox( Qt::Horizontal, content );
|
auto* total = new QskLinearBox( Qt::Horizontal, content );
|
||||||
auto* totalText = new QskTextLabel( "Total working hours", total );
|
auto* totalText = new QskTextLabel( "Total working hours", total );
|
||||||
totalText->setFontRole( QskSkin::SmallFont );
|
totalText->setFontRole( QskSkin::SmallFont );
|
||||||
auto* totalSpacer = new QskTextLabel( "_____", total );
|
new UsageSpacer( total );
|
||||||
totalSpacer->setTextColor( "#dddddd" );
|
|
||||||
auto* totalValue = new QskTextLabel( "125 hrs", total );
|
auto* totalValue = new QskTextLabel( "125 hrs", total );
|
||||||
totalValue->setFontRole( QskSkin::SmallFont );
|
totalValue->setFontRole( QskSkin::SmallFont );
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,33 @@
|
||||||
#define USAGE_H
|
#define USAGE_H
|
||||||
|
|
||||||
#include "Box.h"
|
#include "Box.h"
|
||||||
|
|
||||||
#include <QskLinearBox.h>
|
#include <QskLinearBox.h>
|
||||||
|
#include <QskTextLabel.h>
|
||||||
|
|
||||||
|
class UsageSpacer : public QskTextLabel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QSK_SUBCONTROLS( Text )
|
||||||
|
|
||||||
|
UsageSpacer( QQuickItem* parent = nullptr )
|
||||||
|
: QskTextLabel( "_____", parent )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
|
QskAspect::Subcontrol subControl ) const override final
|
||||||
|
{
|
||||||
|
if( subControl == QskTextLabel::Text )
|
||||||
|
{
|
||||||
|
return Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
return subControl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class Usage : public Box
|
class Usage : public Box
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue