Skip to content

Commit 927089e

Browse files
committed
Select all and none
1 parent b5770d2 commit 927089e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

editor/inspector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ def __init__(self, parent, prop, orig):
9797
super(InspectorTextEdit, self).__init__(parent)
9898
self.prop = prop
9999
self.orig = orig
100-
self.editingFinished.connect(self.edit)
101100
self.modified = False
102101
self.value = ""
103102

104-
def edit(self):
105-
self.on_edit(self.text())
106-
103+
def keyPressEvent(self, event):
104+
if event.key() == Qt.Key_Escape:
105+
self.clearFocus()
106+
107107
def on_edit(self, text):
108108
if text != self.value:
109109
self.modified = True

editor/window.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ def set_icon(self, path):
4545
self.setWindowIcon(QIcon(os.path.join(directory, path)))
4646

4747
def select_none(self):
48-
if isinstance(self.app.focusWidget(), SceneEditor):
49-
print("select none")
48+
if not isinstance(self.app.focusWidget(), QLineEdit):
49+
self.app.hierarchy_content.tree_widget.clearSelection()
50+
51+
def mousePressEvent(self, event):
52+
focused = self.focusWidget()
53+
if isinstance(focused, QLineEdit):
54+
focused.clearFocus()
55+
super(Window, self).mousePressEvent(event)
5056

5157
class SceneButtons(QWidget):
5258
def __init__(self, window):

0 commit comments

Comments
 (0)