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