Skip to content

Commit 31d9d5b

Browse files
Optimization
1 parent 373f78c commit 31d9d5b

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/GUI/ActionHotkeyWidget.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ActionHotkeyWidget::ActionHotkeyWidget(const QString& actionName,
1717
, timerMseconds{1300}
1818
{
1919
// Object name for css
20-
btnHotkey.setObjectName("btnHotkey");
20+
btnHotkey.setObjectName(nameof(btnHotkey));
2121
btnHotkey.setProperty("unique", false);
2222
btnHotkey.setMinimumSize(ImageManager::DecodeMissingWebpIcon().size().width() + 15, // Checked for letter W
2323
ImageManager::DecodeMissingWebpIcon().size().height());
@@ -42,15 +42,12 @@ ActionHotkeyWidget::ActionHotkeyWidget(const QString& actionName,
4242
}
4343

4444
QString ActionHotkeyWidget::GetActionName() const { return actionNameLabel.text(); }
45-
4645
QString ActionHotkeyWidget::GetHotkey() const { return btnHotkey.text(); }
4746

4847
void ActionHotkeyWidget::HighlightKey(bool isKeysMoreThanTwo)
4948
{
50-
if (isKeysMoreThanTwo)
51-
btnHotkey.setProperty("unique", false);
52-
else
53-
btnHotkey.setProperty("unique", true);
49+
// If more than 2 == not unique
50+
btnHotkey.setProperty("unique", !isKeysMoreThanTwo);
5451

5552
btnHotkey.style()->unpolish(&btnHotkey);
5653
btnHotkey.style()->polish(&btnHotkey);

src/GUI/Translations/ru.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
<translation type="vanished">Нажмите латинскую клавишу...</translation>
2121
</message>
2222
<message>
23-
<location filename="../ActionHotkeyWidget.cpp" line="85"/>
23+
<location filename="../ActionHotkeyWidget.cpp" line="82"/>
2424
<source>It isn&apos;t character key!</source>
2525
<translation>Эта клавиша не буква!</translation>
2626
</message>
2727
<message>
28-
<location filename="../ActionHotkeyWidget.cpp" line="87"/>
28+
<location filename="../ActionHotkeyWidget.cpp" line="84"/>
2929
<source>This key isn&apos;t allowed!</source>
3030
<translation>Эта клавиша не разрешена!</translation>
3131
</message>
3232
<message>
33-
<location filename="../ActionHotkeyWidget.cpp" line="125"/>
33+
<location filename="../ActionHotkeyWidget.cpp" line="122"/>
3434
<source>Press the key...</source>
3535
<translation>Нажмите клавишу...</translation>
3636
</message>

0 commit comments

Comments
 (0)