Skip to content

Commit 6e18210

Browse files
authored
Merge pull request #5657 from DelazJ/patch-2
[Bugfix] Snapping widget: Ensure layer column is fully visible
2 parents 163a1f9 + 62bd377 commit 6e18210

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/app/qgssnappingwidget.cpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,13 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
197197
QToolButton *topoButton = new QToolButton();
198198
topoButton->addAction( mTopologicalEditingAction );
199199
topoButton->setDefaultAction( mTopologicalEditingAction );
200-
if ( mDisplayMode == Widget )
201-
{
202-
topoButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
203-
}
200+
topoButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
204201
layout->addWidget( topoButton );
202+
205203
QToolButton *interButton = new QToolButton();
206204
interButton->addAction( mIntersectionSnappingAction );
207205
interButton->setDefaultAction( mIntersectionSnappingAction );
208-
if ( mDisplayMode == Widget )
209-
{
210-
interButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
211-
}
206+
interButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
212207
layout->addWidget( interButton );
213208

214209
layout->setContentsMargins( 0, 0, 0, 0 );
@@ -384,8 +379,8 @@ void QgsSnappingWidget::enableIntersectionSnapping( bool enabled )
384379

385380
void QgsSnappingWidget::onSnappingTreeLayersChanged()
386381
{
382+
mLayerTreeView->expandAll();
387383
mLayerTreeView->resizeColumnToContents( 0 );
388-
QTimer::singleShot( 0, mLayerTreeView, &QTreeView::expandAll );
389384
}
390385

391386
void QgsSnappingWidget::modeButtonTriggered( QAction *action )

0 commit comments

Comments
 (0)