qskinny/src/controls/QskScrollViewSkinlet.h

58 lines
1.6 KiB
C
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
2023-04-06 09:23:37 +02:00
* SPDX-License-Identifier: BSD-3-Clause
2017-07-21 18:21:34 +02:00
*****************************************************************************/
#ifndef QSK_SCROLL_VIEW_SKINLET_H
#define QSK_SCROLL_VIEW_SKINLET_H
#include "QskSkinlet.h"
class QskScrollView;
class QSK_EXPORT QskScrollViewSkinlet : public QskSkinlet
{
Q_GADGET
using Inherited = QskSkinlet;
2018-08-03 08:15:28 +02:00
public:
2017-07-21 18:21:34 +02:00
enum NodeRole
{
2022-07-12 14:21:50 +02:00
PanelRole,
2017-07-21 18:21:34 +02:00
ViewportRole,
ContentsRootRole,
HorizontalScrollBarRole,
HorizontalScrollHandleRole,
VerticalScrollBarRole,
2021-12-22 15:07:51 +01:00
VerticalScrollHandleRole,
RoleCount
2017-07-21 18:21:34 +02:00
};
Q_INVOKABLE QskScrollViewSkinlet( QskSkin* = nullptr );
2018-07-31 17:32:25 +02:00
~QskScrollViewSkinlet() override;
2017-07-21 18:21:34 +02:00
2018-08-03 08:15:28 +02:00
QRectF subControlRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol ) const override;
2017-07-21 18:21:34 +02:00
2018-08-03 08:15:28 +02:00
protected:
2018-07-31 17:32:25 +02:00
QSGNode* updateSubNode( const QskSkinnable*,
2017-07-21 18:21:34 +02:00
quint8 nodeRole, QSGNode* ) const override;
virtual QSGNode* updateContentsNode( const QskScrollView*, QSGNode* ) const;
2018-08-03 08:15:28 +02:00
private:
2017-07-21 18:21:34 +02:00
QSGNode* updateContentsRootNode( const QskScrollView*, QSGNode* ) const;
2023-07-20 10:41:49 +02:00
QSGNode* updateScrollBarNode(
const QskScrollView*, QskAspect::Subcontrol, QSGNode* ) const;
2017-07-21 18:21:34 +02:00
QRectF viewportRect( const QskScrollView*, const QRectF& ) const;
QRectF scrollBarRect( const QskScrollView*, const QRectF&, Qt::Orientation ) const;
QRectF scrollHandleRect( const QskScrollView*, const QRectF&, Qt::Orientation ) const;
2017-07-21 18:21:34 +02:00
};
#endif