Skip to content

Commit

Permalink
Revert "Re-enabled Space for toggling layer visibility"
Browse files Browse the repository at this point in the history
This reverts commit 0de0f20.

This shortcut was only provided for backwards compatibility, but it
often conflicts with using Space for panning the map view and since
359dcb9 there are global shortcuts
available for toggling layer visility and locked status, making this
shortcut no longer necessary.

See issue mapeditor#3672.
  • Loading branch information
bjorn committed Apr 25, 2023
1 parent e4c36b9 commit 01d9a94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### [Unreleased]

* Removed Space and Ctrl+Space shortcuts from Layers view to avoid conflict with panning (#3672)

### Tiled 1.10.1 (4 April 2023)

* Make panning with Space require pressing a mouse button as well (#3626)
Expand Down
14 changes: 0 additions & 14 deletions src/tiled/layerdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "layerdock.h"

#include "actionmanager.h"
#include "changelayer.h"
#include "layer.h"
#include "layermodel.h"
#include "map.h"
Expand Down Expand Up @@ -478,8 +477,6 @@ void LayerView::contextMenuEvent(QContextMenuEvent *event)

void LayerView::keyPressEvent(QKeyEvent *event)
{
Layer *layer = mMapDocument ? mMapDocument->currentLayer() : nullptr;

switch (event->key()) {
case Qt::Key_Delete:
case Qt::Key_Backspace:
Expand All @@ -488,17 +485,6 @@ void LayerView::keyPressEvent(QKeyEvent *event)
return;
}
break;
case Qt::Key_Space:
if (layer) {
QUndoCommand *command = nullptr;
if (event->modifiers() & Qt::ControlModifier)
command = new SetLayerLocked(mMapDocument, { layer }, !layer->isLocked());
else
command = new SetLayerVisible(mMapDocument, { layer }, !layer->isVisible());
mMapDocument->undoStack()->push(command);
return;
}
break;
}

QTreeView::keyPressEvent(event);
Expand Down

0 comments on commit 01d9a94

Please sign in to comment.