aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/configuration/configure_input_player_widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/configuration/configure_input_player_widget.cpp')
-rw-r--r--src/yuzu/configuration/configure_input_player_widget.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp
index 3b79b6076e..93f7eddc92 100644
--- a/src/yuzu/configuration/configure_input_player_widget.cpp
+++ b/src/yuzu/configuration/configure_input_player_widget.cpp
@@ -27,7 +27,9 @@ void PlayerControlPreview::SetController(Core::HID::EmulatedController* controll
is_controller_set = true;
controller = controller_;
Core::HID::ControllerUpdateCallback engine_callback{
- [this](Core::HID::ControllerTriggerType type) { ControllerUpdate(type); }};
+ .on_change = [this](Core::HID::ControllerTriggerType type) { ControllerUpdate(type); },
+ .is_service = false,
+ };
callback_key = controller->SetCallback(engine_callback);
ControllerUpdate(Core::HID::ControllerTriggerType::All);
}
@@ -810,7 +812,7 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center)
DrawSymbol(p, center + QPoint(29, -56), Symbol::House, 3.9f);
// Draw battery
- DrawBattery(p, center + QPoint(-30, -165), battery_values[0]);
+ DrawBattery(p, center + QPoint(-30, -160), battery_values[0]);
}
void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) {
@@ -2655,6 +2657,9 @@ void PlayerControlPreview::DrawTriggerButton(QPainter& p, const QPointF center,
}
void PlayerControlPreview::DrawBattery(QPainter& p, QPointF center, Input::BatteryLevel battery) {
+ if (battery == Input::BatteryLevel::None) {
+ return;
+ }
p.setPen(colors.outline);
p.setBrush(colors.transparent);
p.drawRect(center.x(), center.y(), 56, 20);
@@ -2669,6 +2674,7 @@ void PlayerControlPreview::DrawBattery(QPainter& p, QPointF center, Input::Batte
p.drawRect(center.x() + 42, center.y(), 14, 20);
p.drawRect(center.x() + 28, center.y(), 14, 20);
p.drawRect(center.x() + 14, center.y(), 14, 20);
+ p.drawRect(center.x(), center.y(), 14, 20);
break;
case Input::BatteryLevel::Medium:
p.drawRect(center.x() + 28, center.y(), 14, 20);
@@ -2685,6 +2691,8 @@ void PlayerControlPreview::DrawBattery(QPainter& p, QPointF center, Input::Batte
case Input::BatteryLevel::Empty:
p.drawRect(center.x(), center.y(), 5, 20);
break;
+ default:
+ break;
}
}