upgraded to uncrustify 0.76.0 - still not happy with the C++ beautifier

situation, that requires way too much manual post processing
This commit is contained in:
Uwe Rathmann 2023-02-28 15:49:42 +01:00
parent 9b2c2a8f12
commit a6bf60c9b4
51 changed files with 657 additions and 404 deletions

File diff suppressed because it is too large Load Diff

View File

@ -218,7 +218,7 @@ void Box::setGradient( FillType fillType,
QskGradientStops stops; QskGradientStops stops;
stops += QskGradientStop( 0.0, color1 ); stops += QskGradientStop( 0.0, color1 );
stops += QskGradientStop( 1.0, color2 ); stops += QskGradientStop( 1.0, color2 );
setGradient( fillType, stops ); setGradient( fillType, stops );
} }

View File

@ -25,7 +25,7 @@
namespace namespace
{ {
// Some leftover definitions from M(aterial)2. TODO ... // Some leftover definitions from M(aterial)2. TODO ...
constexpr const QRgb Grey400 = 0xffbdbdbd; constexpr const QRgb Grey400 = 0xffbdbdbd;
constexpr const QRgb Grey500 = 0xff9e9e9e; constexpr const QRgb Grey500 = 0xff9e9e9e;
@ -418,7 +418,8 @@ static void addColoredBorderRectangles1( QskLinearBox* parent,
box->setShape( 30, Qt::AbsoluteSize ); box->setShape( 30, Qt::AbsoluteSize );
} }
static void addColoredBorderRectangles2( QskLinearBox* parent, bool rounded, Box::FillType fillType ) static void addColoredBorderRectangles2( QskLinearBox* parent,
bool rounded, Box::FillType fillType )
{ {
Box* box = new Box( parent ); Box* box = new Box( parent );
box->setBorderWidth( 20 ); box->setBorderWidth( 20 );
@ -431,7 +432,8 @@ static void addColoredBorderRectangles2( QskLinearBox* parent, bool rounded, Box
box->setShape( 30, Qt::AbsoluteSize ); box->setShape( 30, Qt::AbsoluteSize );
} }
static void addColoredBorderRectangles3( QskLinearBox* parent, bool rounded, Box::FillType fillType ) static void addColoredBorderRectangles3( QskLinearBox* parent,
bool rounded, Box::FillType fillType )
{ {
Box* box = new Box( parent ); Box* box = new Box( parent );
box->setBorderWidth( 20 ); box->setBorderWidth( 20 );
@ -471,7 +473,8 @@ static void addColoredBorderRectangles3( QskLinearBox* parent, bool rounded, Box
box->setShape( 30, Qt::AbsoluteSize ); box->setShape( 30, Qt::AbsoluteSize );
} }
static void addColoredBorderRectangles4( QskLinearBox* parent, bool rounded, Box::FillType fillType ) static void addColoredBorderRectangles4( QskLinearBox* parent,
bool rounded, Box::FillType fillType )
{ {
Box* box = new Box( parent ); Box* box = new Box( parent );
box->setBorderWidth( 20 ); box->setBorderWidth( 20 );
@ -485,7 +488,8 @@ static void addColoredBorderRectangles4( QskLinearBox* parent, bool rounded, Box
box->setShape( 30, Qt::AbsoluteSize ); box->setShape( 30, Qt::AbsoluteSize );
} }
static void addColoredBorderRectangles5( QskLinearBox* parent, bool rounded, Box::FillType fillType ) static void addColoredBorderRectangles5( QskLinearBox* parent,
bool rounded, Box::FillType fillType )
{ {
Box* box = new Box( parent ); Box* box = new Box( parent );
box->setBorderWidth( 20 ); box->setBorderWidth( 20 );

View File

@ -41,9 +41,10 @@ namespace
}; };
} }
BoxWithButtons::BoxWithButtons( const QString& title, const QString &prefix, BoxWithButtons::BoxWithButtons(
const int initialValue, const QString &suffix, const QString& title, const QString& prefix,
bool isBright, QQuickItem* parent ) const int initialValue, const QString& suffix,
bool isBright, QQuickItem* parent )
: Box( QString(), parent ) : Box( QString(), parent )
, m_prefix( prefix ) , m_prefix( prefix )
, m_suffix( suffix ) , m_suffix( suffix )

View File

@ -14,9 +14,10 @@ class BoxWithButtons : public Box
public: public:
QSK_SUBCONTROLS( Panel, ValuePanel, ValueText ) QSK_SUBCONTROLS( Panel, ValuePanel, ValueText )
BoxWithButtons( const QString& title, const QString& prefix, BoxWithButtons(
const int initialValue, const QString& suffix, const QString& title, const QString& prefix,
bool isBright, QQuickItem* parent = nullptr ); const int initialValue, const QString& suffix,
bool isBright, QQuickItem* parent = nullptr );
private: private:
void setValue( const int value ); void setValue( const int value );

View File

@ -15,9 +15,9 @@ class Diagram : public QskControl
public: public:
QSK_SUBCONTROLS( Chart, Segments, QSK_SUBCONTROLS( Chart, Segments,
ChartLine1, ChartArea1, ChartLine2, ChartLine1, ChartArea1, ChartLine2,
ChartArea2, ChartLine3, ChartArea3, ChartArea2, ChartLine3, ChartArea3,
ChartBar1, ChartBar2, ChartBar3 ) ChartBar1, ChartBar2, ChartBar3 )
enum Type enum Type
{ {

View File

@ -26,17 +26,17 @@ namespace
switch( type ) switch( type )
{ {
case Diagram::Line: case Diagram::Line:
row = 0; row = 0;
break; break;
case Diagram::Area: case Diagram::Area:
row = 1; row = 1;
break; break;
case Diagram::Bar: case Diagram::Bar:
row = 2; row = 2;
break; break;
} }
return subcontrols[ row * 3 + i ]; return subcontrols[ row * 3 + i ];
@ -146,7 +146,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
if( barsNode->childCount() > k ) if( barsNode->childCount() > k )
{ {
barNode = static_cast< QskBoxRectangleNode* >( barsNode->childAtIndex( k ) ); barNode = static_cast< QskBoxRectangleNode* >(
barsNode->childAtIndex( k ) );
} }
else else
{ {
@ -181,7 +182,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
if( chartNode->childCount() > nodeIndex ) if( chartNode->childCount() > nodeIndex )
{ {
dataPointNode = static_cast< DiagramDataNode* >( chartNode->childAtIndex( nodeIndex ) ); dataPointNode = static_cast< DiagramDataNode* >(
chartNode->childAtIndex( nodeIndex ) );
} }
else else
{ {
@ -202,7 +204,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
color = diagram->color( areaSubcontrol ); color = diagram->color( areaSubcontrol );
} }
dataPointNode->update( rect, nodeType, color, dataPoints, yMax, false, lineWidth ); dataPointNode->update( rect, nodeType, color,
dataPoints, yMax, false, lineWidth );
} }
nodeIndex++; nodeIndex++;
} }

View File

@ -22,7 +22,8 @@ QSK_SUBCONTROL( LightDisplay, Knob )
QSK_STATE( LightDisplay, Pressed, ( QskAspect::FirstUserState << 1 ) ) QSK_STATE( LightDisplay, Pressed, ( QskAspect::FirstUserState << 1 ) )
namespace { namespace
{
bool angleInRange( const QskArcMetrics& metrics, qreal angle ) bool angleInRange( const QskArcMetrics& metrics, qreal angle )
{ {
return angle >= metrics.startAngle() && angle <= metrics.endAngle(); return angle >= metrics.startAngle() && angle <= metrics.endAngle();
@ -123,7 +124,7 @@ void LightDisplay::mouseReleaseEvent( QMouseEvent* /*event*/ )
qreal LightDisplay::angleFromPoint( const QRectF& rect, const QPointF& point ) const qreal LightDisplay::angleFromPoint( const QRectF& rect, const QPointF& point ) const
{ {
QPointF circlePos( point.x() - rect.center().x(), QPointF circlePos( point.x() - rect.center().x(),
rect.center().y() - point.y() ); rect.center().y() - point.y() );
const qreal atan = qAtan2( circlePos.y(), circlePos.x() ); const qreal atan = qAtan2( circlePos.y(), circlePos.x() );
const qreal angle = qRadiansToDegrees( atan ); const qreal angle = qRadiansToDegrees( atan );

View File

@ -15,7 +15,7 @@ class LightDisplay : public QskBoundedValueInput
public: public:
QSK_SUBCONTROLS( Panel, Groove, ColdAndWarmArc, Tickmarks, ValueText, QSK_SUBCONTROLS( Panel, Groove, ColdAndWarmArc, Tickmarks, ValueText,
LeftLabel, RightLabel, Knob ) // ### rename knob to handle? LeftLabel, RightLabel, Knob ) // ### rename knob to handle?
QSK_STATES( Pressed ) QSK_STATES( Pressed )
LightDisplay( QQuickItem* parent = nullptr ); LightDisplay( QQuickItem* parent = nullptr );

View File

@ -39,7 +39,8 @@ QRectF LightDisplaySkinlet::subControlRect( const QskSkinnable* skinnable,
{ {
const auto textSize = textLabelsSize( display ); const auto textSize = textLabelsSize( display );
const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc ); const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc );
const qreal ticksWidth = display->arcMetricsHint( LightDisplay::Tickmarks ).width() + ticksSpacing; const qreal ticksWidth = display->arcMetricsHint(
LightDisplay::Tickmarks ).width() + ticksSpacing;
const qreal x = textSize.width() + arcMetrics.width() + ticksWidth; const qreal x = textSize.width() + arcMetrics.width() + ticksWidth;
const qreal w = contentsRect.width() - const qreal w = contentsRect.width() -
@ -104,7 +105,8 @@ QRectF LightDisplaySkinlet::subControlRect( const QskSkinnable* skinnable,
} }
else if( subControl == LightDisplay::Knob ) else if( subControl == LightDisplay::Knob )
{ {
const auto arcRect = subControlRect( skinnable, contentsRect, LightDisplay::ColdAndWarmArc ); const auto arcRect = subControlRect( skinnable,
contentsRect, LightDisplay::ColdAndWarmArc );
const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc ); const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc );
const auto knobSize = display->strutSizeHint( LightDisplay::Knob ); const auto knobSize = display->strutSizeHint( LightDisplay::Knob );
@ -165,19 +167,18 @@ QSGNode* LightDisplaySkinlet::updateSubNode(
case ValueTextRole: case ValueTextRole:
{ {
const QString valueText = QString::number( display->value(), 'f', 0 ) const QString valueText = QString::number( display->value(), 'f', 0 )
+ QStringLiteral( " %" ); + QStringLiteral( " %" );
return updateTextNode( skinnable, node, valueText, return updateTextNode( skinnable, node, valueText, LightDisplay::ValueText );
LightDisplay::ValueText );
} }
case LeftLabelRole: case LeftLabelRole:
{ {
return updateTextNode( skinnable, node, QStringLiteral( "0 " ), return updateTextNode( skinnable, node,
LightDisplay::LeftLabel ); QStringLiteral( "0 " ), LightDisplay::LeftLabel );
} }
case RightLabelRole: case RightLabelRole:
{ {
return updateTextNode( skinnable, node, QStringLiteral( " 100" ), return updateTextNode( skinnable, node,
LightDisplay::RightLabel ); QStringLiteral( " 100" ), LightDisplay::RightLabel );
} }
case KnobRole: case KnobRole:
{ {

View File

@ -199,20 +199,24 @@ void Cube::keyPressEvent( QKeyEvent* event )
switch( event->key() ) switch( event->key() )
{ {
case Qt::Key_Up: case Qt::Key_Up:
direction = Qsk::TopToBottom; direction = Qsk::TopToBottom;
break; break;
case Qt::Key_Down:
direction = Qsk::BottomToTop; case Qt::Key_Down:
break; direction = Qsk::BottomToTop;
case Qt::Key_Left: break;
direction = Qsk::LeftToRight;
break; case Qt::Key_Left:
case Qt::Key_Right: direction = Qsk::LeftToRight;
direction = Qsk::RightToLeft; break;
break;
default: case Qt::Key_Right:
return; direction = Qsk::RightToLeft;
break;
default:
return;
} }
switchPosition( direction ); switchPosition( direction );
@ -307,7 +311,7 @@ MainItem::MainItem( QQuickItem* parent )
void MainItem::gestureEvent( QskGestureEvent* event ) void MainItem::gestureEvent( QskGestureEvent* event )
{ {
if( event->gesture()->state() == QskGesture::Finished if( event->gesture()->state() == QskGesture::Finished
&& event->gesture()->type() == QskGesture::Pan ) && event->gesture()->type() == QskGesture::Pan )
{ {
const auto* panGesture = static_cast< const QskPanGesture* >( event->gesture().get() ); const auto* panGesture = static_cast< const QskPanGesture* >( event->gesture().get() );

View File

@ -14,70 +14,72 @@ class Cube : public QskStackBox
{ {
Q_OBJECT Q_OBJECT
public: public:
enum Edge { enum Edge
LeftEdge = Qsk::LeftToRight, {
RightEdge = Qsk::RightToLeft, LeftEdge = Qsk::LeftToRight,
TopEdge = Qsk::TopToBottom, RightEdge = Qsk::RightToLeft,
BottomEdge = Qsk::BottomToTop, TopEdge = Qsk::TopToBottom,
NumEdges BottomEdge = Qsk::BottomToTop,
}; NumEdges
Q_ENUM( Edge ) };
Q_ENUM( Edge )
enum Position { enum Position
LeftPos = LeftEdge, {
RightPos = RightEdge, LeftPos = LeftEdge,
TopPos = TopEdge, RightPos = RightEdge,
BottomPos = BottomEdge, TopPos = TopEdge,
FrontPos, BottomPos = BottomEdge,
BackPos, FrontPos,
NumPositions BackPos,
}; NumPositions
Q_ENUM( Position ) };
Q_ENUM( Position )
explicit Cube( QQuickItem* parent = nullptr ); explicit Cube( QQuickItem* parent = nullptr );
public Q_SLOTS: public Q_SLOTS:
void switchPosition( const Qsk::Direction direction ); void switchPosition( const Qsk::Direction direction );
void switchToPosition( const Cube::Position position ); void switchToPosition( const Cube::Position position );
Q_SIGNALS: Q_SIGNALS:
// might be different from indexChanged: // might be different from indexChanged:
void cubeIndexChanged( const int index ); void cubeIndexChanged( const int index );
protected: protected:
void keyPressEvent( QKeyEvent* event ) override; void keyPressEvent( QKeyEvent* event ) override;
private: private:
Position currentPosition() const; Position currentPosition() const;
Position neighbor( const Position position, const Qsk::Direction direction ) const; Position neighbor( const Position position, const Qsk::Direction direction ) const;
Qsk::Direction direction( const Position from, const Position to ) const; Qsk::Direction direction( const Position from, const Position to ) const;
void updateEdge( Qsk::Direction direction, Position position ); void updateEdge( Qsk::Direction direction, Position position );
void doSwitch( Qsk::Direction direction, Position position ); void doSwitch( Qsk::Direction direction, Position position );
Position m_destination; Position m_destination;
Edge m_currentEdge; Edge m_currentEdge;
bool m_isIntermediateHop; bool m_isIntermediateHop;
static QPair< Position, Edge > s_neighbors[ NumPositions ][ NumEdges ]; static QPair< Position, Edge > s_neighbors[ NumPositions ][ NumEdges ];
static Edge s_edgeTransformations[ NumEdges ][ NumEdges ]; static Edge s_edgeTransformations[ NumEdges ][ NumEdges ];
}; };
class MainItem : public QskControl class MainItem : public QskControl
{ {
Q_OBJECT Q_OBJECT
public: public:
MainItem( QQuickItem* parent = nullptr ); MainItem( QQuickItem* parent = nullptr );
protected: protected:
bool eventFilter(QObject *obj, QEvent *event) override final; bool eventFilter(QObject* obj, QEvent* event) override final;
bool gestureFilter( QQuickItem*, QEvent* ) override final; bool gestureFilter( QQuickItem*, QEvent* ) override final;
void gestureEvent( QskGestureEvent* ) override final; void gestureEvent( QskGestureEvent* ) override final;
private: private:
QskLinearBox* m_mainLayout; QskLinearBox* m_mainLayout;
MenuBar* m_menuBar; MenuBar* m_menuBar;
Cube* m_cube; Cube* m_cube;
QskPanGestureRecognizer m_panRecognizer; QskPanGestureRecognizer m_panRecognizer;
}; };

View File

@ -73,7 +73,8 @@ RoomsPage::RoomsPage( QQuickItem* parent )
const QVector< qreal > livingRoomWater = { 5, 8, 13, 2, 3, 9, 11 }; const QVector< qreal > livingRoomWater = { 5, 8, 13, 2, 3, 9, 11 };
const QVector< qreal > livingRoomElectricity = { 1, 8, 7, 4, 12, 6, 5 }; const QVector< qreal > livingRoomElectricity = { 1, 8, 7, 4, 12, 6, 5 };
const QVector< qreal > livingRoomGas = { 10, 11, 5, 8, 3, 1, 7 }; const QVector< qreal > livingRoomGas = { 10, 11, 5, 8, 3, 1, 7 };
auto livingRoomDiagram = new RoomsDiagram( livingRoomWater, livingRoomElectricity, livingRoomGas ); auto livingRoomDiagram = new RoomsDiagram(
livingRoomWater, livingRoomElectricity, livingRoomGas );
gridBox->addItem( new UsageDiagramBox( "Living Room", livingRoomDiagram ), 0, 0 ); gridBox->addItem( new UsageDiagramBox( "Living Room", livingRoomDiagram ), 0, 0 );
const QVector< qreal > bedroomWater = { 8, 6, 11, 2, 5, 4, 9 }; const QVector< qreal > bedroomWater = { 8, 6, 11, 2, 5, 4, 9 };

View File

@ -15,7 +15,8 @@ class RoundedIcon : public QskPushButton
QSK_SUBCONTROLS( Panel, PalePanel, Graphic ) QSK_SUBCONTROLS( Panel, PalePanel, Graphic )
QSK_STATES( Bright ) // to differentiate between orange and purple QSK_STATES( Bright ) // to differentiate between orange and purple
enum { enum
{
NormalRole, NormalRole,
CheckedRole, CheckedRole,
} GraphicRole; } GraphicRole;

View File

@ -288,9 +288,9 @@ void Skin::initHints( const Palette& palette )
// storage bar // storage bar
{ {
const auto make_gradient = []( const QColor color ) -> QskGradient { const auto make_gradient = []( const QColor color ) -> QskGradient
return { color.lighter(), color }; { return { color.lighter(), color }; };
};
ed.setGradient( StorageBar::Pictures, make_gradient( "#FFBE0B" ) ); ed.setGradient( StorageBar::Pictures, make_gradient( "#FFBE0B" ) );
ed.setGradient( StorageBar::Music, make_gradient( "#FB5607" ) ); ed.setGradient( StorageBar::Music, make_gradient( "#FB5607" ) );
ed.setGradient( StorageBar::Videos, make_gradient( "#FF006E" ) ); ed.setGradient( StorageBar::Videos, make_gradient( "#FF006E" ) );

View File

@ -43,9 +43,9 @@ class StorageBar final : public QskControl
void othersChanged( qreal value ); void othersChanged( qreal value );
private: private:
qreal m_pictures{ 0.0 }; qreal m_pictures = 0.0;
qreal m_music{ 0.0 }; qreal m_music = 0.0;
qreal m_videos{ 0.0 }; qreal m_videos = 0.0;
qreal m_documents{ 0.0 }; qreal m_documents = 0.0;
qreal m_others{ 0.0 }; qreal m_others = 0.0;
}; };

View File

@ -140,7 +140,8 @@ void UsageDiagram::addCurve( const qreal values[], const size_t count )
addDataPoints( points, Diagram::Area ); addDataPoints( points, Diagram::Area );
} }
UsageDiagramBox::UsageDiagramBox(const QString &title, Diagram *diagram, QQuickItem* parent ) UsageDiagramBox::UsageDiagramBox(
const QString& title, Diagram* diagram, QQuickItem* parent )
: Box( title, parent ) : Box( title, parent )
{ {
diagram->setParent( this ); diagram->setParent( this );

View File

@ -48,11 +48,11 @@ class SliderBox : public QskLinearBox
{ {
auto slider = new OtherSlider( this ); auto slider = new OtherSlider( this );
slider->setMinimum( 0 ); slider->setMinimum( 0 );
slider->setMaximum( 10 ); slider->setMaximum( 10 );
slider->setStepSize( 1 ); slider->setStepSize( 1 );
} }
{ {
auto slider = new CustomSlider( this ); auto slider = new CustomSlider( this );

View File

@ -24,7 +24,7 @@ namespace
{ {
public: public:
Window() Window()
{ {
setAutoLayoutChildren( true ); setAutoLayoutChildren( true );
const QImage image( QStringLiteral( ":/images/background.jpg" ) ); const QImage image( QStringLiteral( ":/images/background.jpg" ) );

View File

@ -75,7 +75,8 @@ void GridQuick::insert( const QByteArray& colorName,
We need to create a temporary layout in QML, so that the We need to create a temporary layout in QML, so that the
object for the attachedProperties is created early object for the attachedProperties is created early
*/ */
auto layout = createQml( "import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" ); auto layout = createQml(
"import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" );
auto rectangle = layout->childItems().constFirst(); auto rectangle = layout->childItems().constFirst();
rectangle->setParent( nullptr ); rectangle->setParent( nullptr );

View File

@ -122,7 +122,7 @@ class GridBox : public QskGridBox
addItem( label, row, 2 ); addItem( label, row, 2 );
connect( slider, &QskSlider::valueChanged, connect( slider, &QskSlider::valueChanged,
label, [label]( qreal value ) { label->setText( QString::number( value ) ); } ); label, [label]( qreal value ) { label->setText( QString::number( value ) ); } );
} }
}; };

View File

@ -18,9 +18,9 @@ class QskSetupFlagsQml : public QskQuickItem::UpdateFlags
Q_GADGET Q_GADGET
public: public:
template< typename... Args > template< typename ... Args >
QskSetupFlagsQml( Args&&... args ) QskSetupFlagsQml( Args&&... args )
: QskQuickItem::UpdateFlags( std::forward< Args >( args )... ) : QskQuickItem::UpdateFlags( std::forward< Args >( args ) ... )
{ {
} }

View File

@ -130,8 +130,7 @@ Qt::ShortcutContext QskShortcutQml::context() const
void QskShortcutQml::setContext( Qt::ShortcutContext context ) void QskShortcutQml::setContext( Qt::ShortcutContext context )
{ {
if ( context == Qt::ApplicationShortcut || if ( context == Qt::ApplicationShortcut || context == Qt::WindowShortcut )
context == Qt::WindowShortcut )
{ {
const bool isWindowContext = ( context == Qt::WindowShortcut ); const bool isWindowContext = ( context == Qt::WindowShortcut );

View File

@ -474,18 +474,18 @@ void Editor::setupRadioBox()
using A = QskAspect; using A = QskAspect;
setAnimation( Q::Ripple | A::Metric | A::Position, qskDuration ); setAnimation( Q::Ripple | A::Metric | A::Position, qskDuration );
setSpacing( Q::Panel, 10_dp ); setSpacing( Q::Panel, 10_dp );
setStrutSize( Q::Button, { 20_dp, 20_dp } ); setStrutSize( Q::Button, { 20_dp, 20_dp } );
setStrutSize( Q::Symbol, { 10_dp, 10_dp } ); setStrutSize( Q::Symbol, { 10_dp, 10_dp } );
setStrutSize( Q::Ripple, { 40_dp, 40_dp } ); setStrutSize( Q::Ripple, { 40_dp, 40_dp } );
setAlignment( Q::Symbol, Qt::AlignCenter ); setAlignment( Q::Symbol, Qt::AlignCenter );
setAlignment( Q::Text, Qt::AlignBottom ); setAlignment( Q::Text, Qt::AlignBottom );
setMargin( Q::Text, QskMargins( 10_dp, 0, 10_dp, 0 ) ); setMargin( Q::Text, QskMargins( 10_dp, 0, 10_dp, 0 ) );
setBoxShape( Q::Button, 20_dp ); setBoxShape( Q::Button, 20_dp );
setBoxShape( Q::Ripple, 40_dp ); setBoxShape( Q::Ripple, 40_dp );
setBoxBorderMetrics( Q::Button, 2_dp ); setBoxBorderMetrics( Q::Button, 2_dp );
@ -496,7 +496,7 @@ void Editor::setupRadioBox()
// Selected // Selected
setColor( Q::Ripple | Q::Selected, setColor( Q::Ripple | Q::Selected,
stateLayerColor( m_pal.primary, m_pal.focusOpacity ) ); stateLayerColor( m_pal.primary, m_pal.focusOpacity ) );
setBoxBorderColors( Q::Button | Q::Selected, m_pal.primary ); setBoxBorderColors( Q::Button | Q::Selected, m_pal.primary );
// Disabled // Disabled
@ -680,13 +680,16 @@ void Editor::setupPushButton()
setGradient( Q::Panel | M3::Elevated | Q::Disabled, m_pal.onSurface12 ); setGradient( Q::Panel | M3::Elevated | Q::Disabled, m_pal.onSurface12 );
setShadowMetrics( Q::Panel | M3::Elevated | Q::Disabled, m_pal.elevation0 ); setShadowMetrics( Q::Panel | M3::Elevated | Q::Disabled, m_pal.elevation0 );
setColor( Q::Text | M3::Elevated | Q::Disabled, m_pal.onSurface38 ); setColor( Q::Text | M3::Elevated | Q::Disabled, m_pal.onSurface38 );
setGraphicRole( Q::Graphic | M3::Elevated | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); setGraphicRole( Q::Graphic | M3::Elevated | Q::Disabled,
QskMaterial3Skin::GraphicRoleOnSurface38 );
const auto elevatedHoverColor = flattenedColor( m_pal.primary, m_pal.surface, m_pal.hoverOpacity ); const auto elevatedHoverColor =
flattenedColor( m_pal.primary, m_pal.surface, m_pal.hoverOpacity );
setGradient( Q::Panel | M3::Elevated | Q::Hovered, elevatedHoverColor ); setGradient( Q::Panel | M3::Elevated | Q::Hovered, elevatedHoverColor );
setShadowMetrics( Q::Panel | M3::Elevated | Q::Hovered, m_pal.elevation2 ); setShadowMetrics( Q::Panel | M3::Elevated | Q::Hovered, m_pal.elevation2 );
const auto elevatedPressedColor = flattenedColor( m_pal.primary, m_pal.surface, m_pal.pressedOpacity ); const auto elevatedPressedColor =
flattenedColor( m_pal.primary, m_pal.surface, m_pal.pressedOpacity );
setGradient( Q::Panel | M3::Elevated | Q::Focused, elevatedPressedColor ); setGradient( Q::Panel | M3::Elevated | Q::Focused, elevatedPressedColor );
setShadowMetrics( Q::Panel | M3::Elevated | Q::Focused, m_pal.elevation1 ); setShadowMetrics( Q::Panel | M3::Elevated | Q::Focused, m_pal.elevation1 );
@ -724,17 +727,21 @@ void Editor::setupPushButton()
setShadowMetrics( Q::Panel | M3::Tonal, m_pal.elevation0 ); setShadowMetrics( Q::Panel | M3::Tonal, m_pal.elevation0 );
setColor( Q::Text | M3::Tonal, m_pal.onSecondaryContainer ); setColor( Q::Text | M3::Tonal, m_pal.onSecondaryContainer );
setGraphicRole( Q::Graphic | M3::Tonal, QskMaterial3Skin::GraphicRoleOnSecondaryContainer ); setGraphicRole( Q::Graphic | M3::Tonal, QskMaterial3Skin::GraphicRoleOnSecondaryContainer );
setGradient( Q::Ripple | M3::Tonal, stateLayerColor( m_pal.onSecondaryContainer, m_pal.pressedOpacity ) ); setGradient( Q::Ripple | M3::Tonal,
stateLayerColor( m_pal.onSecondaryContainer, m_pal.pressedOpacity ) );
setGradient( Q::Panel | M3::Tonal | Q::Disabled, m_pal.onSurface12 ); setGradient( Q::Panel | M3::Tonal | Q::Disabled, m_pal.onSurface12 );
setColor( Q::Text | M3::Tonal | Q::Disabled, m_pal.onSurface38 ); setColor( Q::Text | M3::Tonal | Q::Disabled, m_pal.onSurface38 );
setGraphicRole( Q::Graphic | M3::Tonal | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); setGraphicRole( Q::Graphic | M3::Tonal | Q::Disabled,
QskMaterial3Skin::GraphicRoleOnSurface38 );
const auto tonalHoverColor = flattenedColor( m_pal.onSecondaryContainer, m_pal.secondaryContainer, m_pal.hoverOpacity ); const auto tonalHoverColor = flattenedColor( m_pal.onSecondaryContainer,
m_pal.secondaryContainer, m_pal.hoverOpacity );
setGradient( Q::Panel | M3::Tonal | Q::Hovered, tonalHoverColor ); setGradient( Q::Panel | M3::Tonal | Q::Hovered, tonalHoverColor );
setShadowMetrics( Q::Panel | M3::Tonal | Q::Hovered, m_pal.elevation1 ); setShadowMetrics( Q::Panel | M3::Tonal | Q::Hovered, m_pal.elevation1 );
const auto tonalPressedColor = flattenedColor( m_pal.onSecondaryContainer, m_pal.secondaryContainer, m_pal.pressedOpacity ); const auto tonalPressedColor = flattenedColor( m_pal.onSecondaryContainer,
m_pal.secondaryContainer, m_pal.pressedOpacity );
setGradient( Q::Panel | M3::Tonal | Q::Focused, tonalPressedColor ); setGradient( Q::Panel | M3::Tonal | Q::Focused, tonalPressedColor );
setShadowMetrics( Q::Panel | M3::Tonal | Q::Focused, m_pal.elevation0 ); setShadowMetrics( Q::Panel | M3::Tonal | Q::Focused, m_pal.elevation0 );
@ -754,7 +761,8 @@ void Editor::setupPushButton()
setBoxBorderColors( Q::Panel | M3::Outlined | Q::Disabled, m_pal.onSurface12 ); setBoxBorderColors( Q::Panel | M3::Outlined | Q::Disabled, m_pal.onSurface12 );
setColor( Q::Text | M3::Outlined | Q::Disabled, m_pal.onSurface38 ); setColor( Q::Text | M3::Outlined | Q::Disabled, m_pal.onSurface38 );
setGraphicRole( Q::Graphic | M3::Outlined | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); setGraphicRole( Q::Graphic | M3::Outlined | Q::Disabled,
QskMaterial3Skin::GraphicRoleOnSurface38 );
setBoxBorderColors( Q::Panel | M3::Outlined | Q::Hovered, m_pal.outline ); setBoxBorderColors( Q::Panel | M3::Outlined | Q::Hovered, m_pal.outline );
setGradient( Q::Panel | M3::Outlined | Q::Hovered, m_pal.primary8 ); setGradient( Q::Panel | M3::Outlined | Q::Hovered, m_pal.primary8 );

View File

@ -621,10 +621,10 @@ void Editor::setupRadioBox()
using Q = QskRadioBox; using Q = QskRadioBox;
setSpacing(Q::Panel, qskDpiScaled( 10 ) ); setSpacing(Q::Panel, qskDpiScaled( 10 ) );
setStrutSize( Q::Button, { qskDpiScaled( 20 ), qskDpiScaled( 20 ) } ); setStrutSize( Q::Button, { qskDpiScaled( 20 ), qskDpiScaled( 20 ) } );
setStrutSize( Q::Symbol, { qskDpiScaled( 9 ), qskDpiScaled( 9 ) }) ; setStrutSize( Q::Symbol, { qskDpiScaled( 9 ), qskDpiScaled( 9 ) });
setBoxShape( Q::Button, qskDpiScaled( 20 ) ); setBoxShape( Q::Button, qskDpiScaled( 20 ) );
setBoxShape( Q::Ripple, qskDpiScaled( 40 ) ); setBoxShape( Q::Ripple, qskDpiScaled( 40 ) );
setBoxBorderMetrics( Q::Button, qskDpiScaled( 1 ) ); setBoxBorderMetrics( Q::Button, qskDpiScaled( 1 ) );
@ -638,12 +638,12 @@ void Editor::setupRadioBox()
setColor( Q::Panel | Q::Disabled, m_pal.lighter125 ); setColor( Q::Panel | Q::Disabled, m_pal.lighter125 );
setColor( Q::Button | Q::Disabled, m_pal.lighter110 ); setColor( Q::Button | Q::Disabled, m_pal.lighter110 );
setColor( Q::Text | Q::Disabled, m_pal.darker200 ); setColor( Q::Text | Q::Disabled, m_pal.darker200 );
setColor( Q::Symbol | Q::Disabled, m_pal.darker200 ); setColor( Q::Symbol | Q::Disabled, m_pal.darker200 );
setMargin( Q::Text, QskMargins( qskDpiScaled( 10 ), 0, qskDpiScaled( 10 ), 0 )); setMargin( Q::Text, QskMargins( qskDpiScaled( 10 ), 0, qskDpiScaled( 10 ), 0 ) );
setAlignment( Q::Symbol, Qt::AlignCenter ); setAlignment( Q::Symbol, Qt::AlignCenter );
setAlignment( Q::Text, Qt::AlignBottom ); setAlignment( Q::Text, Qt::AlignBottom );
@ -1046,7 +1046,7 @@ void Editor::setupSpinBox()
setBoxShape( subControl, 0 ); setBoxShape( subControl, 0 );
const auto downState = ( subControl == Q::UpPanel ) const auto downState = ( subControl == Q::UpPanel )
? Q::Increasing : Q::Decreasing; ? Q::Increasing : Q::Decreasing;
setButton( subControl | downState, Sunken, 1.0 ); setButton( subControl | downState, Sunken, 1.0 );

View File

@ -77,7 +77,7 @@ class QSK_EXPORT QskBoxBorderMetrics
constexpr bool isEquidistant() const noexcept; constexpr bool isEquidistant() const noexcept;
QRectF adjustedRect( const QRectF& )const ; QRectF adjustedRect( const QRectF& ) const;
private: private:
QskMargins m_widths; QskMargins m_widths;

View File

@ -38,7 +38,7 @@ class QSK_EXPORT QskBoxShapeMetrics
Symmetric or Proportional shrink the larger radius, while SymmetricByMaximum Symmetric or Proportional shrink the larger radius, while SymmetricByMaximum
expands the smaller radius to achieve the desired aspect ratio. expands the smaller radius to achieve the desired aspect ratio.
The effect of the scaling on the implemented box rendering is: The effect of the scaling on the implemented box rendering is:
- SymmetricByMaximum in combination with a relative radius of 100 - SymmetricByMaximum in combination with a relative radius of 100
results in an ellipse. results in an ellipse.

View File

@ -65,7 +65,7 @@ static inline QTransform qskTransformForRect( int, const QRectF& rect )
return QTransform( w, 0, 0, h, x, y ); return QTransform( w, 0, 0, h, x, y );
} }
QskGradient::QskGradient( const QColor& color ) QskGradient::QskGradient( const QColor& color )
: QskGradient() : QskGradient()
{ {
@ -751,7 +751,7 @@ QGradient QskGradient::toQGradient() const
} }
} }
g.setCoordinateMode( m_stretchMode == NoStretch g.setCoordinateMode( m_stretchMode == NoStretch
? QGradient::LogicalMode : QGradient::ObjectMode ); ? QGradient::LogicalMode : QGradient::ObjectMode );
g.setSpread( static_cast< QGradient::Spread >( m_spreadMode ) ); g.setSpread( static_cast< QGradient::Spread >( m_spreadMode ) );

View File

@ -131,7 +131,7 @@ void QskLinearDirection::setInterval( Qt::Orientation orientation, qreal from, q
void QskLinearDirection::precalculate() const noexcept void QskLinearDirection::precalculate() const noexcept
{ {
m_dx = m_x2 - m_x1; m_dx = m_x2 - m_x1;
m_dy = m_y2 - m_y1; m_dy = m_y2 - m_y1;
m_dot = m_dx * m_dx + m_dy * m_dy; m_dot = m_dx * m_dx + m_dy * m_dy;
} }

View File

@ -74,7 +74,7 @@ class QSK_EXPORT QskLinearDirection
/* /*
In direction of the gradient vector, where 0.0 corresponds to In direction of the gradient vector, where 0.0 corresponds to
points on the perpendicular at the start and 1.0 to points on points on the perpendicular at the start and 1.0 to points on
the perpendicular of the end point. the perpendicular of the end point.
Also corresponds to the positions of the color stops and can be Also corresponds to the positions of the color stops and can be
used to calculate the color at a specific position. used to calculate the color at a specific position.

View File

@ -403,7 +403,7 @@ QGradientStops qskToQGradientStops( const QskGradientStops& stops )
for ( const auto& stop : stops ) for ( const auto& stop : stops )
{ {
QPair<qreal, QColor> qStop = { stop.position(), stop.color() }; QPair< qreal, QColor > qStop = { stop.position(), stop.color() };
if ( !qStops.isEmpty() && qStops.last().first == qStop.first ) if ( !qStops.isEmpty() && qStops.last().first == qStop.first )
{ {

View File

@ -38,11 +38,8 @@ QVariant QskTextColors::interpolate(
static inline void qskDebugColor( QDebug debug, const QColor& c ) static inline void qskDebugColor( QDebug debug, const QColor& c )
{ {
debug << '(' debug << '(' << c.red() << ',' << c.green() << ','
<< c.red() << ',' << c.blue() << ',' << c.alpha() << ')';
<< c.green() << ','
<< c.blue() << ','
<< c.alpha() << ')';
} }
QDebug operator<<( QDebug debug, const QskTextColors& colors ) QDebug operator<<( QDebug debug, const QskTextColors& colors )

View File

@ -13,7 +13,7 @@
QSK_SYSTEM_STATE( QskAbstractButton, Checked, QskAspect::LastSystemState >> 3 ) QSK_SYSTEM_STATE( QskAbstractButton, Checked, QskAspect::LastSystemState >> 3 )
QSK_SYSTEM_STATE( QskAbstractButton, Pressed, QskAspect::LastSystemState >> 2 ) QSK_SYSTEM_STATE( QskAbstractButton, Pressed, QskAspect::LastSystemState >> 2 )
static QskAbstractButton* qskCheckedSibling( const QskAbstractButton* button ) static QskAbstractButton* qskCheckedSibling( const QskAbstractButton * button )
{ {
const auto parentItem = button->parentItem(); const auto parentItem = button->parentItem();
if ( parentItem == nullptr ) if ( parentItem == nullptr )

View File

@ -55,11 +55,8 @@ QskComboBox::QskComboBox( QQuickItem* parent )
connect( this, &QskComboBox::currentIndexChanged, connect( this, &QskComboBox::currentIndexChanged,
this, &QskControl::focusIndicatorRectChanged ); this, &QskControl::focusIndicatorRectChanged );
connect( m_data->menu, &QskMenu::closed, this, [ this ]() connect( m_data->menu, &QskMenu::closed, this,
{ [ this ]() { setPopupOpen( false ); setFocus( true ); } );
setPopupOpen( false );
setFocus( true );
} );
connect( this, &QskComboBox::pressed, this, &QskComboBox::togglePopup ); connect( this, &QskComboBox::pressed, this, &QskComboBox::togglePopup );
} }

View File

@ -52,7 +52,8 @@ QskControl::~QskControl()
if( this == w->mouseGrabberItem() ) if( this == w->mouseGrabberItem() )
{ {
// to catch suicide situations as a result of mouse clicks // to catch suicide situations as a result of mouse clicks
qWarning() << "QskControl::~QskControl: probably suicide situation detected, control is the mouse grabber item" << this; qWarning() << "QskControl::~QskControl: probably suicide situation detected, "
"control is the mouse grabber item" << this;
} }
} }

View File

@ -23,11 +23,11 @@ class QWheelEvent;
class QHoverEvent; class QHoverEvent;
class QKeyEvent; class QKeyEvent;
#define QSK_EVENT_DISABLE_COPY(Class) \ #define QSK_EVENT_DISABLE_COPY( Class ) \
Class(const Class &) = default; \ Class( const Class& ) = default; \
Class(Class &&) = delete; \ Class( Class && ) = delete; \
Class &operator=(const Class &other) = default; \ Class& operator=( const Class & ) = default; \
Class &operator=(Class &&) = delete; Class& operator=( Class && ) = delete;
class QSK_EXPORT QskEvent : public QEvent class QSK_EXPORT QskEvent : public QEvent
{ {

View File

@ -134,7 +134,7 @@ QSGNode* QskProgressBarSkinlet::updateBarNode(
definition for the 100% situation and have to adjust definition for the 100% situation and have to adjust
the stops for smaller bars. the stops for smaller bars.
For this situation it would be more convenient to For this situation it would be more convenient to
adjust the start/stop positions, but the box renderer is adjust the start/stop positions, but the box renderer is
not supporting this yet. TODO ... not supporting this yet. TODO ...
*/ */

View File

@ -48,7 +48,7 @@ class QSK_EXPORT QskPushButton : public QskAbstractButton
QSK_SUBCONTROLS( Panel, Ripple, Text, Graphic ) QSK_SUBCONTROLS( Panel, Ripple, Text, Graphic )
enum Emphasis enum Emphasis
{ {
VeryLowEmphasis = -2, VeryLowEmphasis = -2,
LowEmphasis = -1, LowEmphasis = -1,
NoEmphasis = 0, NoEmphasis = 0,

View File

@ -42,7 +42,7 @@ namespace
const auto textOptions = button->textOptions(); const auto textOptions = button->textOptions();
if ( ( textOptions.elideMode() == Qt::ElideNone ) if ( ( textOptions.elideMode() == Qt::ElideNone )
&& ( textOptions.wrapMode() == QskTextOptions::NoWrap ) ) && ( textOptions.wrapMode() == QskTextOptions::NoWrap ) )
{ {
const auto alignment = button->alignmentHint( const auto alignment = button->alignmentHint(
QskPushButton::Panel, Qt::AlignCenter ); QskPushButton::Panel, Qt::AlignCenter );

View File

@ -37,9 +37,7 @@ QskRadioBox::QskRadioBox( QQuickItem* parent )
connect(this, &QskRadioBox::itemsChanged, this, connect(this, &QskRadioBox::itemsChanged, this,
[this]( const QStringList& items ) [this]( const QStringList& items )
{ { setFocusPolicy( items.count() > 0 ? Qt::StrongFocus : Qt::NoFocus ); }
setFocusPolicy( items.count() > 0 ? Qt::StrongFocus : Qt::NoFocus );
}
); );
setFocusedIndex( -1 ); setFocusedIndex( -1 );

View File

@ -59,16 +59,18 @@ namespace
LayoutEngine( const QskSegmentedBar* bar, int index ) LayoutEngine( const QskSegmentedBar* bar, int index )
: QskSubcontrolLayoutEngine( bar->orientation() ) : QskSubcontrolLayoutEngine( bar->orientation() )
{ {
setSpacing( bar->spacingHint( QskSegmentedBar::Panel ) ); using Q = QskSegmentedBar;
setSpacing( bar->spacingHint( Q::Panel ) );
setGraphicTextElements( bar, setGraphicTextElements( bar,
QskSegmentedBar::Text, qskValueAt< QString >( bar, index ), Q::Text, qskValueAt< QString >( bar, index ),
QskSegmentedBar::Graphic, graphicAt( bar, index ).defaultSize() ); Q::Graphic, graphicAt( bar, index ).defaultSize() );
if( bar->orientation() == Qt::Horizontal ) if( bar->orientation() == Qt::Horizontal )
{ {
const auto alignment = bar->alignmentHint( QskSegmentedBar::Panel, Qt::AlignCenter ); const auto alignment = bar->alignmentHint( Q::Panel, Qt::AlignCenter );
setFixedContent( QskSegmentedBar::Text, Qt::Horizontal, alignment ); setFixedContent( Q::Text, Qt::Horizontal, alignment );
} }
} }
}; };
@ -151,7 +153,7 @@ QRectF QskSegmentedBarSkinlet::segmentRect(
{ {
const qreal h = rect.height() / count; const qreal h = rect.height() / count;
rect.setTop( index * h ); rect.setTop( index * h );
rect.setHeight( h ); rect.setHeight( h );
} }
@ -218,7 +220,8 @@ QSGNode* QskSegmentedBarSkinlet::updateSubNode(
return nullptr; return nullptr;
} }
QSizeF QskSegmentedBarSkinlet::segmentSizeHint( const QskSegmentedBar* bar, Qt::SizeHint which ) const QSizeF QskSegmentedBarSkinlet::segmentSizeHint(
const QskSegmentedBar* bar, Qt::SizeHint which ) const
{ {
using Q = QskSegmentedBar; using Q = QskSegmentedBar;
@ -228,13 +231,14 @@ QSizeF QskSegmentedBarSkinlet::segmentSizeHint( const QskSegmentedBar* bar, Qt::
{ {
LayoutEngine layoutEngine( bar, i ); LayoutEngine layoutEngine( bar, i );
const auto graphic = bar->effectiveSkin()->symbol( QskStandardSymbol::SegmentedBarCheckMark ); const auto graphic = bar->effectiveSkin()->symbol(
QskStandardSymbol::SegmentedBarCheckMark );
// We want to know how big the element can grow when it is selected, // We want to know how big the element can grow when it is selected,
// i.e. when it has the checkmark symbol: // i.e. when it has the checkmark symbol:
layoutEngine.setGraphicTextElements( bar, layoutEngine.setGraphicTextElements( bar,
QskSegmentedBar::Text, qskValueAt< QString >( bar, i ), Q::Text, qskValueAt< QString >( bar, i ),
QskSegmentedBar::Graphic, graphic.defaultSize() ); Q::Graphic, graphic.defaultSize() );
const auto size = layoutEngine.sizeHint( which, QSizeF() ); const auto size = layoutEngine.sizeHint( which, QSizeF() );

View File

@ -245,7 +245,7 @@ void QskSkinHintTableEditor::setGradient(
QskStateCombination combination ) QskStateCombination combination )
{ {
const QskGradient gradient( color1, color2 ); const QskGradient gradient( color1, color2 );
setColorHint( aspect, gradient , combination ); setColorHint( aspect, gradient, combination );
} }
void QskSkinHintTableEditor::setGradient( void QskSkinHintTableEditor::setGradient(

View File

@ -193,7 +193,7 @@ void QskSpinBox::setWrapping( bool on )
{ {
if ( on != m_data->wrapping ) if ( on != m_data->wrapping )
{ {
m_data->wrapping = on; m_data->wrapping = on;
Q_EMIT wrappingChanged( on ); Q_EMIT wrappingChanged( on );
} }
} }

View File

@ -49,8 +49,8 @@ class QSK_EXPORT QskSpinBox : public QskBoundedValueInput
Q_ENUM( Decoration ) Q_ENUM( Decoration )
QskSpinBox( QQuickItem* parent = nullptr ); QskSpinBox( QQuickItem* parent = nullptr );
QskSpinBox( qreal min, qreal max, qreal stepSize, QskSpinBox( qreal min, qreal max,
QQuickItem* parent = nullptr ); qreal stepSize, QQuickItem* parent = nullptr );
~QskSpinBox() override; ~QskSpinBox() override;

View File

@ -186,7 +186,7 @@ QSizeF QskSpinBoxSkinlet::sizeHint( const QskSkinnable* skinnable,
hint.setWidth( std::max( w1, w2 ) ); hint.setWidth( std::max( w1, w2 ) );
hint.setHeight( fm.height() ); hint.setHeight( fm.height() );
hint = hint.grownBy( spinBox->paddingHint( Q::TextPanel ) ); hint = hint.grownBy( spinBox->paddingHint( Q::TextPanel ) );
hint = hint.expandedTo( spinBox->strutSizeHint( Q::TextPanel ) ); hint = hint.expandedTo( spinBox->strutSizeHint( Q::TextPanel ) );
} }
@ -215,10 +215,10 @@ QSizeF QskSpinBoxSkinlet::sizeHint( const QskSkinnable* skinnable,
} }
else else
{ {
if ( hintDown.width() > 0.0 ) if ( hintDown.width() > 0.0 )
hint.rwidth() += hintDown.width() + spacing; hint.rwidth() += hintDown.width() + spacing;
if ( hintUp.width() > 0.0 ) if ( hintUp.width() > 0.0 )
hint.rwidth() += hintUp.width() + spacing; hint.rwidth() += hintUp.width() + spacing;
const auto h = std::max( hintUp.height(), hintDown.height() ); const auto h = std::max( hintUp.height(), hintDown.height() );

View File

@ -21,7 +21,7 @@ class QSK_EXPORT QskSpinBoxSkinlet : public QskSkinlet
TextPanel, TextPanel,
Text, Text,
UpPanel, UpPanel,
UpIndicator, UpIndicator,
DownPanel, DownPanel,

View File

@ -269,8 +269,8 @@ QskGraphic QskStandardSymbol::graphic( Type symbolType )
case QskStandardSymbol::SegmentedBarCheckMark: case QskStandardSymbol::SegmentedBarCheckMark:
{ {
qskCheckMarkGraphic( &painter ); qskCheckMarkGraphic( &painter );
break; break;
} }
case QskStandardSymbol::Bullet: case QskStandardSymbol::Bullet:
{ {
qskBulletGraphic( &painter ); qskBulletGraphic( &painter );

View File

@ -619,7 +619,7 @@ QTransform QskStackBoxAnimator4::transformation(
transform.translate( dx, dy ); transform.translate( dx, dy );
transform.rotateRadians( radians - M_PI_2, Qt::YAxis ); transform.rotateRadians( radians - M_PI_2, Qt::YAxis );
transform.translate( 0.0, -dy ); transform.translate( 0.0, -dy );
} }
} }
else else
{ {

View File

@ -408,7 +408,8 @@ void QskSubcontrolLayoutEngine::setGraphicTextElements( const QskSkinnable* skin
} }
} }
void QskSubcontrolLayoutEngine::setFixedContent( QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment ) void QskSubcontrolLayoutEngine::setFixedContent(
QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment )
{ {
if( auto* e = element( subcontrol ) ) if( auto* e = element( subcontrol ) )
{ {
@ -419,38 +420,38 @@ void QskSubcontrolLayoutEngine::setFixedContent( QskAspect::Subcontrol subcontro
switch( orientation ) switch( orientation )
{ {
case Qt::Horizontal: case Qt::Horizontal:
extraSpacing |= ( extraSpacingAt() & ( Qt::TopEdge | Qt::BottomEdge ) ); extraSpacing |= ( extraSpacingAt() & ( Qt::TopEdge | Qt::BottomEdge ) );
if( alignment & Qt::AlignLeft ) if( alignment & Qt::AlignLeft )
{ {
extraSpacing |= Qt::RightEdge; extraSpacing |= Qt::RightEdge;
} }
else if( alignment & Qt::AlignRight ) else if( alignment & Qt::AlignRight )
{ {
extraSpacing |= Qt::LeftEdge; extraSpacing |= Qt::LeftEdge;
} }
else if( alignment & Qt::AlignHCenter ) else if( alignment & Qt::AlignHCenter )
{ {
extraSpacing |= Qt::LeftEdge | Qt::RightEdge; extraSpacing |= Qt::LeftEdge | Qt::RightEdge;
} }
break; break;
case Qt::Vertical: case Qt::Vertical:
extraSpacing |= ( extraSpacingAt() & ( Qt::LeftEdge | Qt::RightEdge ) ); extraSpacing |= ( extraSpacingAt() & ( Qt::LeftEdge | Qt::RightEdge ) );
if( alignment & Qt::AlignTop ) if( alignment & Qt::AlignTop )
{ {
extraSpacing |= Qt::BottomEdge; extraSpacing |= Qt::BottomEdge;
} }
else if( alignment & Qt::AlignBottom ) else if( alignment & Qt::AlignBottom )
{ {
extraSpacing |= Qt::TopEdge; extraSpacing |= Qt::TopEdge;
} }
else if( alignment & Qt::AlignVCenter ) else if( alignment & Qt::AlignVCenter )
{ {
extraSpacing |= Qt::TopEdge | Qt::BottomEdge; extraSpacing |= Qt::TopEdge | Qt::BottomEdge;
} }
break; break;
} }
setExtraSpacingAt( extraSpacing ); setExtraSpacingAt( extraSpacing );

View File

@ -153,32 +153,32 @@ void Skinny::changeSkin( QskAnimationHint hint )
} }
void Skinny::changeFonts( int increment ) void Skinny::changeFonts( int increment )
{ {
auto skin = qskSetup->skin(); auto skin = qskSetup->skin();
const auto fonts = skin->fonts(); const auto fonts = skin->fonts();
for ( auto it = fonts.begin(); it != fonts.end(); ++it ) for ( auto it = fonts.begin(); it != fonts.end(); ++it )
{ {
auto role = it->first; auto role = it->first;
auto font = it->second; auto font = it->second;
if ( font.pixelSize() > 0 ) if ( font.pixelSize() > 0 )
{ {
const auto newSize = font.pixelSize() + increment; const auto newSize = font.pixelSize() + increment;
if ( newSize > 0 ) if ( newSize > 0 )
font.setPixelSize( newSize ); font.setPixelSize( newSize );
} }
else else
{ {
const auto newSize = font.pointSizeF() + increment; const auto newSize = font.pointSizeF() + increment;
if ( newSize > 0 ) if ( newSize > 0 )
font.setPointSizeF( font.pointSizeF() + increment ); font.setPointSizeF( font.pointSizeF() + increment );
} }
skin->setFont( role, font ); skin->setFont( role, font );
} }
Q_EMIT qskSetup->skinChanged( skin ); Q_EMIT qskSetup->skinChanged( skin );
} }

View File

@ -154,7 +154,7 @@ QPainterPath SkinnyShapeFactory::shapePath( Shape shape, const QSizeF& size )
{ {
path.arcMoveTo( rect, -60 ); path.arcMoveTo( rect, -60 );
path.arcTo( rect, -60, 300 ); path.arcTo( rect, -60, 300 );
const double w = 0.25 * rect.width(); const double w = 0.25 * rect.width();
const auto r = rect.adjusted( w, w, -w, -w ); const auto r = rect.adjusted( w, w, -w, -w );
@ -164,7 +164,7 @@ QPainterPath SkinnyShapeFactory::shapePath( Shape shape, const QSizeF& size )
innerPath.arcTo( r, 240, -300 ); innerPath.arcTo( r, 240, -300 );
path.connectPath( innerPath ); path.connectPath( innerPath );
break; break;
} }