add box around each section
This commit is contained in:
parent
b4b1fa701c
commit
5199e1af1e
|
@ -1,12 +1,26 @@
|
|||
#include "Card.h"
|
||||
#include "DaytimeSkin.h"
|
||||
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
Card::Card(const QString &title, QskControl *content, QQuickItem *parent ) : QskLinearBox( Qt::Vertical, parent ),
|
||||
m_title( title )
|
||||
Card::Card( const QString& title, QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
, m_title( title )
|
||||
, m_label( new QskTextLabel( m_title, this ) )
|
||||
{
|
||||
m_label = new QskTextLabel( m_title, this );
|
||||
m_content = content;
|
||||
m_content->setParentItem( this ); // ### maybe do it differently
|
||||
m_content->setParent( this );
|
||||
setAutoAddChildren( true );
|
||||
setAutoLayoutChildren( true );
|
||||
|
||||
setMarginsHint( Panel | QskAspect::Padding, 15 );
|
||||
setPanel( true );
|
||||
setBoxShapeHint( QskBox::Panel, 6 );
|
||||
setBoxBorderMetricsHint( QskBox::Panel, 2 );
|
||||
QskBoxBorderColors borderColors( "#dddddd" );
|
||||
borderColors.setAlpha( 100 );
|
||||
setBoxBorderColorsHint( QskBox::Panel, borderColors );
|
||||
|
||||
m_label->setFontRole( DaytimeSkin::TitleFont );
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class QskTextLabel;
|
|||
class Card : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
Card( const QString& title, QskControl* content, QQuickItem* parent );
|
||||
Card( const QString& title, QQuickItem* parent );
|
||||
|
||||
private:
|
||||
QString m_title;
|
||||
|
|
|
@ -29,9 +29,9 @@ MainContent::MainContent( QQuickItem* parent ) : QskLinearBox( Qt::Vertical, par
|
|||
gridBox->setPanel( true );
|
||||
gridBox->setBoxShapeHint( QskBox::Panel, 6 );
|
||||
gridBox->setBoxBorderMetricsHint( QskBox::Panel, 2 );
|
||||
QskBoxBorderColors borderColors( "#dddddd" );
|
||||
borderColors.setAlpha( 100 );
|
||||
gridBox->setBoxBorderColorsHint( QskBox::Panel, borderColors );
|
||||
// QskBoxBorderColors borderColors( "#dddddd" );
|
||||
// borderColors.setAlpha( 100 );
|
||||
// gridBox->setBoxBorderColorsHint( QskBox::Panel, borderColors );
|
||||
|
||||
auto* usage = new Usage( gridBox );
|
||||
gridBox->addItem( usage, 0, 0, 2, 1 );
|
||||
|
@ -51,8 +51,3 @@ MainContent::MainContent( QQuickItem* parent ) : QskLinearBox( Qt::Vertical, par
|
|||
auto* lightIntensity = new LightIntensity( gridBox );
|
||||
gridBox->addItem( lightIntensity, 2, 2 );
|
||||
}
|
||||
|
||||
void MainContent::addCard( const QString& title, QskControl* content, int column )
|
||||
{
|
||||
new Card( title, content, m_columns.at( column ) );
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ public:
|
|||
MainContent( QQuickItem* parent );
|
||||
|
||||
private:
|
||||
void addCard( const QString& title, QskControl* content, int column = -1 );
|
||||
|
||||
QList< QskLinearBox* > m_columns;
|
||||
};
|
||||
|
||||
|
|
|
@ -4,13 +4,8 @@
|
|||
#include <QskTextLabel.h>
|
||||
|
||||
Usage::Usage( QQuickItem* parent )
|
||||
: QskLinearBox(Qt::Vertical, parent)
|
||||
: Card( "Usage", parent )
|
||||
{
|
||||
setMargins(17);
|
||||
|
||||
auto* title = new QskTextLabel("Usage", this);
|
||||
title->setFontRole(DaytimeSkin::TitleFont);
|
||||
|
||||
auto* content = new QskLinearBox( Qt::Vertical, this );
|
||||
|
||||
auto* today = new QskLinearBox( Qt::Horizontal, content );
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef USAGE_H
|
||||
#define USAGE_H
|
||||
|
||||
#include "Card.h"
|
||||
#include <QskLinearBox.h>
|
||||
|
||||
class Usage : public QskLinearBox
|
||||
class Usage : public Card
|
||||
{
|
||||
public:
|
||||
Usage( QQuickItem* parent );
|
||||
|
|
Loading…
Reference in New Issue