QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSwitchButtonSkinlet.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SWITCH_BUTTON_SKINLET_H
7#define QSK_SWITCH_BUTTON_SKINLET_H
8
9#include "QskSkinlet.h"
10
11class QskSwitchButton;
12
13class QSK_EXPORT QskSwitchButtonSkinlet : public QskSkinlet
14{
15 Q_GADGET
16
17 using Inherited = QskSkinlet;
18
19 public:
20 enum NodeRole
21 {
22 GrooveRole,
23 HandleRole,
24 IconRole,
25
26 RoleCount
27 };
28
29 Q_INVOKABLE QskSwitchButtonSkinlet( QskSkin* = nullptr );
30 ~QskSwitchButtonSkinlet() override;
31
32 QRectF subControlRect( const QskSkinnable*,
33 const QRectF&, QskAspect::Subcontrol ) const override;
34
35 QSizeF sizeHint( const QskSkinnable*,
36 Qt::SizeHint, const QSizeF& ) const override;
37
38 protected:
39 QSGNode* updateSubNode( const QskSkinnable*,
40 quint8 nodeRole, QSGNode* ) const override;
41
42 private:
43 QRectF grooveRect( const QskSwitchButton*, const QRectF& ) const;
44 QRectF handleRect( const QskSwitchButton*, const QRectF& ) const;
45 QRectF iconRect( const QskSwitchButton*, const QRectF& ) const;
46};
47
48#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