Update UI

This commit is contained in:
discountchubbs
2025-03-25 11:38:43 -07:00
parent 73581243fe
commit 9f4b068909
4 changed files with 11 additions and 17 deletions
@@ -30,10 +30,10 @@ VehiclePanel::VehiclePanel(QWidget *parent) : QFrame(parent) {
platformSelector = new PlatformSelector();
list->addItem(platformSelector);
// Use updateUI() on offroad transition.
QObject::connect(uiState(), &UIState::offroadTransition, this, [=](bool offroad_transition) {
offroad = offroad_transition;
updateUI();
updatePanel(offroad);
updateCarToggles();
});
ScrollViewSP *scroller = new ScrollViewSP(list, this);
@@ -70,14 +70,10 @@ VehiclePanel::VehiclePanel(QWidget *parent) : QFrame(parent) {
main_layout->addWidget(vehicleScreen);
}
void VehiclePanel::updateUI() {
updatePanel(offroad);
updateCarToggles();
}
void VehiclePanel::showEvent(QShowEvent *event) {
QFrame::showEvent(event);
updateUI();
updatePanel(offroad);
updateCarToggles();
}
void VehiclePanel::updatePanel(bool _offroad) {
@@ -33,6 +33,5 @@ private:
int hkg_state = 0;
private slots:
void updateUI();
void updateCarToggles();
};
+6 -7
View File
@@ -50,13 +50,12 @@ def setup_car_interface_sp(CP: structs.CarParams, CP_SP: structs.CarParamsSP, pa
if params is None:
params = Params()
if CP.brand == 'hyundai':
tuning_option_str = params.get("HyundaiLongTune")
if tuning_option_str is not None:
tuning_option_str = tuning_option_str.strip()
if tuning_option_str != "0":
CP_SP.flags |= HyundaiFlagsSP.HKGLONGTUNING.value
if params.get_bool("HyundaiSmootherBraking"):
tuning_option_str = params.get("HyundaiLongTune")
if tuning_option_str is not None:
tuning_option_str = tuning_option_str.strip()
if tuning_option_str != "0":
CP_SP.flags |= HyundaiFlagsSP.HKGLONGTUNING.value
if params.get_bool("HyundaiSmootherBraking"):
CP_SP.flags |= HyundaiFlagsSP.HKGLONGTUNING_BRAKING.value
if CP.brand == 'hyundai':