diff --git a/src/controls/QskComboBox.cpp b/src/controls/QskComboBox.cpp index 4bc501ec..ec66ca0d 100644 --- a/src/controls/QskComboBox.cpp +++ b/src/controls/QskComboBox.cpp @@ -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 ) diff --git a/src/controls/QskComboBox.h b/src/controls/QskComboBox.h index e86af870..9e0d4cae 100644 --- a/src/controls/QskComboBox.h +++ b/src/controls/QskComboBox.h @@ -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 ); diff --git a/src/controls/QskComboBoxSkinlet.cpp b/src/controls/QskComboBoxSkinlet.cpp index 87e160d8..68ca24a7 100644 --- a/src/controls/QskComboBoxSkinlet.cpp +++ b/src/controls/QskComboBoxSkinlet.cpp @@ -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 { diff --git a/src/controls/QskComboBoxSkinlet.h b/src/controls/QskComboBoxSkinlet.h index 5b21d50a..e2e77526 100644 --- a/src/controls/QskComboBoxSkinlet.h +++ b/src/controls/QskComboBoxSkinlet.h @@ -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