mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Reset and unregister global shortcut when it's not locked anymore.
This commit is contained in:
parent
fa51f7e10e
commit
d3af39a7ae
@ -56,6 +56,14 @@ void ShortcutWidget::setShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers)
|
||||
}
|
||||
}
|
||||
|
||||
void ShortcutWidget::resetShortcut()
|
||||
{
|
||||
m_key = static_cast<Qt::Key>(0);
|
||||
m_modifiers = 0;
|
||||
m_locked = false;
|
||||
autoType()->unregisterGlobalShortcut();
|
||||
}
|
||||
|
||||
void ShortcutWidget::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
keyEvent(event);
|
||||
@ -106,15 +114,14 @@ void ShortcutWidget::keyEvent(QKeyEvent* event)
|
||||
setShortcut(key, modifiers);
|
||||
}
|
||||
else {
|
||||
m_locked = false;
|
||||
resetShortcut();
|
||||
setStyleSheet("");
|
||||
displayShortcut(key, modifiers);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (m_locked) {
|
||||
m_locked = false;
|
||||
m_key = static_cast<Qt::Key>(0);
|
||||
resetShortcut();
|
||||
setStyleSheet("");
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ protected:
|
||||
private:
|
||||
void keyEvent(QKeyEvent* event);
|
||||
void displayShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers);
|
||||
void resetShortcut();
|
||||
|
||||
Qt::Key m_key;
|
||||
Qt::KeyboardModifiers m_modifiers;
|
||||
|
Loading…
Reference in New Issue
Block a user