Skip to content

Commit 34f147b

Browse files
committed
Move remove layer/group to legend dock. Remove from toolbar
1 parent 17767ba commit 34f147b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/app/qgisapp.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ void QgisApp::createToolBars()
16511651
case 1: defNewLayerAction = mActionNewVectorLayer; break;
16521652
}
16531653
bt->setDefaultAction( defNewLayerAction );
1654-
QAction* newLayerAction = mLayerToolBar->insertWidget( mActionRemoveLayer, bt );
1654+
QAction* newLayerAction = mLayerToolBar->insertWidget( mActionAddDelimitedText, bt );
16551655
newLayerAction->setObjectName( "ActionNewLayer" );
16561656
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
16571657

@@ -2344,12 +2344,17 @@ void QgisApp::initLayerTreeView()
23442344
btnCollapseAll->setToolTip( tr( "Collapse All" ) );
23452345
connect( btnCollapseAll, SIGNAL( clicked() ), mLayerTreeView, SLOT( collapseAll() ) );
23462346

2347+
QToolButton* btnRemoveItem = new QToolButton;
2348+
btnRemoveItem->setDefaultAction( this->mActionRemoveLayer );
2349+
btnRemoveItem->setAutoRaise( true );
2350+
23472351
QHBoxLayout* toolbarLayout = new QHBoxLayout;
23482352
toolbarLayout->setContentsMargins( QMargins( 5, 0, 5, 0 ) );
23492353
toolbarLayout->addWidget( btnAddGroup );
23502354
toolbarLayout->addWidget( btnVisibilityGroups );
23512355
toolbarLayout->addWidget( btnExpandAll );
23522356
toolbarLayout->addWidget( btnCollapseAll );
2357+
toolbarLayout->addWidget( btnRemoveItem );
23532358
toolbarLayout->addStretch();
23542359

23552360
QVBoxLayout* vboxLayout = new QVBoxLayout;
@@ -8768,7 +8773,6 @@ void QgisApp::legendLayerSelectionChanged( void )
87688773
{
87698774
QList<QgsLayerTreeLayer*> selectedLayers = mLayerTreeView ? mLayerTreeView->selectedLayerNodes() : QList<QgsLayerTreeLayer*>();
87708775

8771-
mActionRemoveLayer->setEnabled( selectedLayers.count() > 0 );
87728776
mActionDuplicateLayer->setEnabled( selectedLayers.count() > 0 );
87738777
mActionSetLayerScaleVisibility->setEnabled( selectedLayers.count() > 0 );
87748778
mActionSetLayerCRS->setEnabled( selectedLayers.count() > 0 );

src/ui/qgisapp.ui

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<x>0</x>
1818
<y>0</y>
1919
<width>1050</width>
20-
<height>18</height>
20+
<height>20</height>
2121
</rect>
2222
</property>
2323
<widget class="QMenu" name="mProjectMenu">
@@ -320,7 +320,6 @@
320320
<addaction name="mActionAddWcsLayer"/>
321321
<addaction name="mActionAddWfsLayer"/>
322322
<addaction name="mActionAddDelimitedText"/>
323-
<addaction name="mActionRemoveLayer"/>
324323
</widget>
325324
<widget class="QToolBar" name="mDigitizeToolBar">
326325
<property name="windowTitle">
@@ -1322,7 +1321,10 @@
13221321
<normaloff>:/images/themes/default/mActionRemoveLayer.svg</normaloff>:/images/themes/default/mActionRemoveLayer.svg</iconset>
13231322
</property>
13241323
<property name="text">
1325-
<string>Remove Layer(s)</string>
1324+
<string>Remove Layer/Group</string>
1325+
</property>
1326+
<property name="toolTip">
1327+
<string>Remove Layer/Group</string>
13261328
</property>
13271329
<property name="shortcut">
13281330
<string>Ctrl+D</string>

0 commit comments

Comments
 (0)