dashboard example simplified
@ -1,66 +0,0 @@
|
||||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "ButtonBar.h"
|
||||
#include "SkinFactory.h"
|
||||
|
||||
#include <QskGraphic.h>
|
||||
#include <QskGraphicIO.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskMargins.h>
|
||||
|
||||
QSK_SUBCONTROL( ButtonBar, Indicator )
|
||||
|
||||
namespace
|
||||
{
|
||||
class IndicatorLabel final : public QskGraphicLabel
|
||||
{
|
||||
public:
|
||||
IndicatorLabel( QQuickItem* parentItem = nullptr )
|
||||
: QskGraphicLabel( parentItem )
|
||||
{
|
||||
// so the skins are able to colorize them
|
||||
setGraphicRole( SkinFactory::Indicator );
|
||||
setSubcontrolProxy( QskGraphicLabel::Graphic, ButtonBar::Indicator );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
ButtonBar::ButtonBar( QQuickItem* parentItem )
|
||||
: QskLinearBox( parentItem )
|
||||
{
|
||||
QColor c( Qt::black );
|
||||
c.setAlphaF( 0.5 );
|
||||
setBackgroundColor( c );
|
||||
|
||||
setMargins( QskMargins( 20, 15 ) );
|
||||
setSpacing( 20 );
|
||||
|
||||
setSizePolicy( QskSizePolicy::MinimumExpanding, QskSizePolicy::MinimumExpanding );
|
||||
}
|
||||
|
||||
void ButtonBar::addIndicator( const char* name )
|
||||
{
|
||||
auto label = new IndicatorLabel( this );
|
||||
|
||||
/*
|
||||
The label should adjust vertically and be stretched horizontally
|
||||
according to its aspect ratio.
|
||||
*/
|
||||
|
||||
label->setSizePolicy( QskSizePolicy::Constrained, QskSizePolicy::Ignored );
|
||||
|
||||
const QString fileName = QString( ":/qvg/%1.qvg" ).arg( name );
|
||||
label->setGraphic( QskGraphicIO::read( fileName ) );
|
||||
}
|
||||
|
||||
QSizeF ButtonBar::layoutSizeHint(
|
||||
Qt::SizeHint which, const QSizeF& ) const
|
||||
{
|
||||
if ( which == Qt::PreferredSize )
|
||||
return QSizeF( -1, 20 );
|
||||
|
||||
return QSizeF();
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QskLinearBox.h>
|
||||
|
||||
class ButtonBar : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
QSK_SUBCONTROLS( Indicator )
|
||||
|
||||
ButtonBar( QQuickItem* = nullptr );
|
||||
void addIndicator( const char* name );
|
||||
|
||||
protected:
|
||||
QSizeF layoutSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
};
|
@ -3,23 +3,20 @@
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "SpeedometerDisplay.h"
|
||||
#include "Speedometer.h"
|
||||
#include "Dashboard.h"
|
||||
#include "Dial.h"
|
||||
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace
|
||||
{
|
||||
class Dial : public Speedometer
|
||||
class DashboardDial : public Dial
|
||||
{
|
||||
public:
|
||||
Dial( const QString& title, QQuickItem* parent = nullptr )
|
||||
: Speedometer( parent )
|
||||
DashboardDial( const QString& title, QQuickItem* parent = nullptr )
|
||||
: Dial( parent )
|
||||
{
|
||||
setPolishOnResize( true );
|
||||
m_label = new QskTextLabel( title, this );
|
||||
@ -42,11 +39,11 @@ namespace
|
||||
QskTextLabel* m_label;
|
||||
};
|
||||
|
||||
class RevCounter : public Dial
|
||||
class RevCounter : public DashboardDial
|
||||
{
|
||||
public:
|
||||
RevCounter( QQuickItem* parent = nullptr )
|
||||
: Dial( "x 1000 min^-1", parent )
|
||||
: DashboardDial( "x 1000 min^-1", parent )
|
||||
{
|
||||
setMinimum( 145 );
|
||||
setMaximum( 305 );
|
||||
@ -64,11 +61,11 @@ namespace
|
||||
}
|
||||
};
|
||||
|
||||
class Speedo : public Dial
|
||||
class SpeedoMeter : public DashboardDial
|
||||
{
|
||||
public:
|
||||
Speedo( QQuickItem* parent = nullptr )
|
||||
: Dial( "km/h", parent )
|
||||
SpeedoMeter( QQuickItem* parent = nullptr )
|
||||
: DashboardDial( "km/h", parent )
|
||||
{
|
||||
setMinimum( -215 );
|
||||
setMaximum( 35 );
|
||||
@ -91,11 +88,11 @@ namespace
|
||||
}
|
||||
};
|
||||
|
||||
class FuelGauge : public Dial
|
||||
class FuelGauge : public DashboardDial
|
||||
{
|
||||
public:
|
||||
FuelGauge( QQuickItem* parent = nullptr )
|
||||
: Dial( "fuel", parent )
|
||||
: DashboardDial( "fuel", parent )
|
||||
{
|
||||
setMinimum( 195 );
|
||||
setMaximum( 345 );
|
||||
@ -111,13 +108,11 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
||||
Dashboard::Dashboard( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
std::srand( static_cast< uint >( QTime::currentTime().msec() ) );
|
||||
|
||||
(void ) new RevCounter( this );
|
||||
auto speedometer = new Speedo( this );
|
||||
auto speedometer = new SpeedoMeter( this );
|
||||
auto fuelGauge = new FuelGauge( this );
|
||||
|
||||
setMargins( 10 );
|
||||
@ -125,7 +120,7 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
||||
|
||||
auto timer = new QTimer( this );
|
||||
|
||||
connect( timer, &QTimer::timeout, speedometer, &Speedo::updateValue );
|
||||
connect( timer, &QTimer::timeout, speedometer, &SpeedoMeter::updateValue );
|
||||
connect( timer, &QTimer::timeout, fuelGauge, &FuelGauge::updateValue );
|
||||
|
||||
timer->setInterval( 16 );
|
@ -7,8 +7,8 @@
|
||||
|
||||
#include <QskLinearBox.h>
|
||||
|
||||
class SpeedometerDisplay : public QskLinearBox
|
||||
class Dashboard : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
SpeedometerDisplay( QQuickItem* parent = nullptr );
|
||||
Dashboard( QQuickItem* parent = nullptr );
|
||||
};
|
@ -3,29 +3,29 @@
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "Speedometer.h"
|
||||
#include "Dial.h"
|
||||
|
||||
#include <QskSkinlet.h>
|
||||
#include <QskSkinnable.h>
|
||||
|
||||
QSK_SUBCONTROL( Speedometer, Panel )
|
||||
QSK_SUBCONTROL( Speedometer, TickLabels )
|
||||
QSK_SUBCONTROL( Speedometer, Knob )
|
||||
QSK_SUBCONTROL( Speedometer, Needle )
|
||||
QSK_SUBCONTROL( Dial, Panel )
|
||||
QSK_SUBCONTROL( Dial, TickLabels )
|
||||
QSK_SUBCONTROL( Dial, Knob )
|
||||
QSK_SUBCONTROL( Dial, Needle )
|
||||
|
||||
Speedometer::Speedometer( QQuickItem* parent )
|
||||
Dial::Dial( QQuickItem* parent )
|
||||
: QskBoundedValueInput( parent )
|
||||
{
|
||||
}
|
||||
|
||||
QVector< QString > Speedometer::tickLabels() const
|
||||
QVector< QString > Dial::tickLabels() const
|
||||
{
|
||||
return m_tickLabels;
|
||||
}
|
||||
|
||||
void Speedometer::setTickLabels( const QVector< QString >& labels )
|
||||
void Dial::setTickLabels( const QVector< QString >& labels )
|
||||
{
|
||||
m_tickLabels = labels;
|
||||
}
|
||||
|
||||
#include "moc_Speedometer.cpp"
|
||||
#include "moc_Dial.cpp"
|
@ -7,14 +7,14 @@
|
||||
|
||||
#include <QskBoundedValueInput.h>
|
||||
|
||||
class Speedometer : public QskBoundedValueInput
|
||||
class Dial : public QskBoundedValueInput
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, TickLabels, Knob, Needle )
|
||||
|
||||
Speedometer( QQuickItem* parent = nullptr );
|
||||
Dial( QQuickItem* parent = nullptr );
|
||||
|
||||
QVector< QString > tickLabels() const;
|
||||
void setTickLabels( const QVector< QString >& );
|
@ -3,8 +3,8 @@
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "SpeedometerSkinlet.h"
|
||||
#include "Speedometer.h"
|
||||
#include "DialSkinlet.h"
|
||||
#include "Dial.h"
|
||||
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
@ -78,20 +78,20 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
SpeedometerSkinlet::SpeedometerSkinlet( QskSkin* skin )
|
||||
DialSkinlet::DialSkinlet( QskSkin* skin )
|
||||
: QskSkinlet( skin )
|
||||
{
|
||||
setNodeRoles( { PanelRole, NeedleRole, KnobRole, LabelsRole } );
|
||||
}
|
||||
|
||||
QRectF SpeedometerSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
QRectF DialSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
const QRectF& contentsRect, QskAspect::Subcontrol subcontrol ) const
|
||||
{
|
||||
QRectF r;
|
||||
|
||||
if ( subcontrol == Speedometer::Knob )
|
||||
if ( subcontrol == Dial::Knob )
|
||||
{
|
||||
const auto size = skinnable->strutSizeHint( Speedometer::Knob );
|
||||
const auto size = skinnable->strutSizeHint( Dial::Knob );
|
||||
r.setSize( size );
|
||||
}
|
||||
else
|
||||
@ -105,18 +105,18 @@ QRectF SpeedometerSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
return r;
|
||||
}
|
||||
|
||||
QSGNode* SpeedometerSkinlet::updateSubNode(
|
||||
QSGNode* DialSkinlet::updateSubNode(
|
||||
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
||||
{
|
||||
const auto speedometer = static_cast< const Speedometer* >( skinnable );
|
||||
const auto speedometer = static_cast< const Dial* >( skinnable );
|
||||
|
||||
switch ( nodeRole )
|
||||
{
|
||||
case PanelRole:
|
||||
return updateBoxNode( speedometer, node, Speedometer::Panel );
|
||||
return updateBoxNode( speedometer, node, Dial::Panel );
|
||||
|
||||
case KnobRole:
|
||||
return updateBoxNode( speedometer, node, Speedometer::Knob );
|
||||
return updateBoxNode( speedometer, node, Dial::Knob );
|
||||
|
||||
case NeedleRole:
|
||||
return updateNeedleNode( speedometer, node );
|
||||
@ -130,12 +130,12 @@ QSGNode* SpeedometerSkinlet::updateSubNode(
|
||||
}
|
||||
}
|
||||
|
||||
QSGNode* SpeedometerSkinlet::updateLabelsNode(
|
||||
const Speedometer* speedometer, QSGNode* node ) const
|
||||
QSGNode* DialSkinlet::updateLabelsNode(
|
||||
const Dial* dial, QSGNode* node ) const
|
||||
{
|
||||
using Q = Speedometer;
|
||||
using Q = Dial;
|
||||
|
||||
const auto labels = speedometer->tickLabels();
|
||||
const auto labels = dial->tickLabels();
|
||||
|
||||
// ### actually, we could draw labels with only one entry
|
||||
if ( labels.count() <= 1 )
|
||||
@ -145,11 +145,11 @@ QSGNode* SpeedometerSkinlet::updateLabelsNode(
|
||||
if ( ticksNode == nullptr )
|
||||
ticksNode = new TicksNode();
|
||||
|
||||
const auto color = speedometer->color( Q::TickLabels );
|
||||
const auto color = dial->color( Q::TickLabels );
|
||||
ticksNode->setColor( color );
|
||||
|
||||
const auto startAngle = speedometer->minimum();
|
||||
const auto endAngle = speedometer->maximum();
|
||||
const auto startAngle = dial->minimum();
|
||||
const auto endAngle = dial->maximum();
|
||||
const auto step = ( endAngle - startAngle ) / ( labels.count() - 1 );
|
||||
|
||||
auto geometry = ticksNode->geometry();
|
||||
@ -157,19 +157,19 @@ QSGNode* SpeedometerSkinlet::updateLabelsNode(
|
||||
|
||||
auto vertexData = geometry->vertexDataAsPoint2D();
|
||||
|
||||
auto scaleRect = this->scaleRect( speedometer );
|
||||
auto scaleRect = this->scaleRect( dial );
|
||||
|
||||
const auto center = scaleRect.center();
|
||||
const auto radius = 0.5 * scaleRect.width();
|
||||
|
||||
const auto spacing = speedometer->spacingHint( Q::TickLabels );
|
||||
const auto spacing = dial->spacingHint( Q::TickLabels );
|
||||
|
||||
const auto font = speedometer->effectiveFont( Q::TickLabels );
|
||||
const auto font = dial->effectiveFont( Q::TickLabels );
|
||||
const QFontMetricsF fontMetrics( font );
|
||||
|
||||
auto angle = startAngle;
|
||||
|
||||
const auto tickSize = speedometer->strutSizeHint( Q::TickLabels );
|
||||
const auto tickSize = dial->strutSizeHint( Q::TickLabels );
|
||||
const auto needleRadius = radius - tickSize.height();
|
||||
|
||||
// Create a series of tickmarks from minimum to maximum
|
||||
@ -207,7 +207,7 @@ QSGNode* SpeedometerSkinlet::updateLabelsNode(
|
||||
const QRectF numbersRect( numbersX, numbersY, w, h );
|
||||
|
||||
labelNode = QskSkinlet::updateTextNode(
|
||||
speedometer, labelNode, numbersRect, Qt::AlignCenter | Qt::AlignHCenter,
|
||||
dial, labelNode, numbersRect, Qt::AlignCenter | Qt::AlignHCenter,
|
||||
text, font, QskTextOptions(), QskTextColors( color ), Qsk::Normal );
|
||||
|
||||
if ( labelNode )
|
||||
@ -228,48 +228,47 @@ QSGNode* SpeedometerSkinlet::updateLabelsNode(
|
||||
return ticksNode;
|
||||
}
|
||||
|
||||
QSGNode* SpeedometerSkinlet::updateNeedleNode(
|
||||
const Speedometer* speedometer, QSGNode* node ) const
|
||||
QSGNode* DialSkinlet::updateNeedleNode(
|
||||
const Dial* dial, QSGNode* node ) const
|
||||
{
|
||||
using Q = Speedometer;
|
||||
using Q = Dial;
|
||||
|
||||
auto needleNode = static_cast< NeedleNode* >( node );
|
||||
if ( needleNode == nullptr )
|
||||
needleNode = new NeedleNode();
|
||||
|
||||
const auto line = needlePoints( speedometer );
|
||||
const auto width = speedometer->metric( Q::Needle | QskAspect::Size );
|
||||
const auto line = needlePoints( dial );
|
||||
const auto width = dial->metric( Q::Needle | QskAspect::Size );
|
||||
|
||||
needleNode->setData( line, width * 2 );
|
||||
needleNode->setColor( speedometer->color( Q::Needle ) );
|
||||
needleNode->setColor( dial->color( Q::Needle ) );
|
||||
|
||||
return needleNode;
|
||||
}
|
||||
|
||||
QRectF SpeedometerSkinlet::scaleRect( const Speedometer* speedometer ) const
|
||||
QRectF DialSkinlet::scaleRect( const Dial* dial ) const
|
||||
{
|
||||
using Q = Speedometer;
|
||||
using Q = Dial;
|
||||
|
||||
const auto margins = speedometer->marginHint( Q::Panel );
|
||||
const auto margins = dial->marginHint( Q::Panel );
|
||||
|
||||
auto r = speedometer->subControlRect( Q::Panel );
|
||||
auto r = dial->subControlRect( Q::Panel );
|
||||
r = r.marginsRemoved( margins );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
QLineF SpeedometerSkinlet::needlePoints( const Speedometer* speedometer ) const
|
||||
QLineF DialSkinlet::needlePoints( const Dial* dial ) const
|
||||
{
|
||||
const auto r = scaleRect( speedometer );
|
||||
const auto margin = speedometer->metric(
|
||||
Speedometer::Needle | QskAspect::Margin );
|
||||
const auto r = scaleRect( dial );
|
||||
const auto margin = dial->metric( Dial::Needle | QskAspect::Margin );
|
||||
|
||||
QLineF line;
|
||||
line.setP1( r.center() );
|
||||
line.setLength( 0.5 * r.width() - margin );
|
||||
line.setAngle( -speedometer->value() );
|
||||
line.setAngle( -dial->value() );
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
#include "moc_SpeedometerSkinlet.cpp"
|
||||
#include "moc_DialSkinlet.cpp"
|
@ -7,9 +7,9 @@
|
||||
|
||||
#include <QskSkinlet.h>
|
||||
|
||||
class Speedometer;
|
||||
class Dial;
|
||||
|
||||
class SpeedometerSkinlet : public QskSkinlet
|
||||
class DialSkinlet : public QskSkinlet
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
@ -22,7 +22,7 @@ class SpeedometerSkinlet : public QskSkinlet
|
||||
NeedleRole
|
||||
};
|
||||
|
||||
Q_INVOKABLE SpeedometerSkinlet( QskSkin* skin = nullptr );
|
||||
Q_INVOKABLE DialSkinlet( QskSkin* skin = nullptr );
|
||||
|
||||
QRectF subControlRect( const QskSkinnable*,
|
||||
const QRectF&, QskAspect::Subcontrol ) const override;
|
||||
@ -32,9 +32,9 @@ class SpeedometerSkinlet : public QskSkinlet
|
||||
quint8 nodeRole, QSGNode* node ) const override;
|
||||
|
||||
private:
|
||||
QRectF scaleRect( const Speedometer* ) const;
|
||||
QLineF needlePoints( const Speedometer* ) const;
|
||||
QRectF scaleRect( const Dial* ) const;
|
||||
QLineF needlePoints( const Dial* ) const;
|
||||
|
||||
QSGNode* updateLabelsNode( const Speedometer*, QSGNode* ) const;
|
||||
QSGNode* updateNeedleNode( const Speedometer*, QSGNode* ) const;
|
||||
QSGNode* updateLabelsNode( const Dial*, QSGNode* ) const;
|
||||
QSGNode* updateNeedleNode( const Dial*, QSGNode* ) const;
|
||||
};
|
@ -1,79 +0,0 @@
|
||||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "ButtonBar.h"
|
||||
#include "SkinFactory.h"
|
||||
#include "SpeedometerDisplay.h"
|
||||
|
||||
#include <QskGraphic.h>
|
||||
#include <QskGraphicIO.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
#include <QDate>
|
||||
#include <QImage>
|
||||
|
||||
namespace
|
||||
{
|
||||
class Header : public ButtonBar
|
||||
{
|
||||
public:
|
||||
Header()
|
||||
{
|
||||
addIndicator( "bluetooth" );
|
||||
addIndicator( "location" );
|
||||
addIndicator( "phone" );
|
||||
|
||||
( void ) new QskTextLabel( QDate::currentDate().toString(), this );
|
||||
|
||||
addIndicator( "user" );
|
||||
addIndicator( "bookmark" );
|
||||
addIndicator( "menu" );
|
||||
}
|
||||
};
|
||||
|
||||
class Footer : public ButtonBar
|
||||
{
|
||||
public:
|
||||
Footer()
|
||||
{
|
||||
addIndicator( "cloud" );
|
||||
addIndicator( "man" );
|
||||
addIndicator( "bus" );
|
||||
addIndicator( "plane" );
|
||||
addIndicator( "train" );
|
||||
|
||||
addStretch( 10 );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
setAutoLayoutChildren( true );
|
||||
|
||||
const QImage image( QStringLiteral( ":/images/background.jpg" ) );
|
||||
|
||||
auto backgroundImage = new QskGraphicLabel( contentItem() );
|
||||
backgroundImage->setGraphic( QskGraphic::fromImage( image ) );
|
||||
backgroundImage->setFillMode( QskGraphicLabel::Stretch );
|
||||
|
||||
auto header = new Header();
|
||||
auto speedoDisplay = new SpeedometerDisplay();
|
||||
auto footer = new Footer();
|
||||
|
||||
auto layout = new QskLinearBox( Qt::Vertical, contentItem() );
|
||||
|
||||
layout->addItem( header );
|
||||
layout->setStretchFactor( header, 1 );
|
||||
|
||||
layout->addItem( speedoDisplay );
|
||||
layout->setStretchFactor( speedoDisplay, 8 );
|
||||
|
||||
layout->addItem( footer );
|
||||
layout->setStretchFactor( footer, 1 );
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
* background image: http://7-themes.com/collections/green-wallpapers/4440155/ , license unknown
|
||||
* car image: https://openclipart.org/detail/234440/white-blank-racing-car-top-view , unlimited commercial use
|
||||
* icons: https://www.flaticon.com/packs/material-design, made by Material Design from www.flaticon.com
|
@ -5,24 +5,15 @@
|
||||
|
||||
#include "SkinFactory.h"
|
||||
|
||||
#include "ButtonBar.h"
|
||||
#include "Speedometer.h"
|
||||
#include "SpeedometerSkinlet.h"
|
||||
#include "Dial.h"
|
||||
#include "DialSkinlet.h"
|
||||
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskAnimationHint.h>
|
||||
#include <QskSetup.h>
|
||||
#include <QskSkinTransition.h>
|
||||
#include <QskSkinHintTableEditor.h>
|
||||
#include <QskSkin.h>
|
||||
#include <QskPlatform.h>
|
||||
|
||||
#include <QEasingCurve>
|
||||
#include <QskRgbValue.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -38,102 +29,43 @@ namespace
|
||||
public:
|
||||
Skin()
|
||||
{
|
||||
declareSkinlet< Speedometer, SpeedometerSkinlet >();
|
||||
using namespace QskRgb;
|
||||
|
||||
declareSkinlet< Dial, DialSkinlet >();
|
||||
|
||||
setFont( QskSkin::DefaultFont, qskFont( 13 ) );
|
||||
setFont( QskSkin::LargeFont, qskFont( 20 ) );
|
||||
|
||||
setSkinHint( ButtonBar::Indicator | QskAspect::GraphicRole, SkinFactory::Indicator );
|
||||
}
|
||||
};
|
||||
|
||||
class Skin1 : public Skin
|
||||
{
|
||||
public:
|
||||
Skin1()
|
||||
{
|
||||
const QColor color1( "#363636" ); // Jet
|
||||
const QColor color2( "#242F40" ); // Yankees blue
|
||||
const QColor color3( "#CCA43B" ); // Satin sheet gold
|
||||
const QColor color4( "#E5E5E5" ); // Platinum
|
||||
const QColor color5( "#FFFFFF" ); // white
|
||||
const auto rgb1 = qRgb( 1, 16, 27 ); // Maastricht blue
|
||||
const auto rgb2 = qRgb( 255, 0, 22 ); // Ruddy
|
||||
const auto rgb3 = qRgb( 41, 234, 212 ); // Turquoise
|
||||
const auto rgb4 = qRgb( 253, 255, 252 ); // baby powder
|
||||
|
||||
QskSkinHintTableEditor ed( &hintTable() );
|
||||
|
||||
ed.setColor( QskTextLabel::Text, color3 );
|
||||
ed.setColor( QskTextLabel::Text, rgb4 );
|
||||
|
||||
{
|
||||
using Q = Speedometer;
|
||||
|
||||
ed.setBoxBorderMetrics( Q::Panel, 5 );
|
||||
ed.setBoxShape( Q::Panel, 30, Qt::RelativeSize );
|
||||
ed.setGradient( Q::Panel,
|
||||
QskGradient( QskGradient::Vertical, color2, color4 ) );
|
||||
ed.setBoxBorderColors( Q::Panel, color3 );
|
||||
|
||||
ed.setBoxBorderMetrics( Q::Knob, 5 );
|
||||
ed.setStrutSize( Q::Knob, 20, 20 );
|
||||
ed.setBoxShape( Q::Knob, 100, Qt::RelativeSize );
|
||||
ed.setGradient( Q::Knob, color2 );
|
||||
ed.setBoxBorderColors( Q::Knob, color4 );
|
||||
|
||||
ed.setMetric( Q::Needle | QskAspect::Size, 4 );
|
||||
ed.setMetric( Q::Needle | QskAspect::Margin, 15 );
|
||||
ed.setColor( Q::Needle, color4 );
|
||||
|
||||
ed.setSpacing( Q::TickLabels, 3 );
|
||||
ed.setStrutSize( Q::TickLabels, 3, 25 );
|
||||
ed.setColor( Q::TickLabels, color4 );
|
||||
ed.setFontRole( Q::TickLabels, QskSkin::SmallFont );
|
||||
}
|
||||
|
||||
{
|
||||
// all SVGs on the header/footer are plain white
|
||||
|
||||
QskColorFilter filter;
|
||||
filter.addColorSubstitution( Qt::white, color3.rgb() );
|
||||
|
||||
setGraphicFilter( SkinFactory::Indicator, filter );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class Skin2 : public Skin
|
||||
{
|
||||
public:
|
||||
Skin2()
|
||||
{
|
||||
const QColor color1( "#011627" ); // Maastricht blue
|
||||
const QColor color2( "#FF0022" ); // ruddy
|
||||
const QColor color3( "#41EAD4" ); // Turquoise
|
||||
const QColor color4( "#FDFFFC" ); // baby powder
|
||||
const QColor color5( "#B91372" ); // red violet
|
||||
|
||||
QskSkinHintTableEditor ed( &hintTable() );
|
||||
|
||||
ed.setColor( QskTextLabel::Text, color4 );
|
||||
|
||||
{
|
||||
using Q = Speedometer;
|
||||
using Q = Dial;
|
||||
|
||||
ed.setBoxBorderMetrics( Q::Panel, 2 );
|
||||
ed.setBoxShape( Q::Panel, 100, Qt::RelativeSize );
|
||||
ed.setGradient( Q::Panel, color1 );
|
||||
ed.setBoxBorderColors( Q::Panel, color3 );
|
||||
ed.setGradient( Q::Panel, rgb1 );
|
||||
ed.setBoxBorderColors( Q::Panel, rgb3 );
|
||||
|
||||
ed.setBoxBorderMetrics( Q::Knob, 2 );
|
||||
ed.setStrutSize( Q::Knob, 30, 30 );
|
||||
ed.setBoxShape( Q::Knob, 100, Qt::RelativeSize );
|
||||
ed.setGradient( Q::Knob,
|
||||
QskGradient( QskGradient::Diagonal, color2, color1 ) );
|
||||
QskGradient( QskGradient::Diagonal, rgb2, rgb1 ) );
|
||||
|
||||
ed.setMetric( Q::Needle | QskAspect::Size, 2 );
|
||||
ed.setMetric( Q::Needle | QskAspect::Margin, 10 );
|
||||
ed.setColor( Q::Needle, color2 );
|
||||
ed.setColor( Q::Needle, rgb2 );
|
||||
|
||||
ed.setSpacing( Q::TickLabels, 4 );
|
||||
ed.setStrutSize( Q::TickLabels, 2, 15 );
|
||||
ed.setColor( Q::TickLabels, color4 );
|
||||
ed.setColor( Q::TickLabels, rgb4 );
|
||||
ed.setFontRole( Q::TickLabels, QskSkin::SmallFont );
|
||||
}
|
||||
}
|
||||
@ -143,43 +75,15 @@ namespace
|
||||
|
||||
QStringList SkinFactory::skinNames() const
|
||||
{
|
||||
return { "Skin1", "Skin2" };
|
||||
return { "Skin" };
|
||||
}
|
||||
|
||||
QskSkin* SkinFactory::createSkin( const QString& skinName )
|
||||
{
|
||||
if ( skinName == "Skin1" )
|
||||
return new Skin1();
|
||||
|
||||
if ( skinName == "Skin2" )
|
||||
return new Skin2();
|
||||
if ( skinName == "Skin" )
|
||||
return new Skin();
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SkinFactory::rotateSkin()
|
||||
{
|
||||
const auto names = skinNames();
|
||||
|
||||
int index = names.indexOf( qskSetup->skinName() );
|
||||
index = ( index + 1 ) % names.size();
|
||||
|
||||
auto oldSkin = qskSetup->skin();
|
||||
if ( oldSkin->parent() == qskSetup )
|
||||
oldSkin->setParent( nullptr ); // otherwise setSkin deletes it
|
||||
|
||||
auto newSkin = qskSetup->setSkin( names[ index ] );
|
||||
|
||||
QskSkinTransition transition;
|
||||
|
||||
transition.setSourceSkin( oldSkin );
|
||||
transition.setTargetSkin( newSkin );
|
||||
transition.setAnimation( 600 );
|
||||
|
||||
transition.process();
|
||||
|
||||
if ( oldSkin->parent() == nullptr )
|
||||
delete oldSkin;
|
||||
}
|
||||
|
||||
#include "moc_SkinFactory.cpp"
|
||||
|
@ -12,15 +12,6 @@ class SkinFactory : public QskSkinFactory
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum GraphicRoles
|
||||
{
|
||||
// to be visible on header/footer
|
||||
Indicator,
|
||||
};
|
||||
|
||||
QStringList skinNames() const override;
|
||||
QskSkin* createSkin( const QString& ) override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void rotateSkin();
|
||||
};
|
||||
|
@ -1,22 +1,17 @@
|
||||
CONFIG += qskexample qskqvg
|
||||
|
||||
HEADERS += \
|
||||
ButtonBar.h \
|
||||
SkinFactory.h \
|
||||
MainWindow.h \
|
||||
Speedometer.h \
|
||||
SpeedometerSkinlet.h \
|
||||
SpeedometerDisplay.h
|
||||
Dial.h \
|
||||
DialSkinlet.h \
|
||||
Dashboard.h
|
||||
|
||||
SOURCES += \
|
||||
ButtonBar.cpp \
|
||||
SkinFactory.cpp \
|
||||
MainWindow.cpp \
|
||||
Speedometer.cpp \
|
||||
SpeedometerSkinlet.cpp \
|
||||
SpeedometerDisplay.cpp \
|
||||
Dial.cpp \
|
||||
DialSkinlet.cpp \
|
||||
Dashboard.cpp \
|
||||
main.cpp \
|
||||
|
||||
RESOURCES += \
|
||||
images.qrc \
|
||||
qvgfiles.qrc
|
||||
images.qrc
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 510 510" style="enable-background:new 0 0 510 510;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="bluetooth">
|
||||
<path d="M416.925,145.35L271.575,0h-25.5v193.8l-117.3-117.3l-35.7,35.7l142.8,142.8l-142.8,142.8l35.7,35.7l117.3-117.3V510h25.5 l145.35-145.35L307.275,255L416.925,145.35z M297.075,96.9l48.45,48.45l-48.45,48.45V96.9z M345.525,364.65l-48.45,48.449V316.2 L345.525,364.65z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 815 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 510 510" style="enable-background:new 0 0 510 510;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="star-outline">
|
||||
<path d="M510,197.472l-183.37-15.734L255,12.75l-71.629,168.988L0,197.472l139.103,120.539L97.41,497.25L255,402.186 l157.59,95.064l-41.692-179.239L510,197.472z M255,354.348l-95.957,57.886l25.398-109.166l-84.736-73.389l111.69-9.588 L255,117.172l43.605,102.918l111.689,9.588l-84.711,73.389l25.398,109.166L255,354.348z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 864 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 484.5 484.5" style="enable-background:new 0 0 484.5 484.5;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="directions-bus">
|
||||
<path d="M38.25,357c0,22.95,10.2,43.35,25.5,56.1V459c0,15.3,10.2,25.5,25.5,25.5h25.5c15.3,0,25.5-10.2,25.5-25.5v-25.5h204V459 c0,15.3,10.2,25.5,25.5,25.5h25.5c15.3,0,25.5-10.2,25.5-25.5v-45.9c15.3-12.75,25.5-33.149,25.5-56.1V102 c0-89.25-91.8-102-204-102s-204,12.75-204,102V357z M127.5,382.5c-20.4,0-38.25-17.85-38.25-38.25S107.1,306,127.5,306 s38.25,17.85,38.25,38.25S147.9,382.5,127.5,382.5z M357,382.5c-20.4,0-38.25-17.85-38.25-38.25S336.6,306,357,306 s38.25,17.85,38.25,38.25S377.4,382.5,357,382.5z M395.25,229.5h-306V102h306V229.5z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 30 KiB |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 612 612" style="enable-background:new 0 0 612 612;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="cloud-queue">
|
||||
<path d="M494.7,255C476.85,168.3,400.35,102,306,102c-73.95,0-137.7,40.8-168.3,102C58.65,214.2,0,277.95,0,357 c0,84.15,68.85,153,153,153h331.5c71.4,0,127.5-56.1,127.5-127.5C612,316.2,558.45,260.1,494.7,255z M484.5,459H153 c-56.1,0-102-45.9-102-102c0-56.1,45.9-102,102-102h17.85c17.85-58.65,71.4-102,135.15-102c76.5,0,140.25,63.75,140.25,140.25V306 h38.25c43.35,0,76.5,33.15,76.5,76.5S527.85,459,484.5,459z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 957 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 510 510" style="enable-background:new 0 0 510 510;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="explore">
|
||||
<path d="M255,226.95c-15.3,0-28.05,12.75-28.05,28.05s12.75,28.05,28.05,28.05s28.05-12.75,28.05-28.05S270.3,226.95,255,226.95z M255,0C114.75,0,0,114.75,0,255s114.75,255,255,255s255-114.75,255-255S395.25,0,255,0z M311.1,311.1L102,408l96.9-209.1L408,102 L311.1,311.1z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 811 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 306 306" style="enable-background:new 0 0 306 306;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="keyboard-arrow-down">
|
||||
<polygon points="35.7,58.65 153,175.951 270.3,58.65 306,94.351 153,247.35 0,94.351 " fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 637 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 306 306" style="enable-background:new 0 0 306 306;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="chevron-left">
|
||||
<polygon points="247.35,35.7 211.65,0 58.65,153 211.65,306 247.35,270.3 130.05,153 " fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 630 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 459 459" style="enable-background:new 0 0 459 459;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="location">
|
||||
<polygon points="0,229.5 229.5,229.5 229.5,459 255,459 459,0 0,204 " fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 610 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 555.9 555.9" style="enable-background:new 0 0 555.9 555.9;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="directionswalk">
|
||||
<path d="M316.2,91.8c25.5,0,45.9-20.4,45.9-45.9S341.7,0,316.2,0s-45.9,20.4-45.9,45.9S290.7,91.8,316.2,91.8z M318.75,249.9 H443.7V204h-91.8l-51-84.15c-7.65-12.75-22.95-22.95-38.25-22.95c-5.1,0-7.65,0-12.75,2.55L112.2,142.8v132.6h45.9v-94.35 l53.55-17.85L112.2,555.9h45.9l73.95-206.551L290.7,428.4v127.5h45.9V392.699l-63.75-114.75L290.7,204L318.75,249.9z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 913 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 433.5 433.5" style="enable-background:new 0 0 433.5 433.5;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="view-headline">
|
||||
<path d="M0,293.25h433.5v-51H0V293.25z M0,395.25h433.5v-51H0V395.25z M0,191.25h433.5v-51H0V191.25z M0,38.25v51h433.5v-51H0z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 677 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 459 459" style="enable-background:new 0 0 459 459;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="phone-in-talk">
|
||||
<path d="M433.5,318.75c-30.6,0-61.2-5.1-91.8-15.3c-7.65-2.55-17.851,0-25.5,5.1L260.1,364.65 c-71.399-35.7-130.05-96.9-168.3-168.3l56.1-56.1c7.65-7.65,10.2-17.85,5.1-25.5c-7.65-28.05-12.75-58.65-12.75-89.25 c0-15.3-10.2-25.5-25.5-25.5H25.5C10.2,0,0,10.2,0,25.5C0,265.2,193.8,459,433.5,459c15.3,0,25.5-10.2,25.5-25.5v-89.25 C459,328.95,448.8,318.75,433.5,318.75z M408,229.5h51C459,102,357,0,229.5,0v51C328.95,51,408,130.05,408,229.5z M306,229.5h51 c0-71.4-56.1-127.5-127.5-127.5v51C272.85,153,306,186.15,306,229.5z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.0 KiB |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 510 510" style="enable-background:new 0 0 510 510;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="airplanemode-on">
|
||||
<path d="M497.25,357v-51l-204-127.5V38.25C293.25,17.85,275.4,0,255,0c-20.4,0-38.25,17.85-38.25,38.25V178.5L12.75,306v51 l204-63.75V433.5l-51,38.25V510L255,484.5l89.25,25.5v-38.25l-51-38.25V293.25L497.25,357z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 758 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 306 306" style="enable-background:new 0 0 306 306;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="keyboard-arrow-right">
|
||||
<polygon points="58.65,267.75 175.95,153 58.65,35.7 94.35,0 247.35,153 94.35,306 " fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 636 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 484.5 484.5" style="enable-background:new 0 0 484.5 484.5;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="directions-transit">
|
||||
<path d="M242.25,0c-112.2,0-204,12.75-204,102v242.25c0,48.45,40.8,89.25,89.25,89.25l-38.25,38.25v12.75h306v-12.75L357,433.5 c48.45,0,89.25-40.8,89.25-89.25V102C446.25,12.75,354.45,0,242.25,0z M127.5,382.5c-20.4,0-38.25-17.85-38.25-38.25 S107.1,306,127.5,306s38.25,17.85,38.25,38.25S147.9,382.5,127.5,382.5z M216.75,229.5H89.25V102h127.5V229.5z M357,382.5 c-20.4,0-38.25-17.85-38.25-38.25S336.6,306,357,306s38.25,17.85,38.25,38.25S377.4,382.5,357,382.5z M395.25,229.5h-127.5V102 h127.5V229.5z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.0 KiB |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 306 306" style="enable-background:new 0 0 306 306;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="expand-less">
|
||||
<polygon points="153,58.65 0,211.65 35.7,247.35 153,130.05 270.3,247.35 306,211.65 " fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 629 B |
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 408 408" style="enable-background:new 0 0 408 408;" xml:space="preserve">
|
||||
<g>
|
||||
<g id="person">
|
||||
<path d="M204,204c56.1,0,102-45.9,102-102S260.1,0,204,0c-56.1,0-102,45.9-102,102S147.9,204,204,204z M204,255 C135.15,255,0,288.15,0,357v51h408v-51C408,288.15,272.85,255,204,255z" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 719 B |
@ -3,18 +3,41 @@
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "Dashboard.h"
|
||||
#include "SkinFactory.h"
|
||||
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskSetup.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskSkinManager.h>
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <SkinnyShortcut.h>
|
||||
#include <QskGraphic.h>
|
||||
#include <QskGraphicIO.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
|
||||
namespace
|
||||
{
|
||||
class Window : public QskWindow
|
||||
{
|
||||
public:
|
||||
Window()
|
||||
{
|
||||
setAutoLayoutChildren( true );
|
||||
|
||||
const QImage image( QStringLiteral( ":/images/background.jpg" ) );
|
||||
|
||||
auto backgroundImage = new QskGraphicLabel( contentItem() );
|
||||
backgroundImage->setGraphic( QskGraphic::fromImage( image ) );
|
||||
backgroundImage->setFillMode( QskGraphicLabel::Stretch );
|
||||
|
||||
(void ) new Dashboard( contentItem() );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
#ifdef ITEM_STATISTICS
|
||||
@ -26,15 +49,9 @@ int main( int argc, char** argv )
|
||||
|
||||
QGuiApplication app( argc, argv );
|
||||
|
||||
/*
|
||||
When going over QPainter for the SVGs we prefer the raster paint
|
||||
engine, simply showing better results.
|
||||
*/
|
||||
qskSetup->setItemUpdateFlag( QskQuickItem::PreferRasterForTextures, true );
|
||||
|
||||
SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );
|
||||
|
||||
MainWindow window;
|
||||
Window window;
|
||||
window.show();
|
||||
|
||||
return app.exec();
|
||||
|
@ -1,24 +0,0 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
|
||||
<qresource>
|
||||
<file>qvg/car.qvg</file>
|
||||
<file>qvg/bluetooth.qvg</file>
|
||||
<file>qvg/bookmark.qvg</file>
|
||||
<file>qvg/bus.qvg</file>
|
||||
<file>qvg/cloud.qvg</file>
|
||||
<file>qvg/location.qvg</file>
|
||||
<file>qvg/man.qvg</file>
|
||||
<file>qvg/menu.qvg</file>
|
||||
<file>qvg/phone.qvg</file>
|
||||
<file>qvg/plane.qvg</file>
|
||||
<file>qvg/train.qvg</file>
|
||||
<file>qvg/user.qvg</file>
|
||||
<file>qvg/down.qvg</file>
|
||||
<file>qvg/left.qvg</file>
|
||||
<file>qvg/right.qvg</file>
|
||||
<file>qvg/up.qvg</file>
|
||||
</qresource>
|
||||
|
||||
</RCC>
|
||||
|