QskSlider: Hardcode minimum handle strut size (for now)

... so that it is easier to use with the finger

Resolves #391
This commit is contained in:
Peter Hartmann 2024-05-29 16:51:30 +02:00
parent f04dedd30a
commit b82097fdb4
1 changed files with 9 additions and 1 deletions

View File

@ -121,7 +121,15 @@ QSizeF QskSlider::handleSize() const
QRectF QskSlider::handleRect() const QRectF QskSlider::handleRect() const
{ {
return subControlRect( QskSlider::Handle ); auto rect = subControlRect( Handle );
#if 1 // minimum handle strut size hardcoded here for now
const QSizeF strutSize( 60, 60 );
const auto w = qMax( ( strutSize.width() - rect.width() ) / 2, 0.0 );
const auto h = qMax( ( strutSize.height() - rect.height() ) / 2, 0.0 );
#endif
return rect.marginsAdded( { w, h, w, h } );
} }
void QskSlider::mousePressEvent( QMouseEvent* event ) void QskSlider::mousePressEvent( QMouseEvent* event )