more hints for the night time skin
This commit is contained in:
parent
6a20d8bc32
commit
17e4582f85
|
@ -1,6 +1,7 @@
|
|||
#include "DaytimeSkin.h"
|
||||
|
||||
#include "Box.h"
|
||||
#include "Diagram.h"
|
||||
#include "LightIntensity.h"
|
||||
#include "MainContent.h"
|
||||
#include "MenuBar.h"
|
||||
|
@ -12,6 +13,7 @@
|
|||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
#include <QFontDatabase>
|
||||
|
||||
|
@ -58,6 +60,8 @@ void DaytimeSkin::initHints()
|
|||
setColor( LightDisplay::Panel, "#ffffff" );
|
||||
setColor( PieChartPainted::Panel, "#ffffff" );
|
||||
setGradient( RoundButton::Panel, {"#f7f7f7"} );
|
||||
setBoxBorderColors( WeekdayBox::Panel, {"#f4f4f4"} );
|
||||
setColor( QskTextLabel::Text, "#000000" );
|
||||
|
||||
QColor color( Qt::white );
|
||||
color.setAlphaF( 0.09 );
|
||||
|
|
|
@ -12,6 +12,24 @@
|
|||
|
||||
#include <cmath>
|
||||
|
||||
QSK_SUBCONTROL( WeekdayBox, Panel )
|
||||
|
||||
WeekdayBox::WeekdayBox( QQuickItem* parent )
|
||||
: QskBox( true, parent )
|
||||
{
|
||||
setBoxBorderMetricsHint( WeekdayBox::Panel, {0, 0, 3, 3} );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol WeekdayBox::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return WeekdayBox::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
class CaptionItem : public QskLinearBox
|
||||
|
@ -125,9 +143,9 @@ Diagram::Diagram( QQuickItem* parent )
|
|||
|
||||
for( int i = 0; i < segments; ++i )
|
||||
{
|
||||
auto* box = new QskBox( true, m_weekdays );
|
||||
box->setBoxBorderColorsHint( QskBox::Panel, {"#f4f4f4"} );
|
||||
box->setBoxBorderMetricsHint( QskBox::Panel, {0, 0, 3, 3} );
|
||||
auto* box = new WeekdayBox( m_weekdays );
|
||||
// box->setBoxBorderColorsHint( QskBox::Panel, {"#f4f4f4"} );
|
||||
// box->setBoxBorderMetricsHint( QskBox::Panel, {0, 0, 3, 3} );
|
||||
m_weekdays->addItem( box, 0, i );
|
||||
auto* label = new QskTextLabel( weekdays.at( i ), m_weekdays );
|
||||
label->setFontRole( QskSkin::TinyFont );
|
||||
|
|
|
@ -8,6 +8,19 @@
|
|||
class DiagramContent;
|
||||
class QskGridBox;
|
||||
|
||||
class WeekdayBox : public QskBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
WeekdayBox( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
};
|
||||
|
||||
class Diagram : public Box
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -24,7 +24,7 @@ void LightDimmer::paint( QPainter* painter )
|
|||
auto size = contentsSize();
|
||||
QRectF outerRect( {0, offset}, size );
|
||||
|
||||
QRadialGradient gradient( size.width() / 2, size.height() / 2, 70 );
|
||||
QRadialGradient gradient( size.width() / 2, size.height() / 2, 110 );
|
||||
QGradientStop stop1( 0.0, "#c0c0c0" );
|
||||
QGradientStop stop2( 0.5, "#f0f0f0" );
|
||||
QGradientStop stop3( 1.0, "#c0c0c0" );
|
||||
|
|
|
@ -76,7 +76,7 @@ MainContent::MainContent( QQuickItem* parent ) : QskLinearBox( Qt::Vertical, par
|
|||
|
||||
auto* gridBox = new QskGridBox( this );
|
||||
gridBox->setSpacing( 15 );
|
||||
gridBox->setMargins( {15, 0, 27, 24} );
|
||||
gridBox->setMargins( {19, 0, 27, 24} );
|
||||
gridBox->setPanel( true );
|
||||
gridBox->setBoxShapeHint( QskBox::Panel, 6 );
|
||||
gridBox->setBoxBorderMetricsHint( QskBox::Panel, 2 );
|
||||
|
|
|
@ -11,6 +11,7 @@ MainWindow::MainWindow() : QskWindow()
|
|||
setTitle( "IOT dashboard" );
|
||||
|
||||
m_mainLayout = new QskLinearBox( Qt::Horizontal, contentItem() );
|
||||
m_mainLayout->setSpacing( 0 );
|
||||
m_menuBar = new MenuBar( m_mainLayout );
|
||||
m_mainContent = new MainContent( m_mainLayout );
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "NighttimeSkin.h"
|
||||
|
||||
#include "Box.h"
|
||||
#include "Diagram.h"
|
||||
#include "LightIntensity.h"
|
||||
#include "MainContent.h"
|
||||
#include "MenuBar.h"
|
||||
|
@ -12,6 +13,7 @@
|
|||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
#include <QFontDatabase>
|
||||
|
||||
|
@ -58,8 +60,11 @@ void NighttimeSkin::initHints()
|
|||
setColor( LightDisplay::Panel, "#000000" );
|
||||
setColor( PieChartPainted::Panel, "#000000" );
|
||||
setGradient( RoundButton::Panel, {"#0a0a0a"} );
|
||||
setBoxBorderColors( WeekdayBox::Panel, {"#0c0c0c"} );
|
||||
|
||||
setColor( QskTextLabel::Text, "#ffffff" );
|
||||
|
||||
QColor color( Qt::white );
|
||||
color.setAlphaF( 0.09 );
|
||||
setGradient( MenuItem::Panel | QskControl::Hovered, Qt::yellow ); // ### nicer color
|
||||
setGradient( MenuItem::Panel | QskControl::Hovered, color );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue