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