wip
This commit is contained in:
@@ -38,11 +38,11 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {
|
|||||||
closeSettings();
|
closeSettings();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
QObject::connect(device(), &Device::interactiveTimeout, [=]() {
|
// QObject::connect(device(), &Device::interactiveTimeout, [=]() {
|
||||||
if (main_layout->currentWidget() == settingsWindow) {
|
// if (main_layout->currentWidget() == settingsWindow) {
|
||||||
closeSettings();
|
// closeSettings();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
// load fonts
|
// load fonts
|
||||||
QFontDatabase::addApplicationFont("../assets/fonts/Inter-Black.ttf");
|
QFontDatabase::addApplicationFont("../assets/fonts/Inter-Black.ttf");
|
||||||
@@ -93,11 +93,12 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
|
|||||||
case QEvent::MouseMove: {
|
case QEvent::MouseMove: {
|
||||||
// ignore events when device is awakened by resetInteractiveTimeout
|
// ignore events when device is awakened by resetInteractiveTimeout
|
||||||
ignore = !device()->isAwake();
|
ignore = !device()->isAwake();
|
||||||
if (main_layout->currentWidget() == settingsWindow) {
|
// if (main_layout->currentWidget() == settingsWindow) {
|
||||||
device()->resetInteractiveTimeout(60 * 5); // 5 minute timeout if looking at settings window
|
// Not working...
|
||||||
} else {
|
// device()->resetInteractiveTimeout(60 * 5); // 5 minute timeout if looking at settings window
|
||||||
|
// } else {
|
||||||
device()->resetInteractiveTimeout(); // Default 30 seconds otherwise
|
device()->resetInteractiveTimeout(); // Default 30 seconds otherwise
|
||||||
}
|
// }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -459,9 +459,9 @@ void Device::setAwake(bool on) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::resetInteractiveTimeout(int timeout) {
|
void Device::resetInteractiveTimeout(int timeout = -1) {
|
||||||
if (timeout == -1) {
|
if (timeout == -1) {
|
||||||
timeout = 30;
|
timeout = 60;
|
||||||
}
|
}
|
||||||
interactive_timeout = timeout * UI_FREQ;
|
interactive_timeout = timeout * UI_FREQ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user