qskinny/src/controls/QskPopupSkinlet.cpp

41 lines
1.2 KiB
C++
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#include "QskPopupSkinlet.h"
#include "QskPopup.h"
QskPopupSkinlet::QskPopupSkinlet( QskSkin* skin ):
Inherited( skin )
{
appendNodeRoles( { OverlayRole } );
}
QskPopupSkinlet::~QskPopupSkinlet() = default;
QRectF QskPopupSkinlet::subControlRect(
const QskSkinnable* skinnable, QskAspect::Subcontrol subControl ) const
{
const auto popup = static_cast< const QskPopup* >( skinnable );
if ( subControl == QskPopup::Overlay )
return popup->overlayRect();
return Inherited::subControlRect( skinnable, subControl );
}
QSGNode* QskPopupSkinlet::updateSubNode( const QskSkinnable* skinnable,
quint8 nodeRole, QSGNode* node ) const
{
switch( nodeRole )
{
case OverlayRole:
return updateBoxNode( skinnable, node, QskPopup::Overlay );
2017-07-21 18:21:34 +02:00
}
2017-09-01 11:55:55 +02:00
return Inherited::updateSubNode( skinnable, nodeRole, node );
2017-07-21 18:21:34 +02:00
}
#include "moc_QskPopupSkinlet.cpp"