beautified

This commit is contained in:
Uwe Rathmann 2021-12-23 19:05:59 +01:00
parent 8010d70e4a
commit ca2cdf7663
19 changed files with 56 additions and 56 deletions

View File

@ -84,9 +84,9 @@ inline bool QskArcMetrics::operator==(
const QskArcMetrics& other ) const noexcept const QskArcMetrics& other ) const noexcept
{ {
return ( qskFuzzyCompare( m_width, other.m_width ) return ( qskFuzzyCompare( m_width, other.m_width )
&& qskFuzzyCompare( m_startAngle, other.m_startAngle ) && qskFuzzyCompare( m_startAngle, other.m_startAngle )
&& qskFuzzyCompare( m_spanAngle, other.m_spanAngle ) && qskFuzzyCompare( m_spanAngle, other.m_spanAngle )
&& m_sizeMode == other.m_sizeMode ); && m_sizeMode == other.m_sizeMode );
} }
inline bool QskArcMetrics::operator!=( inline bool QskArcMetrics::operator!=(

View File

@ -145,7 +145,7 @@ static inline QskGradientStops qskExtractedStops(
} }
const auto color = const auto color =
QskGradientStop::interpolated( stops[i-1], stops[i], from ); QskGradientStop::interpolated( stops[i - 1], stops[i], from );
extracted += QskGradientStop( 0.0, color ); extracted += QskGradientStop( 0.0, color );
} }
@ -161,7 +161,7 @@ static inline QskGradientStops qskExtractedStops(
extracted += QskGradientStop( pos, s.color() ); extracted += QskGradientStop( pos, s.color() );
} }
const auto color = QskGradientStop::interpolated( stops[i-1], stops[i], to ); const auto color = QskGradientStop::interpolated( stops[i - 1], stops[i], to );
extracted += QskGradientStop( 1.0, color ); extracted += QskGradientStop( 1.0, color );
return extracted; return extracted;
@ -370,7 +370,7 @@ bool QskGradient::hasStopAt( qreal value ) const
uint QskGradient::hash( uint seed ) const uint QskGradient::hash( uint seed ) const
{ {
if ( m_stops.isEmpty() ) if ( m_stops.isEmpty() )
return seed; return seed;
uint hash = qHashBits( &m_orientation, sizeof( m_orientation ), seed ); uint hash = qHashBits( &m_orientation, sizeof( m_orientation ), seed );

View File

@ -10,10 +10,10 @@
#define RGB( color, weight ) color ## weight #define RGB( color, weight ) color ## weight
#define RGBTABLE( c ) \ #define RGBTABLE( c ) \
{ \ { \
RGB( c, 50 ), RGB( c, 100 ), RGB( c, 200 ), RGB( c, 300 ), RGB( c, 400 ), \ RGB( c, 50 ), RGB( c, 100 ), RGB( c, 200 ), RGB( c, 300 ), RGB( c, 400 ), \
RGB( c, 500 ), RGB( c, 600 ), RGB( c, 700 ), RGB( c, 800 ), RGB( c, 900 ) \ RGB( c, 500 ), RGB( c, 600 ), RGB( c, 700 ), RGB( c, 800 ), RGB( c, 900 ) \
} }
namespace namespace
{ {
@ -77,7 +77,7 @@ static QskGradientStops qskColorStops(
for ( int i = 1; i < count; i++ ) for ( int i = 1; i < count; i++ )
{ {
const qreal pos = i * step; const qreal pos = i * step;
stops += QskGradientStop( pos, rgb[i-1] ); stops += QskGradientStop( pos, rgb[i - 1] );
stops += QskGradientStop( pos, rgb[i] ); stops += QskGradientStop( pos, rgb[i] );
} }
} }

View File

@ -17,15 +17,15 @@ QSK_SYSTEM_STATE( QskMenu, Selected, QskAspect::FirstSystemState << 2 )
class QskMenu::PrivateData class QskMenu::PrivateData
{ {
public: public:
QVector< Entry > entries; QVector< Entry > entries;
QVector< QskGraphic > icons; QVector< QskGraphic > icons;
QskTextOptions textOptions; QskTextOptions textOptions;
QPointF origin; QPointF origin;
int currentIndex = 0; int currentIndex = 0;
bool isPressed = false; bool isPressed = false;
}; };
QskMenu::QskMenu( QQuickItem* parent ) QskMenu::QskMenu( QQuickItem* parent )

View File

@ -19,12 +19,12 @@ class QSK_EXPORT QskMenu : public QskPopup
Q_OBJECT Q_OBJECT
Q_PROPERTY( QPointF origin READ origin Q_PROPERTY( QPointF origin READ origin
WRITE setOrigin NOTIFY originChanged ) WRITE setOrigin NOTIFY originChanged )
Q_PROPERTY( int count READ count ) Q_PROPERTY( int count READ count )
Q_PROPERTY( int currentIndex READ currentIndex Q_PROPERTY( int currentIndex READ currentIndex
WRITE setCurrentIndex NOTIFY currentIndexChanged ) WRITE setCurrentIndex NOTIFY currentIndexChanged )
using Inherited = QskPopup; using Inherited = QskPopup;

View File

@ -98,7 +98,7 @@ static QSGNode* qskUpdateTextNode( const QskMenu* menu,
QskMenu::Text, Qt::AlignVCenter | Qt::AlignLeft ); QskMenu::Text, Qt::AlignVCenter | Qt::AlignLeft );
return QskSkinlet::updateTextNode( menu, node, rect, alignment, return QskSkinlet::updateTextNode( menu, node, rect, alignment,
text, menu->textOptions(), QskMenu::Text ); text, menu->textOptions(), QskMenu::Text );
} }
static QSGNode* qskUpdateBackgroundNode( const QskMenu*, QSGNode* ) static QSGNode* qskUpdateBackgroundNode( const QskMenu*, QSGNode* )

View File

@ -20,8 +20,8 @@ class QSK_EXPORT QskMenuSkinlet : public QskPopupSkinlet
Q_INVOKABLE QskMenuSkinlet( QskSkin* = nullptr ); Q_INVOKABLE QskMenuSkinlet( QskSkin* = nullptr );
~QskMenuSkinlet() = default; ~QskMenuSkinlet() = default;
QRectF subControlRect( const QskSkinnable*, const QRectF&, QRectF subControlRect( const QskSkinnable*,
QskAspect::Subcontrol ) const override; const QRectF&, QskAspect::Subcontrol ) const override;
QSizeF sizeHint( const QskSkinnable*, QSizeF sizeHint( const QskSkinnable*,
Qt::SizeHint, const QSizeF& ) const override; Qt::SizeHint, const QSizeF& ) const override;

View File

@ -39,7 +39,7 @@ class QSK_EXPORT QskPushButton : public QskAbstractButton
Q_PROPERTY( bool flat READ isFlat WRITE setFlat NOTIFY flatChanged FINAL ) Q_PROPERTY( bool flat READ isFlat WRITE setFlat NOTIFY flatChanged FINAL )
Q_PROPERTY( QskBoxShapeMetrics shape READ shape Q_PROPERTY( QskBoxShapeMetrics shape READ shape
WRITE setShape RESET resetShape NOTIFY shapeChanged ) WRITE setShape RESET resetShape NOTIFY shapeChanged )
using Inherited = QskAbstractButton; using Inherited = QskAbstractButton;

View File

@ -26,7 +26,7 @@
#include <qquickwindow.h> #include <qquickwindow.h>
#include <qsgsimplerectnode.h> #include <qsgsimplerectnode.h>
static inline QRectF qskSceneAlignedRect( const QQuickItem* item , const QRectF& rect ) static inline QRectF qskSceneAlignedRect( const QQuickItem* item, const QRectF& rect )
{ {
/* /*
Aligning rect according to scene coordinates, so that Aligning rect according to scene coordinates, so that

View File

@ -122,7 +122,7 @@ class QSK_EXPORT QskSkinlet
void replaceChildNode( quint8 nodeRole, QSGNode* parentNode, void replaceChildNode( quint8 nodeRole, QSGNode* parentNode,
QSGNode* oldNode, QSGNode* newNode ) const; QSGNode* oldNode, QSGNode* newNode ) const;
QSizeF hintWithoutConstraint( QSizeF hintWithoutConstraint(
const QSizeF& hint, const QSizeF& constraint ) const; const QSizeF& hint, const QSizeF& constraint ) const;
private: private:

View File

@ -44,7 +44,7 @@ class QSK_EXPORT QskStatusIndicator : public QskControl
int status() const; int status() const;
bool hasStatus( int status ) const; bool hasStatus( int status ) const;
QList<int> statusList() const; QList< int > statusList() const;
public Q_SLOTS: public Q_SLOTS:
void setStatus( int status ); void setStatus( int status );

View File

@ -15,7 +15,7 @@ QskArcNode::~QskArcNode()
} }
void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics, void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics,
const QskGradient &gradient, QQuickWindow* window ) const QskGradient& gradient, QQuickWindow* window )
{ {
m_metrics = metrics; m_metrics = metrics;
m_gradient = gradient; m_gradient = gradient;
@ -23,7 +23,7 @@ void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics,
update( window, QskTextureRenderer::AutoDetect, rect.toRect() ); update( window, QskTextureRenderer::AutoDetect, rect.toRect() );
} }
void QskArcNode::paint( QPainter* painter, const QSizeF &size ) void QskArcNode::paint( QPainter* painter, const QSizeF& size )
{ {
const qreal w = m_metrics.width(); const qreal w = m_metrics.width();
const QRectF rect( 0.5 * w, 0.5 * w, size.width() - w, size.height() - w ); const QRectF rect( 0.5 * w, 0.5 * w, size.width() - w, size.height() - w );