Skip to content

Commit

Permalink
flameshot#2856: Display main key in keyboard shortcut as lower-case (f…
Browse files Browse the repository at this point in the history
…lameshot-org#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.

(cherry picked from commit e691e21)
  • Loading branch information
Tomasito665 authored and Yuriy Puchkov committed Oct 24, 2022
1 parent 40523d7 commit 6b1cd8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/valuehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ bool KeySequence::check(const QVariant& val)

QVariant KeySequence::fallback()
{
return m_fallback;
return process(m_fallback);
}

QString KeySequence::expected()
Expand All @@ -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;
}

Expand Down

0 comments on commit 6b1cd8f

Please sign in to comment.