From 3e4ff9241ed4444f41e402a983c7f690ad89ca84 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 18 Jul 2016 15:38:57 +0200 Subject: [PATCH] Moved the BlurSettings signal to cura main window This reduces the number of focus changes from O(N) to O(1) by the blur event --- resources/qml/Cura.qml | 11 +++++++++++ resources/qml/Settings/SettingItem.qml | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 38019de8e2..604f8e0b92 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -506,6 +506,17 @@ UM.MainWindow onTriggered: preferences.getCurrentItem().showProfileNameDialog() } + // BlurSettings is a way to force the focus away from any of the setting items. + // We need to do this in order to keep the bindings intact. + Connections + { + target: Cura.MachineManager + onBlurSettings: + { + contentItem.focus = true + } + } + // Workaround for shortcuts not working for singletons. // The main window eats all the events, so we need to pass them manually. Action diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 69272764c9..a7bdabb3c5 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -248,14 +248,5 @@ Item { } } - Connections - { - target: Cura.MachineManager - onBlurSettings: - { - revertButton.focus = true - } - } - UM.I18nCatalog { id: catalog; name: "cura" } }