Skip to content

Commit 3735c7f

Browse files
committedNov 7, 2017
Small tweaks to selection behavior
1 parent 0665080 commit 3735c7f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

‎src/app/layout/qgslayoutdesignerdialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,11 @@ void QgsLayoutDesignerDialog::showItemOptions( QgsLayoutItem *item, bool bringPa
644644
}
645645

646646
std::unique_ptr< QgsLayoutItemBaseWidget > widget( QgsGui::layoutItemGuiRegistry()->createItemWidget( item ) );
647+
delete mItemPropertiesStack->takeMainPanel();
648+
647649
if ( ! widget )
648-
{
649650
return;
650-
}
651651

652-
delete mItemPropertiesStack->takeMainPanel();
653652
widget->setDockMode( true );
654653
connect( item, &QgsLayoutItem::destroyed, widget.get(), [this]
655654
{

‎src/gui/layout/qgslayoutviewtoolselect.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ void QgsLayoutViewToolSelect::layoutPressEvent( QgsLayoutViewMouseEvent *event )
112112
{
113113
emit itemFocused( selectedItems.at( 0 ) );
114114
}
115+
else
116+
{
117+
emit itemFocused( nullptr );
118+
}
115119
}
116120
else
117121
{
@@ -173,7 +177,7 @@ void QgsLayoutViewToolSelect::layoutReleaseEvent( QgsLayoutViewMouseEvent *event
173177
else
174178
{
175179
//not adding to or removing from selection, so clear current selection
176-
layout()->deselectAll();
180+
whileBlocking( layout() )->deselectAll();
177181
}
178182

179183
//determine item selection mode, default to intersection
@@ -221,6 +225,11 @@ void QgsLayoutViewToolSelect::layoutReleaseEvent( QgsLayoutViewMouseEvent *event
221225
{
222226
emit itemFocused( selectedItemList.at( 0 ) );
223227
}
228+
else
229+
{
230+
emit itemFocused( nullptr );
231+
}
232+
mMouseHandles->selectionChanged();
224233
}
225234

226235
void QgsLayoutViewToolSelect::wheelEvent( QWheelEvent *event )

0 commit comments

Comments
 (0)
Please sign in to comment.