QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskDrawerSkinlet.cpp
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#include "QskDrawerSkinlet.h"
7#include "QskDrawer.h"
8
9QskDrawerSkinlet::QskDrawerSkinlet( QskSkin* skin )
10 : Inherited( skin )
11{
12 appendNodeRoles( { PanelRole } );
13}
14
15QskDrawerSkinlet::~QskDrawerSkinlet() = default;
16
17QRectF QskDrawerSkinlet::subControlRect(
18 const QskSkinnable* skinnable, const QRectF& contentsRect,
19 QskAspect::Subcontrol subControl ) const
20{
21 if ( subControl == QskDrawer::Panel )
22 return contentsRect;
23
24 return Inherited::subControlRect( skinnable, contentsRect, subControl );
25}
26
27QSGNode* QskDrawerSkinlet::updateSubNode(
28 const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
29{
30 if ( nodeRole == PanelRole )
31 return updateBoxNode( skinnable, node, QskDrawer::Panel );
32
33 return Inherited::updateSubNode( skinnable, nodeRole, node );
34}
35
36QSizeF QskDrawerSkinlet::sizeHint( const QskSkinnable* skinnable,
37 Qt::SizeHint which, const QSizeF& constraint ) const
38{
39 if ( which == Qt::PreferredSize )
40 return skinnable->strutSizeHint( QskDrawer::Panel );
41
42 return Inherited::sizeHint( skinnable, which, constraint );
43}
44
45#include "moc_QskDrawerSkinlet.cpp"
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104
QSizeF strutSizeHint(QskAspect, QskSkinHintStatus *=nullptr) const
Retrieves a strut size hint.