switch button: Fix size hint (#195)

This fixes a case where the Groove is bigger than the Handle, e.g.
with the Material 3 switch buttons.
This commit is contained in:
Peter Hartmann 2022-06-06 07:08:33 +02:00 committed by GitHub
parent e954fb8aa1
commit 167965e12c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,7 @@ QSizeF QskSwitchButtonSkinlet::sizeHint( const QskSkinnable* skinnable,
auto handleHint = skinnable->strutSizeHint( QskSwitchButton::Handle ); auto handleHint = skinnable->strutSizeHint( QskSwitchButton::Handle );
auto rippleHint = skinnable->strutSizeHint( QskSwitchButton::Ripple ); auto rippleHint = skinnable->strutSizeHint( QskSwitchButton::Ripple );
auto hint = grooveHint.expandedTo( grooveHint + rippleHint - handleHint ); auto hint = grooveHint;
hint = hint.expandedTo( rippleHint ); hint = hint.expandedTo( rippleHint );
hint = hint.expandedTo( handleHint ); hint = hint.expandedTo( handleHint );