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_LIST_VIEW_SKINLET_H
|
|
|
|
#define QSK_LIST_VIEW_SKINLET_H
|
|
|
|
|
|
|
|
#include "QskScrollViewSkinlet.h"
|
|
|
|
|
|
|
|
class QskListView;
|
|
|
|
|
|
|
|
class QMarginsF;
|
|
|
|
class QSizeF;
|
|
|
|
class QRectF;
|
|
|
|
class QSGTransformNode;
|
|
|
|
|
|
|
|
class QSK_EXPORT QskListViewSkinlet : public QskScrollViewSkinlet
|
|
|
|
{
|
|
|
|
Q_GADGET
|
|
|
|
|
|
|
|
using Inherited = QskScrollViewSkinlet;
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
public:
|
2022-04-20 13:50:14 +02:00
|
|
|
enum NodeRole
|
|
|
|
{
|
2023-10-15 15:43:29 +02:00
|
|
|
TextRole = Inherited::RoleCount,
|
2022-04-20 13:50:14 +02:00
|
|
|
GraphicRole,
|
|
|
|
|
|
|
|
RoleCount
|
|
|
|
};
|
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
Q_INVOKABLE QskListViewSkinlet( QskSkin* = nullptr );
|
2018-07-31 17:32:25 +02:00
|
|
|
~QskListViewSkinlet() override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2020-12-29 09:45:00 +01:00
|
|
|
QSizeF sizeHint( const QskSkinnable*,
|
|
|
|
Qt::SizeHint, const QSizeF& ) const override;
|
|
|
|
|
2023-07-18 16:18:36 +02:00
|
|
|
QRectF sampleRect( const QskSkinnable*,
|
|
|
|
const QRectF&, QskAspect::Subcontrol, int index ) const override;
|
|
|
|
|
2023-07-27 17:03:34 +02:00
|
|
|
QskAspect::States sampleStates( const QskSkinnable*,
|
|
|
|
QskAspect::Subcontrol, int index ) const override;
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
protected:
|
2018-07-31 17:32:25 +02:00
|
|
|
QSGNode* updateContentsNode(
|
2017-07-21 18:21:34 +02:00
|
|
|
const QskScrollView*, QSGNode* ) const override;
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
private:
|
2023-07-27 17:03:34 +02:00
|
|
|
void updateForegroundNodes( const QskListView*, QSGNode* ) const;
|
|
|
|
void updateBackgroundNodes( const QskListView*, QSGNode* ) const;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2017-07-30 14:30:50 +02:00
|
|
|
void updateVisibleForegroundNodes(
|
2023-07-27 17:03:34 +02:00
|
|
|
const QskListView*, QSGNode*,
|
|
|
|
int rowMin, int rowMax, const QMarginsF& margin ) const;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
QSGTransformNode* updateForegroundNode( const QskListView*,
|
|
|
|
QSGNode* parentNode, QSGTransformNode* cellNode,
|
2023-07-27 17:03:34 +02:00
|
|
|
int row, int col, const QSizeF& ) const;
|
|
|
|
|
|
|
|
QSGNode* updateCellNode( const QskListView*,
|
|
|
|
QSGNode*, const QRectF&, int row, int col ) const;
|
2017-07-21 18:21:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|