QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskScrollViewSkinlet.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SCROLL_VIEW_SKINLET_H
7#define QSK_SCROLL_VIEW_SKINLET_H
8
9#include "QskSkinlet.h"
10
11class QskScrollView;
12
13class QSK_EXPORT QskScrollViewSkinlet : public QskSkinlet
14{
15 Q_GADGET
16
17 using Inherited = QskSkinlet;
18
19 public:
20 enum NodeRole
21 {
22 PanelRole,
23 ViewportRole,
24 ContentsRootRole,
25
26 HorizontalScrollBarRole,
27 HorizontalScrollHandleRole,
28
29 VerticalScrollBarRole,
30 VerticalScrollHandleRole,
31
32 RoleCount
33 };
34
35 Q_INVOKABLE QskScrollViewSkinlet( QskSkin* = nullptr );
36 ~QskScrollViewSkinlet() override;
37
38 QRectF subControlRect( const QskSkinnable*,
39 const QRectF&, QskAspect::Subcontrol ) const override;
40
41 protected:
42 QSGNode* updateSubNode( const QskSkinnable*,
43 quint8 nodeRole, QSGNode* ) const override;
44
45 virtual QSGNode* updateContentsNode( const QskScrollView*, QSGNode* ) const;
46
47 private:
48 QSGNode* updateContentsRootNode( const QskScrollView*, QSGNode* ) const;
49 QSGNode* updateScrollBarNode(
50 const QskScrollView*, QskAspect::Subcontrol, QSGNode* ) const;
51
52 QRectF viewportRect( const QskScrollView*, const QRectF& ) const;
53 QRectF scrollBarRect( const QskScrollView*, const QRectF&, Qt::Orientation ) const;
54 QRectF scrollHandleRect( const QskScrollView*, const QRectF&, Qt::Orientation ) const;
55};
56
57#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