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