Skip to content

Commit

Permalink
QskSlider: Add padding to handle rect
Browse files Browse the repository at this point in the history
... so that it is easier to use with the finger

Resolves #391
  • Loading branch information
peter-ha committed May 29, 2024
1 parent b198ed4 commit 8f1feb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions designsystems/material3/QskMaterial3Skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ void Editor::setupSlider()
setGradient( Q::Fill | Q::Disabled, m_pal.onSurface38 );

setBoxShape( Q::Handle, 100, Qt::RelativeSize );
setPadding(Q::Handle, 20 );
setBoxBorderMetrics( Q::Handle, 0 );

const QSizeF handleSize( 4_dp, 44_dp );
Expand Down
3 changes: 2 additions & 1 deletion src/controls/QskSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ QSizeF QskSlider::handleSize() const

QRectF QskSlider::handleRect() const
{
return subControlRect( QskSlider::Handle );
const auto padding = paddingHint( Handle);
return subControlRect( Handle ).marginsAdded( padding );
}

void QskSlider::mousePressEvent( QMouseEvent* event )
Expand Down

0 comments on commit 8f1feb2

Please sign in to comment.