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.
This commit is contained in:
committed by
GitHub
parent
d2b38f962c
commit
e691e21bf9
@@ -210,7 +210,7 @@ bool KeySequence::check(const QVariant& val)
|
|||||||
|
|
||||||
QVariant KeySequence::fallback()
|
QVariant KeySequence::fallback()
|
||||||
{
|
{
|
||||||
return m_fallback;
|
return process(m_fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString KeySequence::expected()
|
QString KeySequence::expected()
|
||||||
@@ -233,6 +233,11 @@ QVariant KeySequence::process(const QVariant& val)
|
|||||||
if (str == "Enter") {
|
if (str == "Enter") {
|
||||||
return QKeySequence(Qt::Key_Return).toString();
|
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;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user