QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskFocusIndicatorSkinlet.cpp
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#include "QskFocusIndicatorSkinlet.h"
7#include "QskFocusIndicator.h"
8
9QskFocusIndicatorSkinlet::QskFocusIndicatorSkinlet( QskSkin* skin )
10 : Inherited( skin )
11{
12 setNodeRoles( { FrameRole } );
13}
14
15QskFocusIndicatorSkinlet::~QskFocusIndicatorSkinlet() = default;
16
17QRectF QskFocusIndicatorSkinlet::subControlRect( const QskSkinnable* skinnable,
18 const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
19{
20 if ( subControl == QskFocusIndicator::Panel )
21 {
22 return contentsRect;
23 }
24
25 return Inherited::subControlRect( skinnable, contentsRect, subControl );
26}
27
28QSGNode* QskFocusIndicatorSkinlet::updateSubNode(
29 const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
30{
31 const auto indicator = static_cast< const QskFocusIndicator* >( skinnable );
32
33 switch ( nodeRole )
34 {
35 case FrameRole:
36 {
37 return updateBoxNode( indicator, node, QskFocusIndicator::Panel );
38 }
39 }
40
41 return Inherited::updateSubNode( skinnable, nodeRole, node );
42}
43
44#include "moc_QskFocusIndicatorSkinlet.cpp"
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104