mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:59:38 +00:00
UI: OptionsWindow: Use Ctrl+S to apply changes.
This commit is contained in:
parent
db8b7c5c2f
commit
95786495c6
@ -36,10 +36,20 @@ void OptionsWindow::closeEvent(QCloseEvent *event)
|
||||
|
||||
void OptionsWindow::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Escape
|
||||
&& event->modifiers() == Qt::NoModifier
|
||||
&& !event->isAutoRepeat()) {
|
||||
ctrl()->closeWindow();
|
||||
if (event->isAutoRepeat())
|
||||
return;
|
||||
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Escape: // Esc
|
||||
if (event->modifiers() == Qt::NoModifier) {
|
||||
ctrl()->closeWindow();
|
||||
}
|
||||
break;
|
||||
case Qt::Key_S: // Ctrl+S
|
||||
if (event->modifiers() == Qt::ControlModifier) {
|
||||
ctrl()->applyChanges();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,10 +74,15 @@ void ProgramsWindow::closeEvent(QCloseEvent *event)
|
||||
|
||||
void ProgramsWindow::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Escape
|
||||
&& event->modifiers() == Qt::NoModifier
|
||||
&& !event->isAutoRepeat()) {
|
||||
ctrl()->closeWindow();
|
||||
if (event->isAutoRepeat())
|
||||
return;
|
||||
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Escape: // Esc
|
||||
if (event->modifiers() == Qt::NoModifier) {
|
||||
ctrl()->closeWindow();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user