Fluent2 scrollbar updates
This commit is contained in:
parent
c40457fbea
commit
4e2a069c14
|
@ -1102,11 +1102,31 @@ void Editor::setupScrollViewMetrics()
|
||||||
using Q = QskScrollView;
|
using Q = QskScrollView;
|
||||||
|
|
||||||
for ( auto subControl : { Q::HorizontalScrollBar, Q::VerticalScrollBar } )
|
for ( auto subControl : { Q::HorizontalScrollBar, Q::VerticalScrollBar } )
|
||||||
setMetric( subControl | A::Size, 2 );
|
{
|
||||||
|
const auto aspect = subControl | A::Size;
|
||||||
|
|
||||||
|
setMetric( aspect, 2 );
|
||||||
|
setMetric( aspect | Q::Hovered, 6 );
|
||||||
|
setMetric( aspect | Q::Pressed, 6 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
The scroll bars are actually above the viewport, what is not
|
||||||
|
supported by the skinlet. Do we want to have this. TODO ...
|
||||||
|
*/
|
||||||
|
|
||||||
|
setAlignment( Q::VerticalScrollBar, Qt::AlignHCenter );
|
||||||
|
setAlignment( Q::HorizontalScrollBar, Qt::AlignVCenter );
|
||||||
|
|
||||||
|
setBoxShape( Q::HorizontalScrollHandle, 100, Qt::RelativeSize );
|
||||||
|
setBoxShape( Q::VerticalScrollHandle, 100, Qt::RelativeSize );
|
||||||
|
|
||||||
const auto handleExtent = 40.0;
|
const auto handleExtent = 40.0;
|
||||||
setStrutSize( Q::HorizontalScrollHandle, handleExtent, 0.0 );
|
setStrutSize( Q::HorizontalScrollHandle, handleExtent, 0.0 );
|
||||||
setStrutSize( Q::VerticalScrollHandle, 0.0, handleExtent );
|
setStrutSize( Q::VerticalScrollHandle, 0.0, handleExtent );
|
||||||
|
|
||||||
|
for ( auto subControl : { Q::HorizontalScrollBar, Q::VerticalScrollBar } )
|
||||||
|
setAnimation( subControl | A::Metric, 100 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::setupScrollViewColors(
|
void Editor::setupScrollViewColors(
|
||||||
|
@ -1114,17 +1134,10 @@ void Editor::setupScrollViewColors(
|
||||||
{
|
{
|
||||||
using Q = QskScrollView;
|
using Q = QskScrollView;
|
||||||
|
|
||||||
const auto& pal = theme.palette;
|
const auto fillColor = theme.palette.fillColor.controlStrong.defaultColor;
|
||||||
|
|
||||||
#if 1
|
setGradient( Q::HorizontalScrollHandle | section, fillColor );
|
||||||
setGradient( Q::Panel, QColor() );
|
setGradient( Q::VerticalScrollHandle | section, fillColor );
|
||||||
setGradient( Q::Viewport, QColor() );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for ( auto subControl : { Q::HorizontalScrollHandle, Q::VerticalScrollHandle } )
|
|
||||||
{
|
|
||||||
setGradient( subControl | section, pal.fillColor.controlStrong.defaultColor );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::setupSegmentedBarMetrics()
|
void Editor::setupSegmentedBarMetrics()
|
||||||
|
|
|
@ -30,11 +30,12 @@ class QskScrollView::PrivateData
|
||||||
if ( isScrolling == scrolling )
|
if ( isScrolling == scrolling )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QskAspect::Subcontrol subControl;
|
Qt::Orientation orientation;
|
||||||
|
|
||||||
if ( ( isScrolling == Qt::Horizontal ) || ( scrolling == Qt::Horizontal ) )
|
if ( ( isScrolling == Qt::Horizontal ) || ( scrolling == Qt::Horizontal ) )
|
||||||
subControl = HorizontalScrollHandle;
|
orientation = Qt::Horizontal;
|
||||||
else
|
else
|
||||||
subControl = VerticalScrollHandle;
|
orientation = Qt::Vertical;
|
||||||
|
|
||||||
this->isScrolling = scrolling;
|
this->isScrolling = scrolling;
|
||||||
this->scrollPressPos = pos;
|
this->scrollPressPos = pos;
|
||||||
|
@ -47,7 +48,16 @@ class QskScrollView::PrivateData
|
||||||
if ( scrolling == 0 )
|
if ( scrolling == 0 )
|
||||||
qSwap( oldStates, newStates );
|
qSwap( oldStates, newStates );
|
||||||
|
|
||||||
scrollView->startHintTransitions( { subControl }, oldStates, newStates );
|
if ( orientation == Qt::Horizontal )
|
||||||
|
{
|
||||||
|
scrollView->startHintTransitions( { HorizontalScrollHandle }, oldStates, newStates );
|
||||||
|
scrollView->startHintTransitions( { HorizontalScrollBar }, oldStates, newStates );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scrollView->startHintTransitions( { VerticalScrollHandle }, oldStates, newStates );
|
||||||
|
scrollView->startHintTransitions( { VerticalScrollBar }, oldStates, newStates );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ScrollBarPolicy horizontalScrollBarPolicy = Qt::ScrollBarAsNeeded;
|
Qt::ScrollBarPolicy horizontalScrollBarPolicy = Qt::ScrollBarAsNeeded;
|
||||||
|
|
Loading…
Reference in New Issue