Core - allow toggles change while onroad

This commit is contained in:
Rick Lan
2025-03-31 10:06:56 +08:00
parent 28e1822ad1
commit c11b51a9cc

View File

@@ -237,13 +237,13 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
QObject::connect(uiState()->prime_state, &PrimeState::changed, [this] (PrimeState::Type type) {
pair_device->setVisible(type == PrimeState::PRIME_TYPE_UNPAIRED);
});
QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) {
for (auto btn : findChildren<ButtonControl *>()) {
if (btn != pair_device) {
btn->setEnabled(offroad);
}
}
});
// QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) {
// for (auto btn : findChildren<ButtonControl *>()) {
// if (btn != pair_device) {
// btn->setEnabled(offroad);
// }
// }
// });
// power buttons
QHBoxLayout *power_layout = new QHBoxLayout();