uncrustified
This commit is contained in:
parent
66cc68bcda
commit
923affe749
|
@ -35,7 +35,7 @@ namespace
|
|||
class Skin : public QskSkin
|
||||
{
|
||||
public:
|
||||
Skin()
|
||||
Skin()
|
||||
{
|
||||
declareSkinlet< Speedometer, SpeedometerSkinlet >();
|
||||
|
||||
|
@ -49,7 +49,7 @@ namespace
|
|||
class Skin1 : public Skin
|
||||
{
|
||||
public:
|
||||
Skin1()
|
||||
Skin1()
|
||||
{
|
||||
const QColor color1( "#363636" ); // Jet
|
||||
const QColor color2( "#242F40" ); // Yankees blue
|
||||
|
@ -100,7 +100,7 @@ namespace
|
|||
class Skin2 : public Skin
|
||||
{
|
||||
public:
|
||||
Skin2()
|
||||
Skin2()
|
||||
{
|
||||
const QColor color1( "#011627" ); // Maastricht blue
|
||||
const QColor color2( "#FF0022" ); // ruddy
|
||||
|
|
|
@ -122,7 +122,7 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
|||
|
||||
setMargins( 10 );
|
||||
setSpacing( 10 );
|
||||
|
||||
|
||||
auto timer = new QTimer( this );
|
||||
|
||||
connect( timer, &QTimer::timeout, speedometer, &Speedo::updateValue );
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace
|
|||
auto vertexData = geometry()->vertexDataAsPoint2D();
|
||||
vertexData[ 0 ].set( line.x1(), line.y1() );
|
||||
vertexData[ 1 ].set( line.x2(), line.y2() );
|
||||
|
||||
|
||||
geometry()->setLineWidth( width );
|
||||
geometry()->markVertexDataDirty();
|
||||
|
||||
|
@ -104,7 +104,7 @@ QRectF SpeedometerSkinlet::subControlRect( const QskSkinnable* skinnable,
|
|||
const auto extent = qMin( contentsRect.width(), contentsRect.height() );
|
||||
r.setSize( QSizeF( extent, extent ) );
|
||||
}
|
||||
|
||||
|
||||
r.moveCenter( contentsRect.center() );
|
||||
|
||||
return r;
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace
|
|||
*/
|
||||
|
||||
QskSkinHintTableEditor ed( &newSkin->hintTable() );
|
||||
|
||||
|
||||
ed.setColor( QskListView::CellSelected, m_accent.darker( 130 ) );
|
||||
ed.setBoxBorderColors( QskFocusIndicator::Panel, m_accent.darker( 150 ) );
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ void SwitchButtonPage::populate()
|
|||
|
||||
auto label = new QskTextLabel( "Disable the switches:", hbox1 );
|
||||
label->setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||
|
||||
|
||||
auto button0 = new QskSwitchButton( hbox1 );
|
||||
|
||||
auto hbox2 = new QskLinearBox( Qt::Horizontal );
|
||||
|
|
|
@ -12,18 +12,19 @@ class QskTextLabel;
|
|||
|
||||
class Box : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
Q_OBJECT
|
||||
|
||||
Box( const QString& title, QQuickItem* parent );
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override;
|
||||
Box( const QString& title, QQuickItem* parent );
|
||||
|
||||
private:
|
||||
QString m_title;
|
||||
QskTextLabel* m_label;
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override;
|
||||
|
||||
private:
|
||||
QString m_title;
|
||||
QskTextLabel* m_label;
|
||||
};
|
||||
|
||||
#endif // BOX_H
|
||||
|
|
|
@ -14,91 +14,92 @@
|
|||
|
||||
class ButtonValueLabel : public QskTextLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
|
||||
ButtonValueLabel( const QString& text, QQuickItem* parent ) : QskTextLabel( text, parent )
|
||||
ButtonValueLabel( const QString& text, QQuickItem* parent )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class TitleAndValueBox : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
TitleAndValueBox( Qt::Orientation orientation, QQuickItem* parent )
|
||||
: QskLinearBox( orientation, parent )
|
||||
TitleAndValueBox( Qt::Orientation orientation, QQuickItem* parent )
|
||||
: QskLinearBox( orientation, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
setPanel( true );
|
||||
return Panel;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class BoxWithButtons : public Box
|
||||
{
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
BoxWithButtons( const QString& title, const QString& value, bool isBright, QQuickItem* parent = nullptr );
|
||||
BoxWithButtons( const QString& title, const QString& value, bool isBright, QQuickItem* parent = nullptr );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class IndoorTemperature : public BoxWithButtons
|
||||
{
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
IndoorTemperature( QQuickItem* parent )
|
||||
: BoxWithButtons( "Indoor Temperature", "+24", true, parent )
|
||||
{
|
||||
}
|
||||
IndoorTemperature( QQuickItem* parent )
|
||||
: BoxWithButtons( "Indoor Temperature", "+24", true, parent )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class Humidity: public BoxWithButtons
|
||||
class Humidity : public BoxWithButtons
|
||||
{
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
Humidity( QQuickItem* parent )
|
||||
: BoxWithButtons( "Humidity", "30%", false, parent )
|
||||
{
|
||||
}
|
||||
Humidity( QQuickItem* parent )
|
||||
: BoxWithButtons( "Humidity", "30%", false, parent )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif // BOXWITHBUTTONS_H
|
||||
|
|
|
@ -13,47 +13,47 @@
|
|||
|
||||
class CircularProgressBar : public QQuickPaintedItem
|
||||
{
|
||||
public:
|
||||
CircularProgressBar( const QskGradient& gradient, int progress, QQuickItem* parent = nullptr );
|
||||
public:
|
||||
CircularProgressBar( const QskGradient& gradient, int progress, QQuickItem* parent = nullptr );
|
||||
|
||||
virtual void paint( QPainter* painter ) override;
|
||||
virtual void paint( QPainter* painter ) override;
|
||||
|
||||
double width() const
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
double width() const
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
|
||||
void setWidth( double width )
|
||||
{
|
||||
m_width = width;
|
||||
}
|
||||
void setWidth( double width )
|
||||
{
|
||||
m_width = width;
|
||||
}
|
||||
|
||||
QColor backgroundColor() const
|
||||
{
|
||||
return m_backgroundColor;
|
||||
}
|
||||
QColor backgroundColor() const
|
||||
{
|
||||
return m_backgroundColor;
|
||||
}
|
||||
|
||||
void setBackgroundColor( const QColor& color )
|
||||
{
|
||||
m_backgroundColor = color;
|
||||
}
|
||||
void setBackgroundColor( const QColor& color )
|
||||
{
|
||||
m_backgroundColor = color;
|
||||
}
|
||||
|
||||
QRadialGradient ringGradient() const
|
||||
{
|
||||
return m_ringGradient;
|
||||
}
|
||||
QRadialGradient ringGradient() const
|
||||
{
|
||||
return m_ringGradient;
|
||||
}
|
||||
|
||||
void setRingGradient( const QRadialGradient& gradient )
|
||||
{
|
||||
m_ringGradient = gradient;
|
||||
}
|
||||
void setRingGradient( const QRadialGradient& gradient )
|
||||
{
|
||||
m_ringGradient = gradient;
|
||||
}
|
||||
|
||||
private:
|
||||
QGradient m_gradient;
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
double m_width = 20;
|
||||
int m_progress;
|
||||
private:
|
||||
QGradient m_gradient;
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
double m_width = 20;
|
||||
int m_progress;
|
||||
};
|
||||
|
||||
#endif // CIRCULARPROGRESSBAR_H
|
||||
|
|
|
@ -7,16 +7,12 @@
|
|||
|
||||
class Diagram::PrivateData
|
||||
{
|
||||
public:
|
||||
PrivateData()
|
||||
{
|
||||
}
|
||||
|
||||
QVector<QVector<QPointF> > dataPoints;
|
||||
int xGridLines = -1;
|
||||
qreal yMax = -1;
|
||||
Qsk::Position position = Qsk::Bottom;
|
||||
QVector<Types> types;
|
||||
public:
|
||||
QVector< QVector< QPointF > > dataPoints;
|
||||
int xGridLines = -1;
|
||||
qreal yMax = -1;
|
||||
Qsk::Position position = Qsk::Bottom;
|
||||
QVector< Types > types;
|
||||
};
|
||||
|
||||
QSK_SUBCONTROL( Diagram, Chart )
|
||||
|
@ -38,12 +34,12 @@ Diagram::~Diagram()
|
|||
{
|
||||
}
|
||||
|
||||
QVector< QVector<QPointF> > Diagram::dataPoints() const
|
||||
QVector< QVector< QPointF > > Diagram::dataPoints() const
|
||||
{
|
||||
return m_data->dataPoints;
|
||||
}
|
||||
|
||||
void Diagram::addDataPoints( const QVector<QPointF>& dataPoints, const Types& types )
|
||||
void Diagram::addDataPoints( const QVector< QPointF >& dataPoints, const Types& types )
|
||||
{
|
||||
m_data->dataPoints.append( dataPoints );
|
||||
m_data->types.append( types );
|
||||
|
|
|
@ -11,44 +11,44 @@
|
|||
|
||||
class Diagram : public QskControl
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
using Inherited = QskControl;
|
||||
using Inherited = QskControl;
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Chart, Segments, ChartLine1, ChartArea1, ChartLine2, ChartArea2, ChartLine3, ChartArea3 )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Chart, Segments, ChartLine1, ChartArea1, ChartLine2, ChartArea2, ChartLine3, ChartArea3 )
|
||||
|
||||
enum Type
|
||||
{
|
||||
Line = 0x01,
|
||||
Area = 0x02,
|
||||
};
|
||||
enum Type
|
||||
{
|
||||
Line = 0x01,
|
||||
Area = 0x02,
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS( Types, Type )
|
||||
Q_DECLARE_FLAGS( Types, Type )
|
||||
|
||||
Diagram( QQuickItem* parent = nullptr );
|
||||
~Diagram() override;
|
||||
Diagram( QQuickItem* parent = nullptr );
|
||||
~Diagram() override;
|
||||
|
||||
QVector< QVector<QPointF> > dataPoints() const;
|
||||
void addDataPoints( const QVector<QPointF>& dataPoints, const Types& types );
|
||||
QVector< QVector< QPointF > > dataPoints() const;
|
||||
void addDataPoints( const QVector< QPointF >& dataPoints, const Types& types );
|
||||
|
||||
Types typesAt( uint pos ) const;
|
||||
Types typesAt( uint pos ) const;
|
||||
|
||||
qreal yMax() const;
|
||||
void setYMax( qreal yMax );
|
||||
qreal yMax() const;
|
||||
void setYMax( qreal yMax );
|
||||
|
||||
int xGridLines() const;
|
||||
void setXGridLines( int lines );
|
||||
int xGridLines() const;
|
||||
void setXGridLines( int lines );
|
||||
|
||||
Qsk::Position chartPosition() const;
|
||||
void setChartPosition( Qsk::Position position );
|
||||
Qsk::Position chartPosition() const;
|
||||
void setChartPosition( Qsk::Position position );
|
||||
|
||||
protected:
|
||||
QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
protected:
|
||||
QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
|
||||
private:
|
||||
class PrivateData;
|
||||
std::unique_ptr< PrivateData > m_data;
|
||||
private:
|
||||
class PrivateData;
|
||||
std::unique_ptr< PrivateData > m_data;
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Diagram::Types )
|
||||
|
|
|
@ -71,14 +71,14 @@ QSGNode* DiagramSkinlet::updateSubNode(
|
|||
switch( nodeRole )
|
||||
{
|
||||
case ChartRole:
|
||||
{
|
||||
return updateChartNode( discharge, node );
|
||||
}
|
||||
{
|
||||
return updateChartNode( discharge, node );
|
||||
}
|
||||
|
||||
case SeparatorRole:
|
||||
{
|
||||
return updateSeparatorNode( discharge, node );
|
||||
}
|
||||
{
|
||||
return updateSeparatorNode( discharge, node );
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -95,7 +95,7 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
|
|||
const QRectF rect = diagram->subControlRect( Q::Chart );
|
||||
const qreal yMax = diagram->yMax();
|
||||
const Qsk::Position position = diagram->chartPosition();
|
||||
QVector<Diagram::Type> types = {Diagram::Line, Diagram::Area};
|
||||
QVector< Diagram::Type > types = { Diagram::Line, Diagram::Area };
|
||||
|
||||
for( int i = 0; i < diagram->dataPoints().size(); ++i )
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
|
|||
node->appendChildNode( chartNode );
|
||||
}
|
||||
|
||||
const QVector<QPointF> dataPoints = diagram->dataPoints().at( i );
|
||||
const QVector< QPointF > dataPoints = diagram->dataPoints().at( i );
|
||||
int nodeIndex = 0;
|
||||
QskAspect::Subcontrol lineSubcontrol = lineForIndex( i );
|
||||
QskAspect::Subcontrol areaSubcontrol = areaForIndex( i );
|
||||
|
@ -125,7 +125,7 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
|
|||
|
||||
if( chartNode->childCount() > nodeIndex )
|
||||
{
|
||||
dataPointNode = static_cast<DiagramDataNode*>( chartNode->childAtIndex( nodeIndex ) );
|
||||
dataPointNode = static_cast< DiagramDataNode* >( chartNode->childAtIndex( nodeIndex ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ QSGNode* DiagramSkinlet::updateSeparatorNode( const Diagram* diagram, QSGNode* n
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
auto* separatorNode = static_cast<DiagramSegmentsNode*>( node );
|
||||
auto* separatorNode = static_cast< DiagramSegmentsNode* >( node );
|
||||
|
||||
if( separatorNode == nullptr )
|
||||
{
|
||||
|
@ -172,7 +172,7 @@ QSGNode* DiagramSkinlet::updateSeparatorNode( const Diagram* diagram, QSGNode* n
|
|||
using Q = Diagram;
|
||||
const QRectF rect = diagram->subControlRect( Q::Chart );
|
||||
const QColor color = diagram->color( Q::Segments );
|
||||
const QVector< QVector<QPointF> > dataPoints = diagram->dataPoints();
|
||||
const QVector< QVector< QPointF > > dataPoints = diagram->dataPoints();
|
||||
|
||||
separatorNode->update( rect, color, dataPoints, xGridLines );
|
||||
|
||||
|
|
|
@ -12,31 +12,31 @@ class Diagram;
|
|||
|
||||
class DiagramSkinlet : public QskSkinlet
|
||||
{
|
||||
Q_GADGET
|
||||
Q_GADGET
|
||||
|
||||
using Inherited = QskSkinlet;
|
||||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
{
|
||||
ChartRole,
|
||||
SeparatorRole,
|
||||
};
|
||||
public:
|
||||
enum NodeRole
|
||||
{
|
||||
ChartRole,
|
||||
SeparatorRole,
|
||||
};
|
||||
|
||||
Q_INVOKABLE DiagramSkinlet( QskSkin* = nullptr );
|
||||
~DiagramSkinlet() override;
|
||||
Q_INVOKABLE DiagramSkinlet( QskSkin* = nullptr );
|
||||
~DiagramSkinlet() override;
|
||||
|
||||
QRectF subControlRect( const QskSkinnable*,
|
||||
const QRectF&, QskAspect::Subcontrol ) const override;
|
||||
QRectF subControlRect( const QskSkinnable*,
|
||||
const QRectF&, QskAspect::Subcontrol ) const override;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
QSGNode* updateSubNode( const QskSkinnable*,
|
||||
quint8 nodeRole, QSGNode* ) const override;
|
||||
QSGNode* updateSubNode( const QskSkinnable*,
|
||||
quint8 nodeRole, QSGNode* ) const override;
|
||||
|
||||
private:
|
||||
QSGNode* updateChartNode( const Diagram*, QSGNode* ) const;
|
||||
QSGNode* updateSeparatorNode( const Diagram*, QSGNode* ) const;
|
||||
private:
|
||||
QSGNode* updateChartNode( const Diagram*, QSGNode* ) const;
|
||||
QSGNode* updateSeparatorNode( const Diagram*, QSGNode* ) const;
|
||||
};
|
||||
|
||||
#endif // DIAGRAM_SKINLET_H
|
||||
|
|
|
@ -34,51 +34,51 @@ namespace
|
|||
// ### There must be an easier way to do this
|
||||
class DimmerAnimator : public QskAnimator
|
||||
{
|
||||
public:
|
||||
DimmerAnimator( LightDisplay* display, LightDimmer* dimmer )
|
||||
: m_display( display )
|
||||
, m_dimmer( dimmer )
|
||||
public:
|
||||
DimmerAnimator( LightDisplay* display, LightDimmer* dimmer )
|
||||
: m_display( display )
|
||||
, m_dimmer( dimmer )
|
||||
{
|
||||
QQuickWindow* w = static_cast< QQuickWindow* >( qGuiApp->allWindows().at( 0 ) );
|
||||
setWindow( w );
|
||||
setDuration( 500 );
|
||||
setEasingCurve( QEasingCurve::Linear );
|
||||
setAutoRepeat( false );
|
||||
}
|
||||
|
||||
void setup() override
|
||||
{
|
||||
m_backgroundColor = m_display->color( LightDisplay::Panel );
|
||||
m_ringGradient = m_dimmer->ringGradient();
|
||||
}
|
||||
|
||||
void advance( qreal value ) override
|
||||
{
|
||||
const QColor c = m_backgroundColor;
|
||||
const QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c2, c, value );
|
||||
m_dimmer->setBackgroundColor( newColor );
|
||||
|
||||
QRadialGradient gradient = m_ringGradient;
|
||||
QRadialGradient newGradient = gradient;
|
||||
|
||||
for( const QGradientStop& stop : gradient.stops() )
|
||||
{
|
||||
QQuickWindow* w = static_cast<QQuickWindow*>( qGuiApp->allWindows().at( 0 ) );
|
||||
setWindow( w );
|
||||
setDuration( 500 );
|
||||
setEasingCurve( QEasingCurve::Linear );
|
||||
setAutoRepeat( false );
|
||||
QColor c = stop.second;
|
||||
QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c, c2, value );
|
||||
newGradient.setColorAt( stop.first, newColor );
|
||||
}
|
||||
|
||||
void setup() override
|
||||
{
|
||||
m_backgroundColor = m_display->color( LightDisplay::Panel );
|
||||
m_ringGradient = m_dimmer->ringGradient();
|
||||
}
|
||||
m_dimmer->setRingGradient( newGradient );
|
||||
m_dimmer->update();
|
||||
}
|
||||
|
||||
void advance( qreal value ) override
|
||||
{
|
||||
const QColor c = m_backgroundColor;
|
||||
const QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c2, c, value );
|
||||
m_dimmer->setBackgroundColor( newColor );
|
||||
|
||||
QRadialGradient gradient = m_ringGradient;
|
||||
QRadialGradient newGradient = gradient;
|
||||
|
||||
for( const QGradientStop& stop : gradient.stops() )
|
||||
{
|
||||
QColor c = stop.second;
|
||||
QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c, c2, value );
|
||||
newGradient.setColorAt( stop.first, newColor );
|
||||
}
|
||||
|
||||
m_dimmer->setRingGradient( newGradient );
|
||||
m_dimmer->update();
|
||||
}
|
||||
|
||||
private:
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
LightDisplay* m_display;
|
||||
LightDimmer* m_dimmer;
|
||||
private:
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
LightDisplay* m_display;
|
||||
LightDimmer* m_dimmer;
|
||||
};
|
||||
|
||||
LightDimmer::LightDimmer( const QskGradient& coldGradient, const QskGradient& warmGradient, QQuickItem* parent )
|
||||
|
|
|
@ -18,103 +18,104 @@ class QskTextLabel;
|
|||
|
||||
class LightIntensityValueLabel : public QskTextLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
|
||||
LightIntensityValueLabel( const QString& text, QQuickItem* parent ) : QskTextLabel( text, parent )
|
||||
LightIntensityValueLabel( const QString& text, QQuickItem* parent )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class LightDimmer: public QQuickPaintedItem
|
||||
class LightDimmer : public QQuickPaintedItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LightDimmer( const QskGradient& coldGradient, const QskGradient& warmGradient, QQuickItem* parent );
|
||||
public:
|
||||
LightDimmer( const QskGradient& coldGradient, const QskGradient& warmGradient, QQuickItem* parent );
|
||||
|
||||
double thickness() const
|
||||
{
|
||||
return m_thickness;
|
||||
}
|
||||
double thickness() const
|
||||
{
|
||||
return m_thickness;
|
||||
}
|
||||
|
||||
void setThickness( double thickness )
|
||||
{
|
||||
m_thickness = thickness;
|
||||
}
|
||||
void setThickness( double thickness )
|
||||
{
|
||||
m_thickness = thickness;
|
||||
}
|
||||
|
||||
QColor backgroundColor() const
|
||||
{
|
||||
return m_backgroundColor;
|
||||
}
|
||||
QColor backgroundColor() const
|
||||
{
|
||||
return m_backgroundColor;
|
||||
}
|
||||
|
||||
void setBackgroundColor( const QColor& color )
|
||||
{
|
||||
m_backgroundColor = color;
|
||||
}
|
||||
void setBackgroundColor( const QColor& color )
|
||||
{
|
||||
m_backgroundColor = color;
|
||||
}
|
||||
|
||||
QRadialGradient ringGradient() const
|
||||
{
|
||||
return m_ringGradient;
|
||||
}
|
||||
QRadialGradient ringGradient() const
|
||||
{
|
||||
return m_ringGradient;
|
||||
}
|
||||
|
||||
void setRingGradient( const QRadialGradient& gradient )
|
||||
{
|
||||
m_ringGradient = gradient;
|
||||
}
|
||||
void setRingGradient( const QRadialGradient& gradient )
|
||||
{
|
||||
m_ringGradient = gradient;
|
||||
}
|
||||
|
||||
private:
|
||||
double m_thickness = 17.57;
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
QskGradient m_coldGradient;
|
||||
QskGradient m_warmGradient;
|
||||
private:
|
||||
double m_thickness = 17.57;
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
QskGradient m_coldGradient;
|
||||
QskGradient m_warmGradient;
|
||||
|
||||
virtual void paint( QPainter* painter ) override;
|
||||
virtual void paint( QPainter* painter ) override;
|
||||
};
|
||||
|
||||
class LightDisplay : public QskControl
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, ColdPart, WarmPart )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, ColdPart, WarmPart )
|
||||
|
||||
LightDisplay( QQuickItem* parent );
|
||||
LightDisplay( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
|
||||
protected:
|
||||
void updateLayout() override;
|
||||
protected:
|
||||
void updateLayout() override;
|
||||
|
||||
private:
|
||||
QskTextLabel* m_leftLabel;
|
||||
LightIntensityValueLabel* m_centreLabel;
|
||||
QskTextLabel* m_rightLabel;
|
||||
LightDimmer* m_dimmer;
|
||||
DimmerAnimator* m_animator;
|
||||
private:
|
||||
QskTextLabel* m_leftLabel;
|
||||
LightIntensityValueLabel* m_centreLabel;
|
||||
QskTextLabel* m_rightLabel;
|
||||
LightDimmer* m_dimmer;
|
||||
DimmerAnimator* m_animator;
|
||||
};
|
||||
|
||||
class LightIntensity : public Box
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LightIntensity( QQuickItem* parent );
|
||||
public:
|
||||
LightIntensity( QQuickItem* parent );
|
||||
};
|
||||
|
||||
#endif // LIGHTINTENSITY_H
|
||||
|
|
|
@ -32,7 +32,8 @@ QSK_SUBCONTROL( ShadowPositioner, Panel )
|
|||
QSK_SUBCONTROL( MainContent, Panel )
|
||||
QSK_SUBCONTROL( MainContentGridBox, Panel )
|
||||
|
||||
ShadowPositioner::ShadowPositioner( QQuickItem* parent ) : QskControl( parent )
|
||||
ShadowPositioner::ShadowPositioner( QQuickItem* parent )
|
||||
: QskControl( parent )
|
||||
{
|
||||
setAutoLayoutChildren( true );
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ void ShadowPositioner::setGridBox( QskGridBox* gridBox )
|
|||
|
||||
void ShadowPositioner::updateLayout()
|
||||
{
|
||||
auto* mainContent = static_cast<QskLinearBox*>( parentItem() );
|
||||
auto* mainContent = static_cast< QskLinearBox* >( parentItem() );
|
||||
|
||||
QTimer::singleShot( 0, this, [this, mainContent]()
|
||||
{
|
||||
|
@ -81,7 +82,8 @@ void ShadowPositioner::updateLayout()
|
|||
} );
|
||||
}
|
||||
|
||||
MainContent::MainContent( QQuickItem* parent ) : QskLinearBox( Qt::Vertical, parent )
|
||||
MainContent::MainContent( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setAutoAddChildren( false );
|
||||
setSizePolicy( QskSizePolicy::Expanding, QskSizePolicy::Expanding );
|
||||
|
|
|
@ -13,63 +13,63 @@ class ShadowedRectangle;
|
|||
|
||||
class ShadowPositioner : public QskControl
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
ShadowPositioner( QQuickItem* parent );
|
||||
ShadowPositioner( QQuickItem* parent );
|
||||
|
||||
void updateLayout() override;
|
||||
void setGridBox( QskGridBox* gridBox );
|
||||
void updateLayout() override;
|
||||
void setGridBox( QskGridBox* gridBox );
|
||||
|
||||
private:
|
||||
QskGridBox* m_gridBox;
|
||||
QVector<ShadowedRectangle*> m_rectangles;
|
||||
private:
|
||||
QskGridBox* m_gridBox;
|
||||
QVector< ShadowedRectangle* > m_rectangles;
|
||||
};
|
||||
|
||||
class MainContentGridBox : public QskGridBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
MainContentGridBox( QQuickItem* parent = nullptr )
|
||||
: QskGridBox( parent )
|
||||
MainContentGridBox( QQuickItem* parent = nullptr )
|
||||
: QskGridBox( parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskGridBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskGridBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class MainContent : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
MainContent( QQuickItem* parent );
|
||||
MainContent( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
|
||||
protected:
|
||||
void geometryChangeEvent( QskGeometryChangeEvent* ) override;
|
||||
protected:
|
||||
void geometryChangeEvent( QskGeometryChangeEvent* ) override;
|
||||
|
||||
private:
|
||||
QList< QskLinearBox* > m_columns;
|
||||
ShadowPositioner* m_shadowPositioner;
|
||||
private:
|
||||
QList< QskLinearBox* > m_columns;
|
||||
ShadowPositioner* m_shadowPositioner;
|
||||
};
|
||||
|
||||
#endif // MAINCONTENT_H
|
||||
|
|
|
@ -14,15 +14,15 @@ class QskLinearBox;
|
|||
|
||||
class MainWindow : public QskWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow();
|
||||
public:
|
||||
MainWindow();
|
||||
|
||||
private:
|
||||
QskLinearBox* m_mainLayout;
|
||||
MenuBar* m_menuBar;
|
||||
MainContent* m_mainContent;
|
||||
private:
|
||||
QskLinearBox* m_mainLayout;
|
||||
MenuBar* m_menuBar;
|
||||
MainContent* m_mainContent;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
@ -21,8 +21,9 @@ QSK_SUBCONTROL( MenuBar, Panel )
|
|||
|
||||
QSK_STATE( MenuItem, Active, ( QskAspect::FirstUserState << 1 ) )
|
||||
|
||||
MenuItem::MenuItem( const QString& name, QQuickItem* parent ) : QskLinearBox( Qt::Horizontal, parent ),
|
||||
m_name( name )
|
||||
MenuItem::MenuItem( const QString& name, QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Horizontal, parent )
|
||||
, m_name( name )
|
||||
{
|
||||
setAutoLayoutChildren( true );
|
||||
setAutoAddChildren( true );
|
||||
|
@ -53,7 +54,8 @@ QskAspect::Subcontrol MenuItem::effectiveSubcontrol( QskAspect::Subcontrol subCo
|
|||
}
|
||||
|
||||
|
||||
MenuBar::MenuBar( QQuickItem* parent ) : QskLinearBox( Qt::Vertical, parent )
|
||||
MenuBar::MenuBar( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
setSizePolicy( QskSizePolicy::Minimum, QskSizePolicy::Preferred );
|
||||
|
|
|
@ -12,108 +12,108 @@
|
|||
|
||||
class MenuBarTopLabel final : public QskGraphicLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Graphic )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Graphic )
|
||||
|
||||
MenuBarTopLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
||||
: QskGraphicLabel( graphic, parent )
|
||||
MenuBarTopLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
||||
: QskGraphicLabel( graphic, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskGraphicLabel::Graphic )
|
||||
{
|
||||
return Graphic;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskGraphicLabel::Graphic )
|
||||
{
|
||||
return Graphic;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class MenuBarGraphicLabel final : public QskGraphicLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Graphic )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Graphic )
|
||||
|
||||
MenuBarGraphicLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
||||
: QskGraphicLabel( graphic, parent )
|
||||
MenuBarGraphicLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
||||
: QskGraphicLabel( graphic, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskGraphicLabel::Graphic )
|
||||
{
|
||||
return Graphic;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskGraphicLabel::Graphic )
|
||||
{
|
||||
return Graphic;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class MenuBarLabel final : public QskTextLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
|
||||
MenuBarLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
MenuBarLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class MenuItem final : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
QSK_STATES( Active )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
QSK_STATES( Active )
|
||||
|
||||
MenuItem( const QString& name, QQuickItem* parent );
|
||||
MenuItem( const QString& name, QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol( QskAspect::Subcontrol ) const override;
|
||||
QskAspect::Subcontrol effectiveSubcontrol( QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
private:
|
||||
QString m_name;
|
||||
};
|
||||
|
||||
class MenuBar final : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
MenuBar( QQuickItem* parent );
|
||||
MenuBar( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
QList< QString > m_entryStrings;
|
||||
QList< MenuItem* > m_entries;
|
||||
uint m_activeEntry = 0;
|
||||
private:
|
||||
QList< QString > m_entryStrings;
|
||||
QList< MenuItem* > m_entries;
|
||||
uint m_activeEntry = 0;
|
||||
};
|
||||
|
||||
#endif // MENUBAR_H
|
||||
|
|
|
@ -18,49 +18,49 @@ namespace
|
|||
{
|
||||
class Device : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
Device( const QString& name, bool isBright, QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
, m_name( name )
|
||||
{
|
||||
setDefaultAlignment( Qt::AlignCenter );
|
||||
setAutoAddChildren( false );
|
||||
public:
|
||||
Device( const QString& name, bool isBright, QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
, m_name( name )
|
||||
{
|
||||
setDefaultAlignment( Qt::AlignCenter );
|
||||
setAutoAddChildren( false );
|
||||
|
||||
m_icon = new RoundedIcon( QString(), isBright, true, this );
|
||||
m_icon->setSkinState( m_icon->skinState() | RoundedIcon::Small );
|
||||
m_icon->setOpacity( 0.15 );
|
||||
addItem( m_icon );
|
||||
m_icon = new RoundedIcon( QString(), isBright, true, this );
|
||||
m_icon->setSkinState( m_icon->skinState() | RoundedIcon::Small );
|
||||
m_icon->setOpacity( 0.15 );
|
||||
addItem( m_icon );
|
||||
|
||||
auto* textLabel = new QskTextLabel( name, this );
|
||||
textLabel->setFontRole( QskSkin::TinyFont );
|
||||
textLabel->setAlignment( Qt::AlignHCenter );
|
||||
addItem( textLabel );
|
||||
auto* textLabel = new QskTextLabel( name, this );
|
||||
textLabel->setFontRole( QskSkin::TinyFont );
|
||||
textLabel->setAlignment( Qt::AlignHCenter );
|
||||
addItem( textLabel );
|
||||
|
||||
auto fileName = name.toLower();
|
||||
fileName.replace( ' ', '-' );
|
||||
fileName = ":/images/" + fileName + ".png";
|
||||
QImage image( fileName );
|
||||
auto graphic = QskGraphic::fromImage( image );
|
||||
m_graphicLabel = new QskGraphicLabel( graphic, this );
|
||||
}
|
||||
auto fileName = name.toLower();
|
||||
fileName.replace( ' ', '-' );
|
||||
fileName = ":/images/" + fileName + ".png";
|
||||
QImage image( fileName );
|
||||
auto graphic = QskGraphic::fromImage( image );
|
||||
m_graphicLabel = new QskGraphicLabel( graphic, this );
|
||||
}
|
||||
|
||||
protected:
|
||||
void updateLayout() override
|
||||
{
|
||||
QskLinearBox::updateLayout();
|
||||
protected:
|
||||
void updateLayout() override
|
||||
{
|
||||
QskLinearBox::updateLayout();
|
||||
|
||||
// We cannot use the icon from RoundedIcon here because
|
||||
// it would inherit the transparency
|
||||
const qreal size = metric( RoundedIcon::Icon | QskAspect::Size );
|
||||
m_graphicLabel->setSize( {size, size} );
|
||||
m_graphicLabel->setPosition( { m_icon->position().x() + ( m_icon->width() - m_graphicLabel->width() ) / 2,
|
||||
( m_icon->position().y() + m_icon->height() - m_graphicLabel->height() ) / 2 } );
|
||||
}
|
||||
// We cannot use the icon from RoundedIcon here because
|
||||
// it would inherit the transparency
|
||||
const qreal size = metric( RoundedIcon::Icon | QskAspect::Size );
|
||||
m_graphicLabel->setSize( {size, size} );
|
||||
m_graphicLabel->setPosition( { m_icon->position().x() + ( m_icon->width() - m_graphicLabel->width() ) / 2,
|
||||
( m_icon->position().y() + m_icon->height() - m_graphicLabel->height() ) / 2 } );
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
RoundedIcon* m_icon;
|
||||
QskGraphicLabel* m_graphicLabel;
|
||||
private:
|
||||
QString m_name;
|
||||
RoundedIcon* m_icon;
|
||||
QskGraphicLabel* m_graphicLabel;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
class MyDevices : public Box
|
||||
{
|
||||
public:
|
||||
MyDevices( QQuickItem* parent );
|
||||
public:
|
||||
MyDevices( QQuickItem* parent );
|
||||
};
|
||||
|
||||
#endif // MYDEVICES_H
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
QSK_SUBCONTROL( PieChart, Panel )
|
||||
QSK_SUBCONTROL( PieChart, Labels )
|
||||
|
||||
PieChart::PieChart( QQuickItem* parent ) : QskControl( parent )
|
||||
PieChart::PieChart( QQuickItem* parent )
|
||||
: QskControl( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -10,22 +10,22 @@
|
|||
|
||||
class PieChart : public QskControl
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Labels )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Labels )
|
||||
|
||||
PieChart( QQuickItem* parent = nullptr );
|
||||
PieChart( QQuickItem* parent = nullptr );
|
||||
|
||||
QVector< float > angles() const;
|
||||
void setAngles( const QVector< float >& angles );
|
||||
QVector< float > angles() const;
|
||||
void setAngles( const QVector< float >& angles );
|
||||
|
||||
QVector< QString > labels() const;
|
||||
void setLabels( const QVector< QString >& labels );
|
||||
QVector< QString > labels() const;
|
||||
void setLabels( const QVector< QString >& labels );
|
||||
|
||||
private:
|
||||
QVector< float > m_angles;
|
||||
QVector< QString > m_labels;
|
||||
private:
|
||||
QVector< float > m_angles;
|
||||
QVector< QString > m_labels;
|
||||
};
|
||||
|
||||
#endif // PIECHART_H
|
||||
|
|
|
@ -32,51 +32,51 @@ namespace
|
|||
// ### There must be an easier way to do this
|
||||
class ProgressBarAnimator : public QskAnimator
|
||||
{
|
||||
public:
|
||||
ProgressBarAnimator( PieChartPainted* pieChart, CircularProgressBar* progressBar )
|
||||
: m_pieChart( pieChart )
|
||||
, m_progressBar( progressBar )
|
||||
public:
|
||||
ProgressBarAnimator( PieChartPainted* pieChart, CircularProgressBar* progressBar )
|
||||
: m_pieChart( pieChart )
|
||||
, m_progressBar( progressBar )
|
||||
{
|
||||
QQuickWindow* w = static_cast< QQuickWindow* >( qGuiApp->allWindows().at( 0 ) );
|
||||
setWindow( w );
|
||||
setDuration( 500 );
|
||||
setEasingCurve( QEasingCurve::Linear );
|
||||
setAutoRepeat( false );
|
||||
}
|
||||
|
||||
void setup() override
|
||||
{
|
||||
m_backgroundColor = m_pieChart->color( PieChartPainted::Panel );
|
||||
m_ringGradient = m_progressBar->ringGradient();
|
||||
}
|
||||
|
||||
void advance( qreal value ) override
|
||||
{
|
||||
const QColor c = m_backgroundColor;
|
||||
const QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c2, c, value );
|
||||
m_progressBar->setBackgroundColor( newColor );
|
||||
|
||||
QRadialGradient gradient = m_ringGradient;
|
||||
QRadialGradient newGradient = gradient;
|
||||
|
||||
for( const QGradientStop& stop : gradient.stops() )
|
||||
{
|
||||
QQuickWindow* w = static_cast<QQuickWindow*>( qGuiApp->allWindows().at( 0 ) );
|
||||
setWindow( w );
|
||||
setDuration( 500 );
|
||||
setEasingCurve( QEasingCurve::Linear );
|
||||
setAutoRepeat( false );
|
||||
QColor c = stop.second;
|
||||
QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c, c2, value );
|
||||
newGradient.setColorAt( stop.first, newColor );
|
||||
}
|
||||
|
||||
void setup() override
|
||||
{
|
||||
m_backgroundColor = m_pieChart->color( PieChartPainted::Panel );
|
||||
m_ringGradient = m_progressBar->ringGradient();
|
||||
}
|
||||
m_progressBar->setRingGradient( newGradient );
|
||||
m_progressBar->update();
|
||||
}
|
||||
|
||||
void advance( qreal value ) override
|
||||
{
|
||||
const QColor c = m_backgroundColor;
|
||||
const QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c2, c, value );
|
||||
m_progressBar->setBackgroundColor( newColor );
|
||||
|
||||
QRadialGradient gradient = m_ringGradient;
|
||||
QRadialGradient newGradient = gradient;
|
||||
|
||||
for( const QGradientStop& stop : gradient.stops() )
|
||||
{
|
||||
QColor c = stop.second;
|
||||
QColor c2 = invertedColor( c );
|
||||
const QColor newColor = QskRgb::interpolated( c, c2, value );
|
||||
newGradient.setColorAt( stop.first, newColor );
|
||||
}
|
||||
|
||||
m_progressBar->setRingGradient( newGradient );
|
||||
m_progressBar->update();
|
||||
}
|
||||
|
||||
private:
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
PieChartPainted* m_pieChart;
|
||||
CircularProgressBar* m_progressBar;
|
||||
private:
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
PieChartPainted* m_pieChart;
|
||||
CircularProgressBar* m_progressBar;
|
||||
};
|
||||
|
||||
PieChartPainted::PieChartPainted( const QColor& color, const QskGradient& gradient, int progress, int /*value*/, QQuickItem* parent )
|
||||
|
|
|
@ -17,23 +17,23 @@ class QQuickPaintedItem;
|
|||
|
||||
class PieChartPainted : public QskControl
|
||||
{
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
PieChartPainted( const QColor& color, const QskGradient& gradient, int progress, int value, QQuickItem* parent = nullptr );
|
||||
PieChartPainted( const QColor& color, const QskGradient& gradient, int progress, int value, QQuickItem* parent = nullptr );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
|
||||
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
void updateLayout() override;
|
||||
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
void updateLayout() override;
|
||||
|
||||
private:
|
||||
QColor m_color;
|
||||
QskGradient m_gradient;
|
||||
CircularProgressBar* m_progressBar;
|
||||
QskTextLabel* m_progressLabel;
|
||||
ProgressBarAnimator* m_animator;
|
||||
private:
|
||||
QColor m_color;
|
||||
QskGradient m_gradient;
|
||||
CircularProgressBar* m_progressBar;
|
||||
QskTextLabel* m_progressLabel;
|
||||
ProgressBarAnimator* m_animator;
|
||||
};
|
||||
|
||||
#endif // PIECHARTPAINTED_H
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
|
||||
PieChartSkinlet::PieChartSkinlet( QskSkin* skin ) : QskSkinlet( skin )
|
||||
PieChartSkinlet::PieChartSkinlet( QskSkin* skin )
|
||||
: QskSkinlet( skin )
|
||||
{
|
||||
setNodeRoles( { PanelRole, LabelsRole } );
|
||||
}
|
||||
|
|
|
@ -12,25 +12,25 @@ class PieChart;
|
|||
|
||||
class PieChartSkinlet : public QskSkinlet
|
||||
{
|
||||
Q_GADGET
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
{
|
||||
PanelRole,
|
||||
LabelsRole
|
||||
};
|
||||
public:
|
||||
enum NodeRole
|
||||
{
|
||||
PanelRole,
|
||||
LabelsRole
|
||||
};
|
||||
|
||||
Q_INVOKABLE PieChartSkinlet( QskSkin* skin = nullptr );
|
||||
Q_INVOKABLE PieChartSkinlet( QskSkin* skin = nullptr );
|
||||
|
||||
QRectF subControlRect( const QskSkinnable*, const QRectF&, QskAspect::Subcontrol ) const override;
|
||||
QRectF subControlRect( const QskSkinnable*, const QRectF&, QskAspect::Subcontrol ) const override;
|
||||
|
||||
protected:
|
||||
virtual QSGNode* updateSubNode( const QskSkinnable*, quint8 nodeRole, QSGNode* node ) const override;
|
||||
protected:
|
||||
virtual QSGNode* updateSubNode( const QskSkinnable*, quint8 nodeRole, QSGNode* node ) const override;
|
||||
|
||||
private:
|
||||
QSGNode* updatePanelNode( const PieChart*, QSGNode* ) const;
|
||||
QSGNode* updateLabelsNode( const PieChart*, QSGNode* ) const;
|
||||
private:
|
||||
QSGNode* updatePanelNode( const PieChart*, QSGNode* ) const;
|
||||
QSGNode* updateLabelsNode( const PieChart*, QSGNode* ) const;
|
||||
};
|
||||
|
||||
#endif // PIECHART_SKINLET_H
|
||||
|
|
|
@ -13,32 +13,33 @@ class QskGraphicLabel;
|
|||
|
||||
class RoundedIcon : public QskBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Icon )
|
||||
QSK_STATES( Bright, Small ) // to differentiate between orange and purple and small vs. big
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Icon )
|
||||
QSK_STATES( Bright, Small ) // to differentiate between orange and purple and small vs. big
|
||||
|
||||
RoundedIcon( const QString& iconName, bool isBright, bool isSmall, QQuickItem* parent = nullptr );
|
||||
RoundedIcon( const QString& iconName, bool isBright, bool isSmall,
|
||||
QQuickItem* parent = nullptr );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
return Panel;
|
||||
}
|
||||
|
||||
protected:
|
||||
void updateLayout() override;
|
||||
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
return subControl;
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_iconName;
|
||||
QskGraphicLabel* m_graphicLabel = nullptr;
|
||||
protected:
|
||||
void updateLayout() override;
|
||||
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
|
||||
private:
|
||||
QString m_iconName;
|
||||
QskGraphicLabel* m_graphicLabel = nullptr;
|
||||
};
|
||||
|
||||
#endif // ROUNDEDICON_H
|
||||
|
|
|
@ -43,7 +43,8 @@ namespace
|
|||
|
||||
}
|
||||
|
||||
Skin::Skin( const Palette& palette, QObject* parent ) : QskSkin( parent )
|
||||
Skin::Skin( const Palette& palette, QObject* parent )
|
||||
: QskSkin( parent )
|
||||
{
|
||||
declareSkinlet< Diagram, DiagramSkinlet >();
|
||||
|
||||
|
|
|
@ -11,71 +11,72 @@
|
|||
|
||||
class Skin : public QskSkin
|
||||
{
|
||||
public:
|
||||
class Palette
|
||||
public:
|
||||
class Palette
|
||||
{
|
||||
public:
|
||||
Palette( const QskGradient& menuBar, const QskGradient& mainContent,
|
||||
const QskGradient& box, const QColor& lightDisplay, const QColor& pieChart,
|
||||
const QskGradient& roundButton, const QColor& weekdayBox,
|
||||
const QColor& text, const QColor& shadow )
|
||||
: menuBar( menuBar )
|
||||
, mainContent( mainContent )
|
||||
, box( box )
|
||||
, lightDisplay( lightDisplay )
|
||||
, pieChart( pieChart )
|
||||
, roundButton( roundButton )
|
||||
, weekdayBox( weekdayBox )
|
||||
, text( text )
|
||||
, shadow( shadow )
|
||||
{
|
||||
public:
|
||||
Palette( const QskGradient& menuBar, const QskGradient& mainContent, const QskGradient& box,
|
||||
const QColor& lightDisplay, const QColor& pieChart, const QskGradient& roundButton,
|
||||
const QColor& weekdayBox, const QColor& text, const QColor& shadow )
|
||||
: menuBar( menuBar )
|
||||
, mainContent( mainContent )
|
||||
, box( box )
|
||||
, lightDisplay( lightDisplay )
|
||||
, pieChart( pieChart )
|
||||
, roundButton( roundButton )
|
||||
, weekdayBox( weekdayBox )
|
||||
, text( text )
|
||||
, shadow( shadow )
|
||||
{
|
||||
}
|
||||
QskGradient menuBar;
|
||||
QskGradient mainContent;
|
||||
QskGradient box;
|
||||
QColor lightDisplay;
|
||||
QColor pieChart;
|
||||
QskGradient roundButton;
|
||||
QColor weekdayBox;
|
||||
QColor text;
|
||||
QColor shadow;
|
||||
};
|
||||
}
|
||||
QskGradient menuBar;
|
||||
QskGradient mainContent;
|
||||
QskGradient box;
|
||||
QColor lightDisplay;
|
||||
QColor pieChart;
|
||||
QskGradient roundButton;
|
||||
QColor weekdayBox;
|
||||
QColor text;
|
||||
QColor shadow;
|
||||
};
|
||||
|
||||
Skin( const Palette& palette, QObject* parent = nullptr );
|
||||
virtual ~Skin();
|
||||
Skin( const Palette& palette, QObject* parent = nullptr );
|
||||
~Skin() override;
|
||||
|
||||
enum SkinFontRole
|
||||
{
|
||||
TitleFont = QskSkin::HugeFont + 1,
|
||||
};
|
||||
enum SkinFontRole
|
||||
{
|
||||
TitleFont = QskSkin::HugeFont + 1,
|
||||
};
|
||||
|
||||
private:
|
||||
void initHints( const Palette& palette );
|
||||
private:
|
||||
void initHints( const Palette& palette );
|
||||
};
|
||||
|
||||
class DaytimeSkin : public Skin
|
||||
{
|
||||
public:
|
||||
DaytimeSkin( QObject* parent = nullptr )
|
||||
: Skin(
|
||||
Skin::Palette( {"#6D7BFB"}, {"#fbfbfb"}, {"#ffffff"},
|
||||
"#ffffff", "#ffffff", {"#f7f7f7"},
|
||||
{"#f4f4f4"}, Qt::black, Qt::black )
|
||||
, parent )
|
||||
{
|
||||
}
|
||||
public:
|
||||
DaytimeSkin( QObject* parent = nullptr )
|
||||
: Skin(
|
||||
Skin::Palette( {"#6D7BFB"}, {"#fbfbfb"}, {"#ffffff"},
|
||||
"#ffffff", "#ffffff", {"#f7f7f7"},
|
||||
{"#f4f4f4"}, Qt::black, Qt::black )
|
||||
, parent )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class NighttimeSkin : public Skin
|
||||
{
|
||||
public:
|
||||
NighttimeSkin( QObject* parent = nullptr )
|
||||
: Skin(
|
||||
Skin::Palette( {"#2937A7"}, {"#040404"}, {"#000000"},
|
||||
"#000000", "#000000", {"#0a0a0a"},
|
||||
{"#0c0c0c"}, Qt::white, Qt::white )
|
||||
, parent )
|
||||
{
|
||||
}
|
||||
public:
|
||||
NighttimeSkin( QObject* parent = nullptr )
|
||||
: Skin(
|
||||
Skin::Palette( {"#2937A7"}, {"#040404"}, {"#000000"},
|
||||
"#000000", "#000000", {"#0a0a0a"},
|
||||
{"#0c0c0c"}, Qt::white, Qt::white )
|
||||
, parent )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SKIN_H
|
||||
|
|
|
@ -74,7 +74,8 @@ TopBarItem::TopBarItem( int index, const QString& name, const QskGradient& gradi
|
|||
|
||||
}
|
||||
|
||||
TopBar::TopBar( QQuickItem* parent ) : QskLinearBox( Qt::Horizontal, parent )
|
||||
TopBar::TopBar( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
setAutoLayoutChildren( true );
|
||||
|
|
|
@ -13,98 +13,98 @@
|
|||
|
||||
class TimeTitleLabel : public QskTextLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
|
||||
TimeTitleLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
TimeTitleLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class TimeLabel : public QskTextLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
|
||||
TimeLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
TimeLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class TopBarItem : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Item1, Item2, Item3, Item4 )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Item1, Item2, Item3, Item4 )
|
||||
|
||||
TopBarItem( int index, const QString& name, const QskGradient& gradient, int progress, int value, QQuickItem* parent );
|
||||
TopBarItem( int index, const QString& name, const QskGradient& gradient, int progress, int value, QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
return Panel;
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
return subControl;
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
};
|
||||
|
||||
class TopBar : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
TopBar( QQuickItem* parent );
|
||||
TopBar( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
return Panel;
|
||||
}
|
||||
|
||||
private:
|
||||
QList< TopBarItem* > m_entries;
|
||||
return subControl;
|
||||
}
|
||||
|
||||
private:
|
||||
QList< TopBarItem* > m_entries;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,24 +11,24 @@
|
|||
|
||||
class RoundButton : QskPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
QSK_STATES( Top )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
QSK_STATES( Top )
|
||||
|
||||
RoundButton( QskAspect::Placement placement, QQuickItem* parent );
|
||||
RoundButton( QskAspect::Placement placement, QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
};
|
||||
|
||||
class UpAndDownButton : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UpAndDownButton( QQuickItem* parent );
|
||||
public:
|
||||
UpAndDownButton( QQuickItem* parent );
|
||||
};
|
||||
|
||||
#endif // UPANDDOWNBUTTON_H
|
||||
|
|
|
@ -13,32 +13,32 @@
|
|||
|
||||
class UsageSpacer : public QskTextLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Text )
|
||||
|
||||
UsageSpacer( QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( "_____", parent )
|
||||
UsageSpacer( QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( "_____", parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class Usage : public Box
|
||||
{
|
||||
public:
|
||||
Usage( QQuickItem* parent );
|
||||
public:
|
||||
Usage( QQuickItem* parent );
|
||||
};
|
||||
|
||||
#endif // USAGE_H
|
||||
|
|
|
@ -78,7 +78,7 @@ UsageDiagram::UsageDiagram( QQuickItem* parent )
|
|||
|
||||
// These values are calculated with a boost::math::cubic_b_spline.
|
||||
// We just output the values here to get rid of the dependency:
|
||||
std::vector< std::vector<qreal> > yValues =
|
||||
std::vector< std::vector< qreal > > yValues =
|
||||
{
|
||||
{64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 63.99, 63.96, 63.85, 63.64, 63.30, 62.79, 62.09, 61.14, 59.93, 58.42, 56.59, 54.50, 52.23, 49.84, 47.42, 45.03, 42.76, 40.68, 38.85, 37.36, 36.27, 35.55, 35.19, 35.14, 35.39, 35.91, 36.65, 37.60, 38.73, 40.00, 41.39, 42.87, 44.41, 46.00, 47.60, 49.19, 50.76, 52.26, 53.68, 55.00, 56.19, 57.24, 58.15, 58.90, 59.51, 59.95, 60.23, 60.33, 60.26, 60.00, 59.56, 58.94, 58.17, 57.27, 56.24, 55.12, 53.92, 52.65, 51.34, 50.00, 48.65, 47.32, 46.03, 44.79, 43.65, 42.61, 41.70, 40.95, 40.37, 40.00, 39.85, 39.94, 40.26, 40.84, 41.67, 42.77, 44.15, 45.80, 47.75, 50.00, 52.54, 55.30, 58.19, 61.13, 64.04, 66.82, 69.40, 71.67, 73.57},
|
||||
{36.00, 36.01, 36.11, 36.37, 36.88, 37.73, 38.98, 40.73, 43.07, 46.06, 49.80, 54.31, 59.38, 64.73, 70.09, 75.20, 79.77, 83.55, 86.24, 87.59, 87.33, 85.26, 81.61, 76.64, 70.67, 63.98, 56.86, 49.61, 42.52, 35.89, 30.00, 25.09, 21.14, 18.08, 15.83, 14.31, 13.45, 13.16, 13.37, 14.01, 15.00, 16.26, 17.73, 19.36, 21.07, 22.82, 24.55, 26.19, 27.68, 28.97, 30.00, 30.73, 31.25, 31.65, 32.04, 32.52, 33.21, 34.19, 35.58, 37.48, 40.00, 43.17, 46.80, 50.61, 54.33, 57.71, 60.47, 62.35, 63.07, 62.38, 60.00, 55.79, 50.12, 43.46, 36.31, 29.13, 22.43, 16.68, 12.37, 9.98, 10.00, 12.73, 17.76, 24.50, 32.36, 40.75, 49.09, 56.77, 63.21, 67.81, 70.00, 69.37, 66.28, 61.29, 54.96, 47.85, 40.51, 33.50, 27.37, 22.68},
|
||||
|
@ -89,7 +89,7 @@ UsageDiagram::UsageDiagram( QQuickItem* parent )
|
|||
{
|
||||
auto y = yValues[i];
|
||||
|
||||
QVector<QPointF> dataPoints;
|
||||
QVector< QPointF > dataPoints;
|
||||
dataPoints.reserve( number );
|
||||
|
||||
for( int x = 0; x < number; ++x )
|
||||
|
|
|
@ -18,140 +18,144 @@ class QskGridBox;
|
|||
|
||||
class WeekdayLabel : public QskTextLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Text )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Text )
|
||||
|
||||
WeekdayLabel( const QString& text, QQuickItem* parent ) : QskTextLabel( text, parent )
|
||||
WeekdayLabel( const QString& text, QQuickItem* parent )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Panel )
|
||||
{
|
||||
setPanel( true );
|
||||
return Panel;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
if( subControl == QskTextLabel::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class WeekdayBox : public QskBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
WeekdayBox( QQuickItem* parent ) : QskBox( true, parent )
|
||||
WeekdayBox( QQuickItem* parent ):
|
||||
QskBox( true, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return WeekdayBox::Panel;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return WeekdayBox::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class CaptionColorBox : public QskBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
CaptionColorBox( QQuickItem* parent ) : QskBox( true, parent )
|
||||
CaptionColorBox( QQuickItem* parent ):
|
||||
QskBox( true, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class CaptionItem : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
QSK_STATES( Water, Electricity, Gas )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
QSK_STATES( Water, Electricity, Gas )
|
||||
|
||||
CaptionItem( QskAspect::State state, QQuickItem* parent );
|
||||
CaptionItem( QskAspect::State state, QQuickItem* parent );
|
||||
};
|
||||
|
||||
class CaptionBox : public QskLinearBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
CaptionBox( QQuickItem* parent ) : QskLinearBox( Qt::Horizontal, parent )
|
||||
CaptionBox( QQuickItem* parent ):
|
||||
QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
setPanel( true );
|
||||
return Panel;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
return subControl;
|
||||
}
|
||||
};
|
||||
|
||||
class UsageDiagram : public Box
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
UsageDiagram( QQuickItem* parent );
|
||||
UsageDiagram( QQuickItem* parent );
|
||||
|
||||
void updateLayout() override;
|
||||
void updateLayout() override;
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
return Panel;
|
||||
}
|
||||
|
||||
private:
|
||||
Diagram* m_diagram;
|
||||
QskLinearBox* m_captionBox;
|
||||
QskGridBox* m_weekdays;
|
||||
return subControl;
|
||||
}
|
||||
|
||||
private:
|
||||
Diagram* m_diagram;
|
||||
QskLinearBox* m_captionBox;
|
||||
QskGridBox* m_weekdays;
|
||||
};
|
||||
|
||||
#endif // USAGEDIAGRAM_H
|
||||
|
|
|
@ -25,32 +25,33 @@ namespace
|
|||
{
|
||||
class SkinFactory : public QskSkinFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SkinFactory( QObject* parent = nullptr ) : QskSkinFactory( parent )
|
||||
public:
|
||||
SkinFactory( QObject* parent = nullptr )
|
||||
: QskSkinFactory( parent )
|
||||
{
|
||||
}
|
||||
|
||||
QStringList skinNames() const override
|
||||
{
|
||||
return { "DaytimeSkin", "NighttimeSkin" };
|
||||
}
|
||||
|
||||
QskSkin* createSkin( const QString& skinName ) override
|
||||
{
|
||||
if( skinName == "DaytimeSkin" )
|
||||
{
|
||||
return new DaytimeSkin;
|
||||
}
|
||||
|
||||
QStringList skinNames() const override
|
||||
if( skinName == "NighttimeSkin" )
|
||||
{
|
||||
return { "DaytimeSkin", "NighttimeSkin" };
|
||||
return new NighttimeSkin;
|
||||
}
|
||||
|
||||
QskSkin* createSkin( const QString& skinName ) override
|
||||
{
|
||||
if( skinName == "DaytimeSkin" )
|
||||
{
|
||||
return new DaytimeSkin;
|
||||
}
|
||||
|
||||
if( skinName == "NighttimeSkin" )
|
||||
{
|
||||
return new NighttimeSkin;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -79,7 +80,7 @@ int main( int argc, char* argv[] )
|
|||
|
||||
// With CTRL-B you can rotate a couple of visual debug modes
|
||||
SkinnyShortcut::enable( SkinnyShortcut::RotateSkin | SkinnyShortcut::DebugBackground |
|
||||
SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit );
|
||||
SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit );
|
||||
|
||||
MainWindow window;
|
||||
window.show();
|
||||
|
|
|
@ -14,8 +14,9 @@ DiagramDataNode::DiagramDataNode()
|
|||
setMaterial( &m_material );
|
||||
}
|
||||
|
||||
void DiagramDataNode::update( const QRectF& rect, Type type, const QColor& color, const QVector<QPointF>& dataPoints,
|
||||
const qreal yMax, Qsk::Position position, int lineWidth )
|
||||
void DiagramDataNode::update( const QRectF& rect, Type type,
|
||||
const QColor& color, const QVector< QPointF >& dataPoints,
|
||||
const qreal yMax, Qsk::Position position, int lineWidth )
|
||||
{
|
||||
Q_UNUSED( rect );
|
||||
|
||||
|
@ -65,7 +66,7 @@ void DiagramDataNode::update( const QRectF& rect, Type type, const QColor& color
|
|||
|
||||
if( m_dataPoints.count() > 0 )
|
||||
{
|
||||
xMin = m_dataPoints.at( 0 ).x();
|
||||
xMin = m_dataPoints.at( 0 ).x();
|
||||
xMax = m_dataPoints.at( m_dataPoints.count() - 1 ).x();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -14,28 +14,28 @@
|
|||
|
||||
class DiagramDataNode : public QSGGeometryNode
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
Line,
|
||||
Area,
|
||||
};
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
Line,
|
||||
Area,
|
||||
};
|
||||
|
||||
DiagramDataNode();
|
||||
DiagramDataNode();
|
||||
|
||||
void update( const QRectF& rect, Type type, const QColor& color, const QVector<QPointF>& dataPoints, const qreal yMax, Qsk::Position position, int lineWidth );
|
||||
void update( const QRectF& rect, Type type, const QColor& color, const QVector< QPointF >& dataPoints, const qreal yMax, Qsk::Position position, int lineWidth );
|
||||
|
||||
private:
|
||||
QSGFlatColorMaterial m_material;
|
||||
QSGGeometry m_geometry;
|
||||
private:
|
||||
QSGFlatColorMaterial m_material;
|
||||
QSGGeometry m_geometry;
|
||||
|
||||
QRectF m_rect;
|
||||
Type m_type;
|
||||
QColor m_color;
|
||||
QVector<QPointF> m_dataPoints;
|
||||
qreal m_yMax;
|
||||
Qsk::Position m_position;
|
||||
int m_lineWidth;
|
||||
QRectF m_rect;
|
||||
Type m_type;
|
||||
QColor m_color;
|
||||
QVector< QPointF > m_dataPoints;
|
||||
qreal m_yMax;
|
||||
Qsk::Position m_position;
|
||||
int m_lineWidth;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,8 @@ DiagramSegmentsNode::DiagramSegmentsNode()
|
|||
setMaterial( &m_material );
|
||||
}
|
||||
|
||||
void DiagramSegmentsNode::update( const QRectF& rect, const QColor& color, const QVector<QVector<QPointF> >& dataPoints, int xGridLines )
|
||||
void DiagramSegmentsNode::update( const QRectF& rect, const QColor& color,
|
||||
const QVector< QVector< QPointF > >& dataPoints, int xGridLines )
|
||||
{
|
||||
Q_UNUSED( rect );
|
||||
|
||||
|
|
|
@ -12,19 +12,19 @@
|
|||
|
||||
class DiagramSegmentsNode : public QSGGeometryNode
|
||||
{
|
||||
public:
|
||||
DiagramSegmentsNode();
|
||||
public:
|
||||
DiagramSegmentsNode();
|
||||
|
||||
void update( const QRectF& rect, const QColor& color, const QVector< QVector<QPointF> >& dataPoints, int xGridLines );
|
||||
void update( const QRectF& rect, const QColor& color, const QVector< QVector< QPointF > >& dataPoints, int xGridLines );
|
||||
|
||||
private:
|
||||
QSGFlatColorMaterial m_material;
|
||||
QSGGeometry m_geometry;
|
||||
private:
|
||||
QSGFlatColorMaterial m_material;
|
||||
QSGGeometry m_geometry;
|
||||
|
||||
QRectF m_rect;
|
||||
QColor m_color;
|
||||
QVector< QVector<QPointF> > m_dataPoints;
|
||||
int m_xGridLines;
|
||||
QRectF m_rect;
|
||||
QColor m_color;
|
||||
QVector< QVector< QPointF > > m_dataPoints;
|
||||
int m_xGridLines;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -191,7 +191,7 @@ class MySkin1 : public MySkin
|
|||
|
||||
MySkinEditor editor;
|
||||
editor.setTable( &hintTable() );
|
||||
editor.setAnimator( 200, QEasingCurve::Linear );
|
||||
editor.setAnimator( 200, QEasingCurve::Linear );
|
||||
|
||||
editor.setGradient( QskAspect::Control, Qt::gray );
|
||||
|
||||
|
|
|
@ -374,13 +374,13 @@ inline void QskAspect::setPrimitive( Type type, QskAspect::Primitive primitive )
|
|||
inline constexpr QskAspect::Primitive QskAspect::flagPrimitive() const noexcept
|
||||
{
|
||||
return ( m_bits.type == Flag )
|
||||
? static_cast< Primitive >( m_bits.primitive ) : NoPrimitive;
|
||||
? static_cast< Primitive >( m_bits.primitive ) : NoPrimitive;
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::Primitive QskAspect::colorPrimitive() const noexcept
|
||||
{
|
||||
return ( m_bits.type == Color )
|
||||
? static_cast< Primitive >( m_bits.primitive ) : NoPrimitive;
|
||||
? static_cast< Primitive >( m_bits.primitive ) : NoPrimitive;
|
||||
}
|
||||
|
||||
inline constexpr QskAspect::Primitive QskAspect::metricPrimitive() const noexcept
|
||||
|
|
|
@ -48,7 +48,7 @@ class QSK_EXPORT QskEvent : public QEvent
|
|||
QskEvent( QskEvent::Type type );
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||
virtual QskEvent *clone() const;
|
||||
virtual QskEvent* clone() const;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
|
|
@ -127,7 +127,7 @@ QRectF QskPageIndicatorSkinlet::bulletRect(
|
|||
bulletRect.moveTo( x, r.top() + adjust );
|
||||
else
|
||||
bulletRect.moveTo( r.left() + adjust, x );
|
||||
|
||||
|
||||
return bulletRect;
|
||||
}
|
||||
|
||||
|
|
|
@ -694,7 +694,7 @@ bool qskGrabMouse( QQuickItem* item )
|
|||
stored depending on these attributes the following
|
||||
mouse event callbacks will look for the grabber at a
|
||||
a different place as it was stored.
|
||||
*/
|
||||
*/
|
||||
|
||||
if ( const auto event = qskPointerPressEvent( wd ) )
|
||||
{
|
||||
|
|
|
@ -737,7 +737,7 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
|
|||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 6, 1, 0 )
|
||||
auto wd = QQuickWindowPrivate::get( oldWindow )->deliveryAgentPrivate();
|
||||
#else
|
||||
#else
|
||||
auto wd = QQuickWindowPrivate::get( oldWindow );
|
||||
#endif
|
||||
if ( auto scope = qskNearestFocusScope( this ) )
|
||||
|
|
|
@ -131,7 +131,7 @@ class QSK_EXPORT QskQuickItem : public QQuickItem
|
|||
virtual void geometryChangeEvent( QskGeometryChangeEvent* );
|
||||
virtual void windowChangeEvent( QskWindowChangeEvent* );
|
||||
|
||||
void mouseUngrabEvent() override;
|
||||
void mouseUngrabEvent() override;
|
||||
void touchUngrabEvent() override;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||
|
|
|
@ -82,7 +82,7 @@ void QskSkinHintTableEditor::setFlag( QskAspect aspect, int flag )
|
|||
|
||||
int QskSkinHintTableEditor::flag( QskAspect aspect ) const
|
||||
{
|
||||
return flagHint<int>( aspect );
|
||||
return flagHint< int >( aspect );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setMetric( QskAspect aspect, qreal metric )
|
||||
|
@ -92,7 +92,7 @@ void QskSkinHintTableEditor::setMetric( QskAspect aspect, qreal metric )
|
|||
|
||||
qreal QskSkinHintTableEditor::metric( QskAspect aspect ) const
|
||||
{
|
||||
return metricHint<qreal>( aspect );
|
||||
return metricHint< qreal >( aspect );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setColor( QskAspect aspect, Qt::GlobalColor color )
|
||||
|
@ -112,7 +112,7 @@ void QskSkinHintTableEditor::setColor( QskAspect aspect, const QColor& color )
|
|||
|
||||
QColor QskSkinHintTableEditor::color( QskAspect aspect ) const
|
||||
{
|
||||
return colorHint<QColor>( aspect );
|
||||
return colorHint< QColor >( aspect );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setHGradient(
|
||||
|
@ -134,7 +134,7 @@ void QskSkinHintTableEditor::setGradient( QskAspect aspect, const QskGradient& g
|
|||
|
||||
QskGradient QskSkinHintTableEditor::gradient( QskAspect aspect ) const
|
||||
{
|
||||
return colorHint<QskGradient>( aspect );
|
||||
return colorHint< QskGradient >( aspect );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::setStrutSize( QskAspect aspect, const QSizeF& size )
|
||||
|
@ -231,7 +231,7 @@ Qt::Alignment QskSkinHintTableEditor::alignment( QskAspect aspect ) const
|
|||
|
||||
void QskSkinHintTableEditor::setFontRole( QskAspect aspect, int fontRole )
|
||||
{
|
||||
setFlagHint( aspectFontRole( aspect ), fontRole );
|
||||
setFlagHint( aspectFontRole( aspect ), fontRole );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::removeFontRole( QskAspect aspect )
|
||||
|
@ -246,7 +246,7 @@ int QskSkinHintTableEditor::fontRole( QskAspect aspect ) const
|
|||
|
||||
void QskSkinHintTableEditor::setGraphicRole( QskAspect aspect, int graphicRole )
|
||||
{
|
||||
setFlagHint( aspectGraphicRole( aspect ), graphicRole );
|
||||
setFlagHint( aspectGraphicRole( aspect ), graphicRole );
|
||||
}
|
||||
|
||||
void QskSkinHintTableEditor::removeGraphicRole( QskAspect aspect )
|
||||
|
|
|
@ -118,7 +118,7 @@ class QSK_EXPORT QskSkinHintTableEditor
|
|||
void setGraphicRole( QskAspect, int );
|
||||
void removeGraphicRole( QskAspect );
|
||||
int graphicRole( QskAspect ) const;
|
||||
|
||||
|
||||
void setBoxShape( QskAspect, qreal radius, Qt::SizeMode = Qt::AbsoluteSize );
|
||||
void setBoxShape( QskAspect, qreal topLeft, qreal topRight,
|
||||
qreal bottomLeft, qreal bottomRight, Qt::SizeMode = Qt::AbsoluteSize );
|
||||
|
|
|
@ -56,7 +56,7 @@ static inline QVariant qskTypedNullValue( const QVariant& value )
|
|||
}
|
||||
|
||||
static inline bool qskSetFlag( QskSkinnable* skinnable,
|
||||
const QskAspect aspect, int flag )
|
||||
const QskAspect aspect, int flag )
|
||||
{
|
||||
return skinnable->setSkinHint( aspect | QskAspect::Flag, QVariant( flag ) );
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ static inline int qskFlag( const QskSkinnable* skinnable,
|
|||
}
|
||||
|
||||
static inline bool qskSetMetric( QskSkinnable* skinnable,
|
||||
const QskAspect aspect, const QVariant& metric )
|
||||
const QskAspect aspect, const QVariant& metric )
|
||||
{
|
||||
return skinnable->setSkinHint( aspect | QskAspect::Metric, metric );
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ QskColorFilter QskSkinnable::effectiveGraphicFilter( QskAspect aspect ) const
|
|||
if ( auto control = owningControl() )
|
||||
{
|
||||
v = QskSkinTransition::animatedGraphicFilter(
|
||||
control->window(), hint.toInt() );
|
||||
control->window(), hint.toInt() );
|
||||
|
||||
if ( v.canConvert< QskColorFilter >() )
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ class QskStatusIndicator::PrivateData
|
|||
|
||||
int currentStatus;
|
||||
QMap< int, StatusData > map;
|
||||
mutable QList<int> statusList;
|
||||
mutable QList< int > statusList;
|
||||
};
|
||||
|
||||
QskStatusIndicator::QskStatusIndicator( QQuickItem* parent )
|
||||
|
@ -211,7 +211,7 @@ void QskStatusIndicator::setStatus( int status )
|
|||
update();
|
||||
}
|
||||
|
||||
QList<int> QskStatusIndicator::statusList() const
|
||||
QList< int > QskStatusIndicator::statusList() const
|
||||
{
|
||||
/*
|
||||
We should be have a QMap< int, QskGraphic >, so that
|
||||
|
|
|
@ -22,7 +22,7 @@ QskSwitchButton::QskSwitchButton( QQuickItem* parent )
|
|||
QskSwitchButton::QskSwitchButton( Qt::Orientation orientation, QQuickItem* parent )
|
||||
: QskAbstractButton( parent )
|
||||
, m_data( new PrivateData( orientation ) )
|
||||
{
|
||||
{
|
||||
initSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ void QskSwitchButton::setInverted( bool on )
|
|||
}
|
||||
|
||||
QskAspect::Placement QskSwitchButton::effectivePlacement() const
|
||||
{
|
||||
{
|
||||
/*
|
||||
So you can define different hints depending on the orientation,
|
||||
but what about the layoutDirection ???
|
||||
|
|
|
@ -110,7 +110,7 @@ QRectF QskSwitchButtonSkinlet::grooveRect(
|
|||
|
||||
size = size.expandedTo( QSize( 0.0, 0.0 ) );
|
||||
|
||||
QRectF r;
|
||||
QRectF r;
|
||||
r.setSize( size );
|
||||
r.moveCenter( contentsRect.center() );
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ int QskTabBar::insertTab( int index, QskTabButton* button )
|
|||
m_data->connectButton( button, this, true );
|
||||
|
||||
connect( button, &QskAbstractButton::clicked,
|
||||
this, &QskTabBar::handleButtonClick );
|
||||
this, &QskTabBar::handleButtonClick );
|
||||
|
||||
Q_EMIT countChanged( count() );
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
QSK_SUBCONTROL( QskTabButton, Panel )
|
||||
QSK_SUBCONTROL( QskTabButton, Text )
|
||||
|
||||
static inline QskTabBar* qskFindTabBar( QskTabButton* button )
|
||||
static inline QskTabBar* qskFindTabBar( const QskTabButton* button )
|
||||
{
|
||||
return qskFindAncestorOf< QskTabBar* >( button->parentItem() );
|
||||
}
|
||||
|
|
|
@ -331,20 +331,20 @@ QskTextInput::~QskTextInput()
|
|||
{
|
||||
}
|
||||
|
||||
void QskTextInput::setPanel( bool on )
|
||||
{
|
||||
void QskTextInput::setPanel( bool on )
|
||||
{
|
||||
if ( on != m_data->hasPanel )
|
||||
{
|
||||
m_data->hasPanel = on;
|
||||
|
||||
|
||||
resetImplicitSize();
|
||||
polish();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool QskTextInput::hasPanel() const
|
||||
{
|
||||
{
|
||||
return m_data->hasPanel;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ QSGNode* QskTextInputSkinlet::updateSubNode(
|
|||
const auto input = static_cast< const QskTextInput* >( skinnable );
|
||||
if ( !input->hasPanel() )
|
||||
return nullptr;
|
||||
|
||||
|
||||
return updateBoxNode( skinnable, node, QskTextInput::Panel );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,7 @@ namespace
|
|||
class TextInputProxy final : public QskTextInput
|
||||
{
|
||||
public:
|
||||
TextInputProxy( QskInputPanelBox* panelBox,
|
||||
QQuickItem* parentItem = nullptr )
|
||||
TextInputProxy( QskInputPanelBox* panelBox, QQuickItem* parentItem = nullptr )
|
||||
: QskTextInput( parentItem )
|
||||
, m_panelBox( panelBox )
|
||||
{
|
||||
|
|
|
@ -496,8 +496,8 @@ void QskGridBox::dump() const
|
|||
const auto constraint = sizeConstraint();
|
||||
|
||||
debug << "QskGridBox"
|
||||
<< "[" << engine.columnCount() << "," << engine.rowCount() << "] w:"
|
||||
<< constraint.width() << " h:" << constraint.height() << '\n';
|
||||
<< "[" << engine.columnCount() << "," << engine.rowCount() << "] w:"
|
||||
<< constraint.width() << " h:" << constraint.height() << '\n';
|
||||
|
||||
for ( int i = 0; i < engine.count(); i++ )
|
||||
{
|
||||
|
@ -521,7 +521,7 @@ void QskGridBox::dump() const
|
|||
const auto constraint = qskSizeConstraint( item, Qt::PreferredSize );
|
||||
|
||||
debug << item->metaObject()->className()
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height();
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -541,7 +541,7 @@ void QskLinearBox::dump() const
|
|||
const auto constraint = sizeConstraint();
|
||||
|
||||
debug << "QskLinearBox" << engine.orientation()
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height() << '\n';
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height() << '\n';
|
||||
|
||||
for ( int i = 0; i < engine.count(); i++ )
|
||||
{
|
||||
|
@ -551,7 +551,7 @@ void QskLinearBox::dump() const
|
|||
{
|
||||
const auto constraint = qskSizeConstraint( item, Qt::PreferredSize );
|
||||
debug << item->metaObject()->className()
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height();
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -427,7 +427,7 @@ void QskStackBox::dump() const
|
|||
const auto constraint = sizeConstraint();
|
||||
|
||||
debug << "QskStackBox"
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height() << '\n';
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height() << '\n';
|
||||
|
||||
for ( int i = 0; i < m_data->items.count(); i++ )
|
||||
{
|
||||
|
@ -437,7 +437,7 @@ void QskStackBox::dump() const
|
|||
|
||||
const auto constraint = qskSizeConstraint( item, Qt::PreferredSize );
|
||||
debug << item->metaObject()->className()
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height();
|
||||
<< " w:" << constraint.width() << " h:" << constraint.height();
|
||||
|
||||
if ( i == m_data->currentIndex )
|
||||
debug << " [X]";
|
||||
|
|
|
@ -42,7 +42,7 @@ class QSK_EXPORT QskScaleRenderer
|
|||
const QRectF& tickmarksRect, const QRectF& labelsRect, QSGNode* );
|
||||
|
||||
virtual QVariant labelAt( qreal pos ) const;
|
||||
QSizeF boundingLabelSize() const;
|
||||
QSizeF boundingLabelSize() const;
|
||||
|
||||
virtual QSGNode* updateTicksNode(
|
||||
const QskSkinnable*, const QRectF&, QSGNode* ) const;
|
||||
|
|
|
@ -251,7 +251,7 @@ void SkinnyShortcut::debugStatistics()
|
|||
countItems( w->contentItem(), counter );
|
||||
|
||||
qDebug() << w << "\n\titems:" << counter[0] << "visible" << counter[1]
|
||||
<< "\n\tnodes:" << counter[2] << "visible" << counter[3];
|
||||
<< "\n\tnodes:" << counter[2] << "visible" << counter[3];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue