QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskMenuSkinlet.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_MENU_SKINLET_H
7#define QSK_MENU_SKINLET_H
8
9#include "QskPopupSkinlet.h"
10#include <memory>
11
12class QskMenu;
13
14class QSK_EXPORT QskMenuSkinlet : public QskPopupSkinlet
15{
16 Q_GADGET
17
19
20 public:
21 enum NodeRole
22 {
23 ContentsRole = Inherited::RoleCount,
24 PanelRole,
25
26 RoleCount
27 };
28
29 Q_INVOKABLE QskMenuSkinlet( QskSkin* = nullptr );
30 ~QskMenuSkinlet() override;
31
32 QRectF subControlRect( const QskSkinnable*,
33 const QRectF&, QskAspect::Subcontrol ) const override;
34
35 int sampleCount( const QskSkinnable*, QskAspect::Subcontrol ) const override;
36
37 QRectF sampleRect( const QskSkinnable*,
38 const QRectF&, QskAspect::Subcontrol, int index ) const override;
39
40 int sampleIndexAt( const QskSkinnable*,
41 const QRectF&, QskAspect::Subcontrol, const QPointF& ) const override;
42
43 QskAspect::States sampleStates( const QskSkinnable*,
44 QskAspect::Subcontrol, int index ) const override;
45
46 QVariant sampleAt( const QskSkinnable*,
47 QskAspect::Subcontrol, int index ) const override;
48
49 QSizeF sizeHint( const QskSkinnable*,
50 Qt::SizeHint, const QSizeF& ) const override;
51
52 protected:
53 QSGNode* updateSubNode( const QskSkinnable*,
54 quint8 nodeRole, QSGNode* ) const override;
55
56 QSGNode* updateContentsNode( const QskPopup*, QSGNode* ) const;
57 QSGNode* updateMenuNode( const QskSkinnable*, QSGNode* ) const;
58
59 QSGNode* updateSampleNode( const QskSkinnable*,
60 QskAspect::Subcontrol, int index, QSGNode* ) const override;
61
62 private:
63 QRectF cursorRect( const QskSkinnable*, const QRectF&, int index ) const;
64
65 class PrivateData;
66 std::unique_ptr< PrivateData > m_data;
67};
68
69#endif
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104