using the padding for expanding the scrollbars to avoid having an impact

on the viewport size
This commit is contained in:
Uwe Rathmann 2023-07-28 07:43:50 +02:00
parent 638ee038aa
commit a7aef1a8a0

View File

@ -26,13 +26,8 @@
- QskPageIndicator - QskPageIndicator
- QskScrollView
The extended mode of the scrollbar needs to be implemented
- QskListView - QskListView
- hover state is not implemented
- Indicator subcontrol might be better than using the border of the selection box - Indicator subcontrol might be better than using the border of the selection box
- cell padding unclear - cell padding unclear
@ -1103,11 +1098,19 @@ void Editor::setupScrollViewMetrics()
for ( auto subControl : { Q::HorizontalScrollBar, Q::VerticalScrollBar } ) for ( auto subControl : { Q::HorizontalScrollBar, Q::VerticalScrollBar } )
{ {
const auto aspect = subControl | A::Size; setMetric( subControl | A::Size, 6 );
setMetric( aspect, 2 ); // The scrollbar is expanding, when being hovered/pressed
setMetric( aspect | Q::Hovered, 6 );
setMetric( aspect | Q::Pressed, 6 ); const qreal padding = 4;
if ( subControl == Q::HorizontalScrollBar )
setPadding( Q::HorizontalScrollBar, 0, padding, 0, 0 );
else
setPadding( Q::VerticalScrollBar, padding, 0, 0, 0 );
setPadding( subControl | Q::Hovered, 0 );
setPadding( subControl | Q::Pressed, 0 );
setBoxShape( subControl, 100, Qt::RelativeSize ); setBoxShape( subControl, 100, Qt::RelativeSize );
setAnimation( subControl | A::Metric, 100 ); setAnimation( subControl | A::Metric, 100 );
@ -1118,9 +1121,6 @@ void Editor::setupScrollViewMetrics()
supported by the skinlet. Do we want to have this. TODO ... supported by the skinlet. Do we want to have this. TODO ...
*/ */
setAlignment( Q::VerticalScrollBar, Qt::AlignHCenter );
setAlignment( Q::HorizontalScrollBar, Qt::AlignVCenter );
// handles // handles
setBoxShape( Q::HorizontalScrollHandle, 100, Qt::RelativeSize ); setBoxShape( Q::HorizontalScrollHandle, 100, Qt::RelativeSize );