qskinny/src/controls/QskRadioBoxSkinlet.h

65 lines
1.8 KiB
C
Raw Normal View History

2023-02-26 16:04:47 +00:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
2023-04-06 07:23:37 +00:00
* SPDX-License-Identifier: BSD-3-Clause
2023-02-26 16:04:47 +00:00
*****************************************************************************/
2023-02-08 20:49:04 +00:00
#ifndef QSK_RADIO_BOX_SKINLET_H
#define QSK_RADIO_BOX_SKINLET_H
#include "QskSkinlet.h"
class QskRadioBox;
class QSK_EXPORT QskRadioBoxSkinlet : public QskSkinlet
{
2023-02-25 22:31:29 +00:00
Q_GADGET
2023-02-08 20:49:04 +00:00
using Inherited = QskSkinlet;
2023-02-25 22:31:29 +00:00
public:
enum NodeRole
2023-02-08 20:49:04 +00:00
{
2023-02-25 22:31:29 +00:00
PanelRole,
ButtonRole,
CheckPanelRole,
CheckIndicatorRole,
2023-02-25 22:31:29 +00:00
TextRole,
RippleRole,
2023-02-08 20:49:04 +00:00
2023-02-25 22:31:29 +00:00
RoleCount
2023-02-08 20:49:04 +00:00
};
Q_INVOKABLE QskRadioBoxSkinlet( QskSkin* = nullptr );
~QskRadioBoxSkinlet() override;
QRectF subControlRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol ) const override;
QSizeF sizeHint( const QskSkinnable*,
Qt::SizeHint, const QSizeF& ) const override;
int sampleCount( const QskSkinnable*, QskAspect::Subcontrol ) const override;
QRectF sampleRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol, int index ) const override;
QskAspect::States sampleStates( const QskSkinnable*,
QskAspect::Subcontrol, int index ) const override;
2023-02-25 22:31:29 +00:00
2023-02-08 20:49:04 +00:00
protected:
QSGNode* updateSubNode( const QskSkinnable*,
quint8 nodeRole, QSGNode* ) const override;
QSGNode* updateSampleNode( const QskSkinnable*,
QskAspect::Subcontrol, int index, QSGNode* ) const override;
private:
2023-02-26 16:04:47 +00:00
QRectF textRect( const QskRadioBox*, const QRectF&, int ) const;
QRectF checkPanelRect( const QskRadioBox*, const QRectF&, int index ) const;
QRectF buttonRect( const QskRadioBox*, const QRectF&, int index ) const;
2023-02-26 16:04:47 +00:00
QRectF rippleRect( const QskRadioBox*, const QRectF& ) const;
2023-02-08 20:49:04 +00:00
};
#endif