Skip to content

Commit

Permalink
Small tweaks to selection behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent 0665080 commit 3735c7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -644,12 +644,11 @@ void QgsLayoutDesignerDialog::showItemOptions( QgsLayoutItem *item, bool bringPa
}

std::unique_ptr< QgsLayoutItemBaseWidget > widget( QgsGui::layoutItemGuiRegistry()->createItemWidget( item ) );
delete mItemPropertiesStack->takeMainPanel();

if ( ! widget )
{
return;
}

delete mItemPropertiesStack->takeMainPanel();
widget->setDockMode( true );
connect( item, &QgsLayoutItem::destroyed, widget.get(), [this]
{
Expand Down
11 changes: 10 additions & 1 deletion src/gui/layout/qgslayoutviewtoolselect.cpp
Expand Up @@ -112,6 +112,10 @@ void QgsLayoutViewToolSelect::layoutPressEvent( QgsLayoutViewMouseEvent *event )
{
emit itemFocused( selectedItems.at( 0 ) );
}
else
{
emit itemFocused( nullptr );
}
}
else
{
Expand Down Expand Up @@ -173,7 +177,7 @@ void QgsLayoutViewToolSelect::layoutReleaseEvent( QgsLayoutViewMouseEvent *event
else
{
//not adding to or removing from selection, so clear current selection
layout()->deselectAll();
whileBlocking( layout() )->deselectAll();
}

//determine item selection mode, default to intersection
Expand Down Expand Up @@ -221,6 +225,11 @@ void QgsLayoutViewToolSelect::layoutReleaseEvent( QgsLayoutViewMouseEvent *event
{
emit itemFocused( selectedItemList.at( 0 ) );
}
else
{
emit itemFocused( nullptr );
}
mMouseHandles->selectionChanged();
}

void QgsLayoutViewToolSelect::wheelEvent( QWheelEvent *event )
Expand Down

0 comments on commit 3735c7f

Please sign in to comment.