parent
d8d83ca1eb
commit
68ee161d98
|
@ -1,7 +0,0 @@
|
||||||
#include "QskShadowedRectangle.h"
|
|
||||||
|
|
||||||
QSK_SUBCONTROL( QskShadowedRectangle, Shadow )
|
|
||||||
|
|
||||||
QskShadowedRectangle::QskShadowedRectangle( QQuickItem* parent ) : QskControl( parent )
|
|
||||||
{
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
#ifndef QSKSHADOWEDRECTANGLE_H
|
|
||||||
#define QSKSHADOWEDRECTANGLE_H
|
|
||||||
|
|
||||||
#include "src/shadowedrectangle.h"
|
|
||||||
|
|
||||||
#include <QskControl.h>
|
|
||||||
|
|
||||||
class QskShadowedRectangle : public QskControl
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
QSK_SUBCONTROLS( Shadow )
|
|
||||||
|
|
||||||
QskShadowedRectangle( QQuickItem* parent = nullptr );
|
|
||||||
// ~QskShadowedRectangle() override;
|
|
||||||
|
|
||||||
// BorderGroup* border() const;
|
|
||||||
// ShadowGroup* shadow() const;
|
|
||||||
// CornersGroup* corners() const;
|
|
||||||
|
|
||||||
// qreal radius() const;
|
|
||||||
// void setRadius( qreal newRadius );
|
|
||||||
// Q_SIGNAL void radiusChanged();
|
|
||||||
|
|
||||||
// QColor color() const;
|
|
||||||
// void setColor( const QColor& newColor );
|
|
||||||
// Q_SIGNAL void colorChanged();
|
|
||||||
|
|
||||||
// void componentComplete() override;
|
|
||||||
|
|
||||||
// bool isSoftwareRendering() const;
|
|
||||||
|
|
||||||
// Q_SIGNALS:
|
|
||||||
// void softwareRenderingChanged();
|
|
||||||
|
|
||||||
// protected:
|
|
||||||
// PaintedRectangleItem* softwareItem() const;
|
|
||||||
// void itemChange( QQuickItem::ItemChange change, const QQuickItem::ItemChangeData& value ) override;
|
|
||||||
|
|
||||||
// private:
|
|
||||||
// void checkSoftwareItem();
|
|
||||||
// const std::unique_ptr<BorderGroup> m_border;
|
|
||||||
// const std::unique_ptr<ShadowGroup> m_shadow;
|
|
||||||
// const std::unique_ptr<CornersGroup> m_corners;
|
|
||||||
// qreal m_radius = 0.0;
|
|
||||||
// QColor m_color = Qt::white;
|
|
||||||
// PaintedRectangleItem* m_softwareItem = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // QSKSHADOWEDRECTANGLE_H
|
|
|
@ -1,64 +0,0 @@
|
||||||
#include "QskShadowedRectangleSkinlet.h"
|
|
||||||
#include "QskShadowedRectangle.h"
|
|
||||||
|
|
||||||
#include "src/scenegraph/shadowedrectanglenode.h"
|
|
||||||
|
|
||||||
QskShadowedRectangleSkinlet::QskShadowedRectangleSkinlet( QskSkin* skin ) : QskSkinlet( skin )
|
|
||||||
, m_border( new BorderGroup )
|
|
||||||
, m_shadow( new ShadowGroup )
|
|
||||||
, m_corners( new CornersGroup )
|
|
||||||
{
|
|
||||||
setNodeRoles( { ShadowRole } );
|
|
||||||
}
|
|
||||||
|
|
||||||
QRectF QskShadowedRectangleSkinlet::subControlRect( const QskSkinnable*, const QRectF& contentsRect, QskAspect::Subcontrol ) const
|
|
||||||
{
|
|
||||||
return contentsRect;
|
|
||||||
}
|
|
||||||
|
|
||||||
QSGNode* QskShadowedRectangleSkinlet::updateSubNode( const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
|
||||||
{
|
|
||||||
const auto rectangle = static_cast< const QskShadowedRectangle* >( skinnable );
|
|
||||||
|
|
||||||
switch( nodeRole )
|
|
||||||
{
|
|
||||||
case ShadowRole:
|
|
||||||
return updateShadowNode( rectangle, node );
|
|
||||||
|
|
||||||
default:
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QSGNode* QskShadowedRectangleSkinlet::updateShadowNode( const QskShadowedRectangle* /*rectangle*/, QSGNode* node ) const
|
|
||||||
{
|
|
||||||
auto shadowNode = static_cast<ShadowedRectangleNode*>( node );
|
|
||||||
|
|
||||||
if( !shadowNode )
|
|
||||||
{
|
|
||||||
shadowNode = new ShadowedRectangleNode{};
|
|
||||||
}
|
|
||||||
|
|
||||||
// shadowNode->setBorderEnabled( m_border->isEnabled() );
|
|
||||||
// shadowNode->setRect( rectangle->contentsRect() );
|
|
||||||
// shadowNode->setSize( m_shadow->size() );
|
|
||||||
// shadowNode->setRadius( m_corners->toVector4D( m_radius ) );
|
|
||||||
// shadowNode->setOffset( QVector2D{float( m_shadow->xOffset() ), float( m_shadow->yOffset() )} );
|
|
||||||
// shadowNode->setColor( m_color );
|
|
||||||
// shadowNode->setShadowColor( m_shadow->color() );
|
|
||||||
// shadowNode->setBorderWidth( m_border->width() );
|
|
||||||
// shadowNode->setBorderColor( m_border->color() );
|
|
||||||
// shadowNode->updateGeometry();
|
|
||||||
|
|
||||||
shadowNode->setBorderEnabled( true );
|
|
||||||
shadowNode->setRect( {0, 0, 100, 50} );
|
|
||||||
shadowNode->setSize( 50 );
|
|
||||||
shadowNode->setRadius( m_corners->toVector4D( 5 ) );
|
|
||||||
shadowNode->setOffset( QVector2D{float( 1 ), float( 1 )} );
|
|
||||||
shadowNode->setColor( Qt::green );
|
|
||||||
shadowNode->setShadowColor( Qt::magenta );
|
|
||||||
shadowNode->setBorderWidth( 2 );
|
|
||||||
shadowNode->setBorderColor( Qt::red );
|
|
||||||
shadowNode->updateGeometry();
|
|
||||||
return shadowNode;
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
#ifndef QSKSHADOWEDRECTANGLESKINLET_H
|
|
||||||
#define QSKSHADOWEDRECTANGLESKINLET_H
|
|
||||||
|
|
||||||
#include "src/shadowedrectangle.h"
|
|
||||||
|
|
||||||
#include <QskSkinlet.h>
|
|
||||||
|
|
||||||
class QskShadowedRectangle;
|
|
||||||
|
|
||||||
class QskShadowedRectangleSkinlet : public QskSkinlet
|
|
||||||
{
|
|
||||||
Q_GADGET
|
|
||||||
|
|
||||||
public:
|
|
||||||
enum NodeRole
|
|
||||||
{
|
|
||||||
ShadowRole,
|
|
||||||
};
|
|
||||||
|
|
||||||
Q_INVOKABLE QskShadowedRectangleSkinlet( QskSkin* skin = nullptr );
|
|
||||||
|
|
||||||
QRectF subControlRect( const QskSkinnable*, const QRectF&, QskAspect::Subcontrol ) const override;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual QSGNode* updateSubNode( const QskSkinnable*, quint8 nodeRole, QSGNode* node ) const override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QSGNode* updateShadowNode( const QskShadowedRectangle*, QSGNode* ) const;
|
|
||||||
|
|
||||||
// ### move this to the value class:
|
|
||||||
const std::unique_ptr<BorderGroup> m_border;
|
|
||||||
const std::unique_ptr<ShadowGroup> m_shadow;
|
|
||||||
const std::unique_ptr<CornersGroup> m_corners;
|
|
||||||
qreal m_radius = 0.0;
|
|
||||||
QColor m_color = Qt::white;
|
|
||||||
PaintedRectangleItem* m_softwareItem = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // QSKSHADOWEDRECTANGLESKINLET_H
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include "LightIntensity.h"
|
#include "LightIntensity.h"
|
||||||
#include "MainContent.h"
|
#include "MainContent.h"
|
||||||
#include "MenuBar.h"
|
#include "MenuBar.h"
|
||||||
#include "QskShadowedRectangle.h"
|
|
||||||
#include "QskShadowedRectangleSkinlet.h"
|
|
||||||
#include "PieChartPainted.h"
|
#include "PieChartPainted.h"
|
||||||
#include "TopBar.h"
|
#include "TopBar.h"
|
||||||
#include "UpAndDownButton.h"
|
#include "UpAndDownButton.h"
|
||||||
|
@ -39,7 +37,6 @@ namespace
|
||||||
|
|
||||||
Skin::Skin( const Palette& palette, QObject* parent ) : QskSkin( parent )
|
Skin::Skin( const Palette& palette, QObject* parent ) : QskSkin( parent )
|
||||||
{
|
{
|
||||||
declareSkinlet< QskShadowedRectangle, QskShadowedRectangleSkinlet >();
|
|
||||||
initHints( palette );
|
initHints( palette );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,6 @@ SOURCES += \
|
||||||
PieChart.cpp \
|
PieChart.cpp \
|
||||||
PieChartPainted.cpp \
|
PieChartPainted.cpp \
|
||||||
PieChartSkinlet.cpp \
|
PieChartSkinlet.cpp \
|
||||||
QskShadowedRectangle.cpp \
|
|
||||||
QskShadowedRectangleSkinlet.cpp \
|
|
||||||
RoundedIcon.cpp \
|
RoundedIcon.cpp \
|
||||||
Skin.cpp \
|
Skin.cpp \
|
||||||
TopBar.cpp \
|
TopBar.cpp \
|
||||||
|
@ -35,8 +33,6 @@ HEADERS += \
|
||||||
PieChart.h \
|
PieChart.h \
|
||||||
PieChartPainted.h \
|
PieChartPainted.h \
|
||||||
PieChartSkinlet.h \
|
PieChartSkinlet.h \
|
||||||
QskShadowedRectangle.h \
|
|
||||||
QskShadowedRectangleSkinlet.h \
|
|
||||||
RoundedIcon.h \
|
RoundedIcon.h \
|
||||||
Skin.h \
|
Skin.h \
|
||||||
TopBar.h \
|
TopBar.h \
|
||||||
|
|
Loading…
Reference in New Issue