qskinny/src/controls/QskSwitchButtonSkinlet.h

47 lines
1.2 KiB
C
Raw Normal View History

2021-08-02 17:17:04 +00:00
/******************************************************************************
2024-01-17 13:31:45 +00:00
* QSkinny - Copyright (C) The authors
2023-04-06 07:23:37 +00:00
* SPDX-License-Identifier: BSD-3-Clause
2021-08-02 17:17:04 +00:00
*****************************************************************************/
2021-08-02 11:22:37 +00:00
#ifndef QSK_SWITCH_BUTTON_SKINLET_H
#define QSK_SWITCH_BUTTON_SKINLET_H
#include "QskSkinlet.h"
class QSK_EXPORT QskSwitchButtonSkinlet : public QskSkinlet
{
Q_GADGET
using Inherited = QskSkinlet;
public:
enum NodeRole
{
2021-08-02 17:17:04 +00:00
GrooveRole,
2021-08-27 07:09:10 +00:00
HandleRole,
RippleRole,
RoleCount
2021-08-02 11:22:37 +00:00
};
Q_INVOKABLE QskSwitchButtonSkinlet( QskSkin* = nullptr );
2021-08-02 11:22:37 +00:00
~QskSwitchButtonSkinlet() override;
QRectF subControlRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol ) const override;
2021-08-02 11:22:37 +00:00
QSizeF sizeHint( const QskSkinnable*,
Qt::SizeHint, const QSizeF& ) const override;
protected:
QSGNode* updateSubNode( const QskSkinnable*,
quint8 nodeRole, QSGNode* ) const override;
private:
QRectF grooveRect( const QskSkinnable*, const QRectF& ) const;
QRectF handleRect( const QskSkinnable*, const QRectF& ) const;
2021-08-27 07:09:10 +00:00
QRectF rippleRect( const QskSkinnable*, const QRectF& ) const;
2021-08-02 11:22:37 +00:00
};
2021-08-02 17:17:04 +00:00
2021-08-02 11:22:37 +00:00
#endif