From a426875daba0cb923435be835f0100fe13a6255a Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 9 Aug 2015 20:32:14 +0200 Subject: Return to normal mode after command evaluation Requires new `executed` signal in `CommandInput` component to correctly trigger the state change. --- qml/CommandInput.qml | 4 ++++ qml/StateHandler.qml | 4 ++++ qml/main.qml | 2 ++ 3 files changed, 10 insertions(+) diff --git a/qml/CommandInput.qml b/qml/CommandInput.qml index e7defbf..5010891 100644 --- a/qml/CommandInput.qml +++ b/qml/CommandInput.qml @@ -7,6 +7,8 @@ import "commands.js" as Commands Item { id: item + signal executed + visible: false Settings { @@ -62,6 +64,8 @@ Item { console.log('"' + prefix + '"' + " is not a command prefix"); } } + + item.executed(); } } } diff --git a/qml/StateHandler.qml b/qml/StateHandler.qml index 75c5d6b..04215df 100644 --- a/qml/StateHandler.qml +++ b/qml/StateHandler.qml @@ -30,6 +30,10 @@ Item { enterInsertAction.trigger(); } + function enterNormalMode() { + enterNormalAction.trigger(); + } + states: [ State { name: "NORMAL" diff --git a/qml/main.qml b/qml/main.qml index 3f3b5a9..c04e6dd 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -40,6 +40,8 @@ ApplicationWindow { Layout.fillWidth: true height: 20 + + onExecuted: state.enterNormalMode() } } -- cgit v1.2.3