QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSegmentedBarSkinlet.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SEGMENTED_BAR_SKINLET_H
7#define QSK_SEGMENTED_BAR_SKINLET_H
8
9#include "QskSkinlet.h"
10
11class QskSegmentedBar;
12
13class QSK_EXPORT QskSegmentedBarSkinlet : public QskSkinlet
14{
15 Q_GADGET
16
17 using Inherited = QskSkinlet;
18
19 public:
20 enum NodeRole
21 {
22 PanelRole,
23 SegmentRole,
24 SeparatorRole,
25 CursorRole,
26 SplashRole,
27
28 TextRole,
29 IconRole,
30
31 RoleCount
32 };
33
34 Q_INVOKABLE QskSegmentedBarSkinlet( QskSkin* = nullptr );
35 ~QskSegmentedBarSkinlet() override;
36
37 QRectF subControlRect( const QskSkinnable*, const QRectF&,
38 QskAspect::Subcontrol ) const override;
39
40 QSizeF sizeHint( const QskSkinnable*,
41 Qt::SizeHint, const QSizeF& ) const override;
42
43 int sampleCount( const QskSkinnable*, QskAspect::Subcontrol ) const override;
44
45 QRectF sampleRect( const QskSkinnable*,
46 const QRectF&, QskAspect::Subcontrol, int index ) const override;
47
48 QskAspect::States sampleStates( const QskSkinnable*,
49 QskAspect::Subcontrol, int index ) const override;
50
51 protected:
52 QSGNode* updateSubNode( const QskSkinnable*,
53 quint8 nodeRole, QSGNode* ) const override;
54
55 QSGNode* updateSampleNode( const QskSkinnable*,
56 QskAspect::Subcontrol, int index, QSGNode* ) const override;
57
58 private:
59 QSizeF segmentSizeHint(const QskSegmentedBar*, Qt::SizeHint ) const;
60
61 QRectF segmentRect( const QskSegmentedBar*, const QRectF&, int index ) const;
62 QRectF separatorRect( const QskSegmentedBar*, const QRectF&, int index ) const;
63 QRectF cursorRect( const QskSegmentedBar*, const QRectF& ) const;
64 QRectF splashRect( const QskSegmentedBar*, const QRectF& ) const;
65
66 QSGNode* updateSplashNode( const QskSegmentedBar*, QSGNode* ) const;
67};
68
69#endif
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104
Describes the rendering interface of a QskControl. Change the skinlet to change the appearance of the...
Definition QskSkinlet.h:34