layout issue fixed, update of the clipNode fixed
This commit is contained in:
parent
ed77fc54e1
commit
ef38b069e6
@ -271,6 +271,15 @@ namespace
|
|||||||
return static_cast< const QskScrollArea* >( parentItem() );
|
return static_cast< const QskScrollArea* >( parentItem() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void maybeUpdate()
|
||||||
|
{
|
||||||
|
if ( auto node = QQuickItemPrivate::get( this )->clipNode() )
|
||||||
|
{
|
||||||
|
if ( clipRect() != node->clipRect() )
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline void scrolledItemGeometryChange()
|
inline void scrolledItemGeometryChange()
|
||||||
{
|
{
|
||||||
if ( m_isSizeChangedEnabled )
|
if ( m_isSizeChangedEnabled )
|
||||||
@ -297,6 +306,10 @@ namespace
|
|||||||
{
|
{
|
||||||
setObjectName( QStringLiteral( "QskScrollAreaClipItem" ) );
|
setObjectName( QStringLiteral( "QskScrollAreaClipItem" ) );
|
||||||
setClip( true );
|
setClip( true );
|
||||||
|
|
||||||
|
// scrollbars might (dis)appear
|
||||||
|
connect( scrollArea, &QskScrollBox::scrollableSizeChanged,
|
||||||
|
this, &ClipItem::maybeUpdate );
|
||||||
}
|
}
|
||||||
|
|
||||||
ClipItem::~ClipItem()
|
ClipItem::~ClipItem()
|
||||||
@ -306,7 +319,7 @@ namespace
|
|||||||
|
|
||||||
void ClipItem::updateNode( QSGNode* )
|
void ClipItem::updateNode( QSGNode* )
|
||||||
{
|
{
|
||||||
auto* d = QQuickItemPrivate::get( this );
|
auto d = QQuickItemPrivate::get( this );
|
||||||
|
|
||||||
if ( QQuickItemPrivate::get( scrollArea() )->dirtyAttributes &
|
if ( QQuickItemPrivate::get( scrollArea() )->dirtyAttributes &
|
||||||
QQuickItemPrivate::ContentUpdateMask )
|
QQuickItemPrivate::ContentUpdateMask )
|
||||||
@ -501,10 +514,16 @@ QSizeF QskScrollArea::layoutSizeHint( Qt::SizeHint which, const QSizeF& constrai
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff )
|
if ( verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff )
|
||||||
|
{
|
||||||
hint.rwidth() += metric( VerticalScrollBar | QskAspect::Size );
|
hint.rwidth() += metric( VerticalScrollBar | QskAspect::Size );
|
||||||
|
hint.rwidth() += metric( Panel | QskAspect::Spacing );
|
||||||
|
}
|
||||||
|
|
||||||
if ( horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff )
|
if ( horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff )
|
||||||
|
{
|
||||||
hint.rheight() += metric( HorizontalScrollBar | QskAspect::Size );
|
hint.rheight() += metric( HorizontalScrollBar | QskAspect::Size );
|
||||||
|
hint.rheight() += metric( Panel | QskAspect::Spacing );
|
||||||
|
}
|
||||||
|
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user