From e691e21bf9bd2d7367604e2ab2437d13124866b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Ortol=C3=A1=20Ankum?= Date: Wed, 5 Oct 2022 16:10:11 +0200 Subject: [PATCH] flameshot#2856: Display main key in keyboard shortcut as lower-case (#2934) The motivation behind this change is that single-key character key shortcuts, currently displayed with an uppercase letter, could suggest that the shortcut includes a Shift modifier. Making the key lowercase takes away this confusion. --- src/utils/valuehandler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/valuehandler.cpp b/src/utils/valuehandler.cpp index 3f1f9bc0..281e71ff 100644 --- a/src/utils/valuehandler.cpp +++ b/src/utils/valuehandler.cpp @@ -210,7 +210,7 @@ bool KeySequence::check(const QVariant& val) QVariant KeySequence::fallback() { - return m_fallback; + return process(m_fallback); } QString KeySequence::expected() @@ -233,6 +233,11 @@ QVariant KeySequence::process(const QVariant& val) if (str == "Enter") { return QKeySequence(Qt::Key_Return).toString(); } + if (str.length() > 0) { + // Make the "main" key in sequence (last one) lower-case. + const QCharRef& lastChar = str[str.length() - 1]; + str.replace(str.length() - 1, 1, lastChar.toLower()); + } return str; }