From e506a707673f7bc4ea064087d0c541a89c4526c4 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 30 Aug 2019 19:06:09 -0400 Subject: [PATCH] Fix random shortcuts getting triggered Caused the "window bounces when typing text" bug --- TODO.md | 1 - src/qml/Base/HShortcutHandler.qml | 9 ++++++--- src/qml/UI.qml | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index 52d847ce..da380e2e 100644 --- a/TODO.md +++ b/TODO.md @@ -13,7 +13,6 @@ - Fixes - make install - Make uvloop optional - - Icons on KDE - Distribute fonts - Backspace bug - Add missing shortcuts to config file diff --git a/src/qml/Base/HShortcutHandler.qml b/src/qml/Base/HShortcutHandler.qml index f285d644..0fb95987 100644 --- a/src/qml/Base/HShortcutHandler.qml +++ b/src/qml/Base/HShortcutHandler.qml @@ -43,12 +43,15 @@ Item { if (! shortcut.enabled) continue - if (typeof(shortcut.sequences) == "string" && - sequenceMatches(event, shortcut.sequences)) return shortcut + if (typeof(shortcut.sequences) == "string") { + return sequenceMatches(event, shortcut.sequences) ? + shortcut : null + } for (let i = 0; i < shortcut.sequences.length; i++) { - if (sequenceMatches(event, shortcut.sequences[i])) + if (sequenceMatches(event, shortcut.sequences[i])) { return shortcut + } } } return null diff --git a/src/qml/UI.qml b/src/qml/UI.qml index 9ff7411a..5595df8d 100644 --- a/src/qml/UI.qml +++ b/src/qml/UI.qml @@ -14,10 +14,10 @@ Rectangle { property alias shortcuts: shortcuts property alias sidePane: sidePane property alias pageLoader: pageLoader - property alias pressAnimation: _pressAnimation + property alias pressAnimation: pressAnimation SequentialAnimation { - id: _pressAnimation + id: pressAnimation HNumberAnimation { target: mainUI; property: "scale"; from: 1.0; to: 0.9 }