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:
parent
9b2c2a8f12
commit
a6bf60c9b4
563
.uncrustify
563
.uncrustify
File diff suppressed because it is too large
Load Diff
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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 )
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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() );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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 };
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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" ) );
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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 ) ... )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -623,7 +623,7 @@ void Editor::setupRadioBox()
|
||||||
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 ) );
|
||||||
|
|
@ -643,7 +643,7 @@ void Editor::setupRadioBox()
|
||||||
|
|
||||||
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 );
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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 )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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 )
|
||||||
|
|
|
||||||
|
|
@ -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 )
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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() );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue