summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-07-23 15:09:41 -0500
committerColin Noga <Tempus@chronometry.ca>2012-07-23 15:09:41 -0500
commit0e63ef0b2e2f062e5214f841239c3a483d45562a (patch)
tree513b2c779badbe917bb7f868bda2a016ad0e965d
parentf630d7b9258539e4a6453f7f05d95bc360f82e0a (diff)
downloadkoopatlas-0e63ef0b2e2f062e5214f841239c3a483d45562a.tar.gz
koopatlas-0e63ef0b2e2f062e5214f841239c3a483d45562a.zip
Ctrl cliking a layer on a list selects all objects on that layer. Object selection is also green now, for improved visibility
-rw-r--r--src/editorui/editormain.py2
-rw-r--r--src/editorui/objects.py2
-rw-r--r--src/ui.py27
3 files changed, 28 insertions, 3 deletions
diff --git a/src/editorui/editormain.py b/src/editorui/editormain.py
index c3d2aea..1ff08ee 100644
--- a/src/editorui/editormain.py
+++ b/src/editorui/editormain.py
@@ -746,7 +746,7 @@ class KPEditorWidget(QtGui.QGraphicsView):
self._tryToPaint(event)
event.accept()
- elif event.modifiers() == Qt.ControlModifier:
+ elif event.modifiers() & Qt.ControlModifier:
if isinstance(self.scene().currentLayer, KPPathLayer):
QtGui.QGraphicsView.mousePressEvent(self, event)
return
diff --git a/src/editorui/objects.py b/src/editorui/objects.py
index 872e289..af5c664 100644
--- a/src/editorui/objects.py
+++ b/src/editorui/objects.py
@@ -18,7 +18,7 @@ class KPEditorObject(KPEditorItem):
self.resizing = None
if not hasattr(KPEditorObject, 'SELECTION_PEN'):
- KPEditorObject.SELECTION_PEN = QtGui.QPen(Qt.white, 1, Qt.DotLine)
+ KPEditorObject.SELECTION_PEN = QtGui.QPen(Qt.green, 1, Qt.DotLine)
# I don't bother setting the ZValue because it doesn't quite matter:
# only one layer's objects are ever clickable, and drawBackground takes
diff --git a/src/ui.py b/src/ui.py
index 39c438a..766a6f1 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -120,7 +120,6 @@ class KPPathNodeList(QtGui.QWidget):
@QtCore.pyqtSlot(KPPathNodeItem, KPPathNodeItem)
def handleRowChanged(self, currentItem, previousItem):
- print currentItem, previousItem
try:
self.selectedLayerChanged.emit(currentItem.layer)
previousItem.associate.qtItem.setLayerSelected(False)
@@ -128,6 +127,18 @@ class KPPathNodeList(QtGui.QWidget):
except:
pass
+ if KP.app.keyboardModifiers() & Qt.ControlModifier:
+ layer = currentItem.layer
+
+ KP.mainWindow.scene.clearSelection()
+ listToUse = layer.objects + layer.doodads
+
+ for obj in listToUse:
+ item = obj.qtItem
+ if item:
+ item.setSelected(True)
+
+
@QtCore.pyqtSlot(KPPathNodeItem, KPPathNodeItem)
def jumpToPathNode(self, item):
try:
@@ -323,6 +334,20 @@ class KPLayerList(QtGui.QWidget):
self.selectedLayerChanged.emit(KP.map.layers[current.row()])
self.setButtonStates()
+ if KP.app.keyboardModifiers() & Qt.ControlModifier:
+ index = self.selectedLayerIndex()
+ layer = KP.map.layers[index]
+
+ if (index != -1) and (len(KP.map.layers) > 1) and (not isinstance(layer, KPPathLayer)):
+
+ KP.mainWindow.scene.clearSelection()
+ listToUse = layer.objects
+
+ for obj in listToUse:
+ item = obj.qtItem
+ if item:
+ item.setSelected(True)
+
def addTileLayer(self):
from dialogs import KPTilesetChooserDialog