QskPushButtonSkinlet::rippleRect simplified
This commit is contained in:
parent
55b2235d18
commit
cb6ec8437c
@ -193,22 +193,21 @@ QRectF QskPushButtonSkinlet::rippleRect(
|
||||
{
|
||||
using Q = QskPushButton;
|
||||
|
||||
const auto ratio = button->metric( Q::Ripple | QskAspect::Size );
|
||||
if ( ratio <= 0.0 )
|
||||
return QRectF();
|
||||
QRectF rect;
|
||||
|
||||
const auto ratio = button->metric( Q::Ripple | QskAspect::Size );
|
||||
if ( ratio > 0.0 )
|
||||
{
|
||||
const auto pos = button->effectiveSkinHint(
|
||||
Q::Ripple | QskAspect::Metric | QskAspect::Position ).toPointF();
|
||||
|
||||
const auto w = contentsRect.width() * ratio;
|
||||
const auto h = contentsRect.height() * ratio;
|
||||
const auto x = pos.x() - w;
|
||||
const auto y = pos.y() - h;
|
||||
const auto panelRect = subControlRect( button, contentsRect, Q::Panel );
|
||||
|
||||
const QRectF r( x, y, w * 2, h * 2 );
|
||||
rect.setSize( 2.0 * panelRect.size() * ratio );
|
||||
rect.moveCenter( pos );
|
||||
}
|
||||
|
||||
const auto clipRect = subControlRect( button, contentsRect, Q::Panel );
|
||||
return r.intersected( clipRect );
|
||||
return rect;
|
||||
}
|
||||
|
||||
QSGNode* QskPushButtonSkinlet::updateTextNode(
|
||||
|
Loading…
x
Reference in New Issue
Block a user