6#include "QskTabViewSkinlet.h"
11QskTabViewSkinlet::QskTabViewSkinlet(
QskSkin* skin )
14 setNodeRoles( { PageRole } );
17QskTabViewSkinlet::~QskTabViewSkinlet() =
default;
19QRectF QskTabViewSkinlet::subControlRect(
const QskSkinnable* skinnable,
22 const auto tabView =
static_cast< const QskTabView*
>( skinnable );
24 if ( subControl == QskTabView::Page )
26 return pageRect( tabView, contentsRect );
29 if ( subControl == QskTabView::TabBar )
31 return tabBarRect( tabView, contentsRect );
34 return Inherited::subControlRect( skinnable, contentsRect, subControl );
37QSGNode* QskTabViewSkinlet::updateSubNode(
38 const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node )
const
44 return updateBoxNode( skinnable, node, QskTabView::Page );
48 return Inherited::updateSubNode( skinnable, nodeRole, node );
51QRectF QskTabViewSkinlet::pageRect(
52 const QskTabView* tabView,
const QRectF& rect )
const
54 const auto barRect = subControlRect( tabView, rect, QskTabView::TabBar );
60 switch( tabView->tabBarEdge() )
63 r.setTop( barRect.bottom() );
67 r.setBottom( barRect.top() );
71 r.setLeft( barRect.right() );
75 r.setRight( barRect.left() );
82QRectF QskTabViewSkinlet::tabBarRect(
83 const QskTabView* tabView,
const QRectF& rect )
const
93 switch( tabView->tabBarEdge() )
96 r.setHeight( barSize.height() );
100 r.setTop( r.bottom() - barSize.height() );
104 r.setWidth( barSize.width() );
108 r.setLeft( r.right() - barSize.width() );
115#include "moc_QskTabViewSkinlet.cpp"
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
QRectF layoutRect() const