top bar styling
This commit is contained in:
parent
0237ed040e
commit
8115f19fc1
|
@ -8,6 +8,7 @@
|
||||||
#include "QskShadowedRectangle.h"
|
#include "QskShadowedRectangle.h"
|
||||||
#include "QskShadowedRectangleSkinlet.h"
|
#include "QskShadowedRectangleSkinlet.h"
|
||||||
#include "PieChartPainted.h"
|
#include "PieChartPainted.h"
|
||||||
|
#include "TopBar.h"
|
||||||
#include "UpAndDownButton.h"
|
#include "UpAndDownButton.h"
|
||||||
|
|
||||||
#include <QskBoxBorderMetrics.h>
|
#include <QskBoxBorderMetrics.h>
|
||||||
|
@ -73,6 +74,8 @@ void Skin::initHints( const Palette& palette )
|
||||||
|
|
||||||
ed.setPadding( MainContentGridBox::Panel, {19, 0, 27, 24} );
|
ed.setPadding( MainContentGridBox::Panel, {19, 0, 27, 24} );
|
||||||
|
|
||||||
|
ed.setPadding( TopBar::Panel, {25, 35, 25, 0} );
|
||||||
|
|
||||||
ed.setColor( MenuBarLabel::Text, Qt::white );
|
ed.setColor( MenuBarLabel::Text, Qt::white );
|
||||||
ed.setFontRole( MenuBarLabel::Text, QskSkin::SmallFont );
|
ed.setFontRole( MenuBarLabel::Text, QskSkin::SmallFont );
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
|
QSK_SUBCONTROL( TopBar, Panel )
|
||||||
|
|
||||||
TopBarItem::TopBarItem( const QString& name, const QColor& textColor, const QGradient& gradient, int progress, int value, QQuickItem* parent ) : QskLinearBox( Qt::Vertical, parent ),
|
TopBarItem::TopBarItem( const QString& name, const QColor& textColor, const QGradient& gradient, int progress, int value, QQuickItem* parent ) : QskLinearBox( Qt::Vertical, parent ),
|
||||||
m_name( name )
|
m_name( name )
|
||||||
{
|
{
|
||||||
|
@ -32,10 +34,10 @@ TopBarItem::TopBarItem( const QString& name, const QColor& textColor, const QGra
|
||||||
|
|
||||||
TopBar::TopBar( QQuickItem* parent ) : QskLinearBox( Qt::Horizontal, parent )
|
TopBar::TopBar( QQuickItem* parent ) : QskLinearBox( Qt::Horizontal, parent )
|
||||||
{
|
{
|
||||||
|
setPanel( true );
|
||||||
setAutoLayoutChildren( true );
|
setAutoLayoutChildren( true );
|
||||||
setAutoAddChildren( true );
|
setAutoAddChildren( true );
|
||||||
setSizePolicy( QskSizePolicy::Preferred, QskSizePolicy::Fixed );
|
setSizePolicy( QskSizePolicy::Preferred, QskSizePolicy::Fixed );
|
||||||
setMargins( {25, 35, 25, 0} );
|
|
||||||
|
|
||||||
QStringList itemStrings = { "Living Room", "Bedroom", "Bathroom", "Kitchen" };
|
QStringList itemStrings = { "Living Room", "Bedroom", "Bathroom", "Kitchen" };
|
||||||
QColor textColors[] = {"#ff3122", "#6776ff", "#f99055", "#6776ff"};
|
QColor textColors[] = {"#ff3122", "#6776ff", "#f99055", "#6776ff"};
|
||||||
|
|
|
@ -19,8 +19,21 @@ class TopBar : public QskLinearBox
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QSK_SUBCONTROLS( Panel )
|
||||||
|
|
||||||
TopBar( QQuickItem* parent );
|
TopBar( QQuickItem* parent );
|
||||||
|
|
||||||
|
QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
|
QskAspect::Subcontrol subControl ) const override final
|
||||||
|
{
|
||||||
|
if( subControl == QskLinearBox::Panel )
|
||||||
|
{
|
||||||
|
return Panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
return subControl;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList< TopBarItem* > m_entries;
|
QList< TopBarItem* > m_entries;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue