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 24, 2023
1 parent e4c36b9 commit c6314af
Showing 1 changed file with 0 additions and 14 deletions.
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 c6314af

Please sign in to comment.