Qt: reset battery progress bar when not supported.

This commit is contained in:
Megamouse 2021-03-02 23:23:24 +01:00
parent f88c3ae417
commit bdd94f053c

View file

@ -412,10 +412,7 @@ void pad_settings_dialog::InitButtons()
} }
} }
if (m_enable_battery) ui->pb_battery->setValue(m_enable_battery ? battery_level : 0);
{
ui->pb_battery->setValue(battery_level);
}
if (val <= 0) if (val <= 0)
{ {
@ -436,14 +433,14 @@ void pad_settings_dialog::InitButtons()
const auto& fail_callback = [this](const std::string& pad_name) const auto& fail_callback = [this](const std::string& pad_name)
{ {
SwitchPadInfo(pad_name, false); SwitchPadInfo(pad_name, false);
if (m_enable_buttons) if (m_enable_buttons)
{ {
SwitchButtons(false); SwitchButtons(false);
} }
if (m_enable_battery)
{ ui->pb_battery->setValue(0);
ui->pb_battery->setValue(0);
}
if (m_handler->has_deadzones()) if (m_handler->has_deadzones())
{ {
ui->preview_trigger_left->setValue(0); ui->preview_trigger_left->setValue(0);