effects/overview: Move Escape key handling to ScreenView

With this, no individual component has to handle the Escape key to
deactivate the effect.
This commit is contained in:
Vlad Zahorodnii 2021-11-12 08:01:35 +02:00
parent 25b035e84c
commit ca4e643d67
3 changed files with 3 additions and 4 deletions

View file

@ -201,6 +201,7 @@ Item {
id: editor
anchors.fill: parent
visible: label.state == "editing"
focus: visible
topPadding: 0
bottomPadding: 0
text: delegate.desktop.name
@ -226,7 +227,6 @@ Item {
}
function stopEditing() {
state = "normal";
searchField.forceActiveFocus();
}
}

View file

@ -27,6 +27,8 @@ FocusScope {
container.organized = false;
}
Keys.onEscapePressed: effect.deactivate();
Repeater {
model: KWinComponents.ClientFilterModel {
activity: KWinComponents.Workspace.currentActivity

View file

@ -428,9 +428,6 @@ FocusScope {
Keys.onPressed: {
switch (event.key) {
case Qt.Key_Escape:
effect.deactivate();
break;
case Qt.Key_Up:
selectNextItem(WindowHeap.Direction.Up);
break;