Unused splash subcontrol/node removed. As the code was simply copied from the

push button we can restore it easily once we have a sitution, where a
splash feedback is required
This commit is contained in:
Uwe Rathmann 2023-03-06 17:00:44 +01:00
parent 4f24a74057
commit afe3248a8b
4 changed files with 2 additions and 61 deletions

View File

@ -16,7 +16,6 @@ QSK_SUBCONTROL( QskComboBox, Panel )
QSK_SUBCONTROL( QskComboBox, Graphic )
QSK_SUBCONTROL( QskComboBox, Text )
QSK_SUBCONTROL( QskComboBox, PopupIndicator )
QSK_SUBCONTROL( QskComboBox, Splash )
QSK_SYSTEM_STATE( QskComboBox, PopupOpen, QskAspect::FirstSystemState << 1 )

View File

@ -27,7 +27,7 @@ class QSK_EXPORT QskComboBox : public QskControl
using Inherited = QskControl;
public:
QSK_SUBCONTROLS( Panel, Graphic, Text, PopupIndicator, Splash )
QSK_SUBCONTROLS( Panel, Graphic, Text, PopupIndicator )
QSK_STATES( PopupOpen )
QskComboBox( QQuickItem* parent = nullptr );

View File

@ -66,8 +66,7 @@ namespace
QskComboBoxSkinlet::QskComboBoxSkinlet( QskSkin* skin )
: Inherited( skin )
{
setNodeRoles( { PanelRole, SplashRole,
GraphicRole, TextRole, PopupIndicatorRole } );
setNodeRoles( { PanelRole, GraphicRole, TextRole, PopupIndicatorRole } );
}
QskComboBoxSkinlet::~QskComboBoxSkinlet() = default;
@ -82,9 +81,6 @@ QRectF QskComboBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
if ( subControl == Q::Panel )
return contentsRect;
if ( subControl == Q::Splash )
return splashRect( box, contentsRect );
if ( subControl == Q::Text || subControl == Q::Graphic )
{
const auto r = box->subControlContentsRect( contentsRect, Q::Panel );
@ -131,28 +127,6 @@ QSGNode* QskComboBoxSkinlet::updateSubNode(
return Inherited::updateSubNode( skinnable, nodeRole, node );
}
QRectF QskComboBoxSkinlet::splashRect(
const QskComboBox* box, const QRectF& contentsRect ) const
{
using Q = QskComboBox;
QRectF rect;
const auto ratio = box->metric( Q::Splash | QskAspect::Size );
if ( ratio > 0.0 )
{
rect = subControlRect( box, contentsRect, Q::Panel );
const auto pos = box->positionHint( Q::Splash );
const qreal w = 2.0 * rect.width() * ratio;
rect.setX( pos - 0.5 * w );
rect.setWidth( w );
}
return rect;
}
QSGNode* QskComboBoxSkinlet::updateTextNode(
const QskComboBox* box, QSGNode* node ) const
{
@ -170,34 +144,6 @@ QSGNode* QskComboBoxSkinlet::updateTextNode(
alignment, box->currentText(), Q::Text );
}
QSGNode* QskComboBoxSkinlet::updateSplashNode(
const QskComboBox* box, QSGNode* node ) const
{
using Q = QskComboBox;
const auto splashRect = box->subControlRect( Q::Splash );
if ( splashRect.isEmpty() )
return nullptr;
auto clipNode = updateBoxClipNode( box, node,
box->subControlRect( Q::Panel ), Q::Panel );
if ( clipNode )
{
auto boxNode = QskSGNode::findChildNode( clipNode, SplashRole );
boxNode = updateBoxNode( box, boxNode, splashRect, Q::Splash );
if ( boxNode == nullptr )
return nullptr;
QskSGNode::setNodeRole( boxNode, SplashRole );
if ( boxNode->parent() != clipNode )
clipNode->appendChildNode( boxNode );
}
return clipNode;
}
QSizeF QskComboBoxSkinlet::sizeHint( const QskSkinnable* skinnable,
Qt::SizeHint which, const QSizeF& ) const
{

View File

@ -23,7 +23,6 @@ class QSK_EXPORT QskComboBoxSkinlet : public QskSkinlet
GraphicRole,
TextRole,
PopupIndicatorRole,
SplashRole,
RoleCount
};
@ -42,10 +41,7 @@ class QSK_EXPORT QskComboBoxSkinlet : public QskSkinlet
quint8 nodeRole, QSGNode* ) const override;
private:
QRectF splashRect( const QskComboBox*, const QRectF& ) const;
QSGNode* updateTextNode( const QskComboBox*, QSGNode* ) const;
QSGNode* updateSplashNode( const QskComboBox*, QSGNode* ) const;
};
#endif