summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ui.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ui.py b/src/ui.py
index 0a126c3..2b89d39 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -49,15 +49,25 @@ class KPLayerList(QtGui.QWidget):
KP.map.appendLayer(KP.map.createNewLayer())
def removeLayer(self):
+ layer = self.selectedLayer()
+ scene = KP.mainWindow.scene
+
+ for obj in layer.objects:
+ item = obj.qtItem
+ if item:
+ scene.removeItem(item)
+
KP.map.removeLayer(self.selectedLayer())
def moveUp(self):
index = self.selectedLayerIndex()
KP.map.moveLayer(index, index - 1)
+ KP.mainWindow.editor.viewport().update()
def moveDown(self):
index = self.selectedLayerIndex()
KP.map.moveLayer(index, index + 2)
+ KP.mainWindow.editor.viewport().update()
@@ -256,7 +266,6 @@ class KPMainWindow(QtGui.QMainWindow):
@QtCore.pyqtSlot(int, KPTileObject)
def handleSelectedObjectChanged(self, index, obj):
- print("New obj: %d, %r" % (index, obj))
self.editor.paintNext = obj
self.editor.paintNextID = index