qskinny/src/controls/QskSpinBoxSkinlet.h

51 lines
1.2 KiB
C
Raw Normal View History

2023-02-17 11:01:56 +00:00
/******************************************************************************
2023-02-17 13:05:05 +00:00
* QSkinny - Copyright (C) 2016 Uwe Rathmann
2023-04-06 07:23:37 +00:00
* SPDX-License-Identifier: BSD-3-Clause
2023-02-17 11:01:56 +00:00
*****************************************************************************/
2023-02-17 13:05:05 +00:00
#ifndef QSK_SPIN_BOX_SKINLET_H
#define QSK_SPIN_BOX_SKINLET_H
2023-02-17 11:01:56 +00:00
#include <QskSkinlet.h>
class QSK_EXPORT QskSpinBoxSkinlet : public QskSkinlet
{
2023-02-17 14:22:40 +00:00
Q_GADGET
using Inherited = QskSkinlet;
public:
2023-02-17 16:46:52 +00:00
Q_INVOKABLE QskSpinBoxSkinlet( QskSkin* = nullptr );
2023-02-17 14:22:40 +00:00
enum NodeRole
{
TextPanel,
Text,
UpPanel,
2023-02-23 13:37:49 +00:00
UpIndicator,
DownPanel,
DownIndicator,
RoleCount
2023-02-17 14:22:40 +00:00
};
QRectF subControlRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol ) const override;
QSizeF sizeHint( const QskSkinnable* skinnable,
Qt::SizeHint, const QSizeF& ) const override;
protected:
2023-02-17 16:46:52 +00:00
QSGNode* updateSubNode(
const QskSkinnable* skinnable, quint8 role, QSGNode* node ) const override;
2023-02-27 08:56:41 +00:00
private:
QRectF textPanelRect( const QskSkinnable*, const QRectF& ) const;
QRectF buttonRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol ) const;
2023-02-17 11:01:56 +00:00
};
2023-02-17 13:05:05 +00:00
#endif