summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/yuzu/configuration/configure_input_player_widget.cpp35
-rw-r--r--src/yuzu/configuration/configure_input_player_widget.h2
2 files changed, 23 insertions, 14 deletions
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp
index 68af6c20c..c287220fc 100644
--- a/src/yuzu/configuration/configure_input_player_widget.cpp
+++ b/src/yuzu/configuration/configure_input_player_widget.cpp
@@ -81,7 +81,6 @@ void PlayerControlPreview::UpdateColors() {
81 colors.outline = QColor(0, 0, 0); 81 colors.outline = QColor(0, 0, 0);
82 colors.primary = QColor(225, 225, 225); 82 colors.primary = QColor(225, 225, 225);
83 colors.button = QColor(109, 111, 114); 83 colors.button = QColor(109, 111, 114);
84 colors.button2 = QColor(109, 111, 114);
85 colors.button2 = QColor(77, 80, 84); 84 colors.button2 = QColor(77, 80, 84);
86 colors.slider_arrow = QColor(65, 68, 73); 85 colors.slider_arrow = QColor(65, 68, 73);
87 colors.font2 = QColor(0, 0, 0); 86 colors.font2 = QColor(0, 0, 0);
@@ -100,6 +99,7 @@ void PlayerControlPreview::UpdateColors() {
100 colors.led_off = QColor(170, 238, 255); 99 colors.led_off = QColor(170, 238, 255);
101 colors.indicator2 = QColor(59, 165, 93); 100 colors.indicator2 = QColor(59, 165, 93);
102 colors.charging = QColor(250, 168, 26); 101 colors.charging = QColor(250, 168, 26);
102 colors.button_turbo = QColor(217, 158, 4);
103 103
104 colors.left = colors.primary; 104 colors.left = colors.primary;
105 colors.right = colors.primary; 105 colors.right = colors.primary;
@@ -2469,7 +2469,6 @@ void PlayerControlPreview::DrawJoystickDot(QPainter& p, const QPointF center,
2469void PlayerControlPreview::DrawRoundButton(QPainter& p, QPointF center, 2469void PlayerControlPreview::DrawRoundButton(QPainter& p, QPointF center,
2470 const Common::Input::ButtonStatus& pressed, float width, 2470 const Common::Input::ButtonStatus& pressed, float width,
2471 float height, Direction direction, float radius) { 2471 float height, Direction direction, float radius) {
2472 p.setBrush(button_color);
2473 if (pressed.value) { 2472 if (pressed.value) {
2474 switch (direction) { 2473 switch (direction) {
2475 case Direction::Left: 2474 case Direction::Left:
@@ -2487,16 +2486,16 @@ void PlayerControlPreview::DrawRoundButton(QPainter& p, QPointF center,
2487 case Direction::None: 2486 case Direction::None:
2488 break; 2487 break;
2489 } 2488 }
2490 p.setBrush(colors.highlight);
2491 } 2489 }
2492 QRectF rect = {center.x() - width, center.y() - height, width * 2.0f, height * 2.0f}; 2490 QRectF rect = {center.x() - width, center.y() - height, width * 2.0f, height * 2.0f};
2491 p.setBrush(GetButtonColor(button_color, pressed.value, pressed.turbo));
2493 p.drawRoundedRect(rect, radius, radius); 2492 p.drawRoundedRect(rect, radius, radius);
2494} 2493}
2495void PlayerControlPreview::DrawMinusButton(QPainter& p, const QPointF center, 2494void PlayerControlPreview::DrawMinusButton(QPainter& p, const QPointF center,
2496 const Common::Input::ButtonStatus& pressed, 2495 const Common::Input::ButtonStatus& pressed,
2497 int button_size) { 2496 int button_size) {
2498 p.setPen(colors.outline); 2497 p.setPen(colors.outline);
2499 p.setBrush(pressed.value ? colors.highlight : colors.button); 2498 p.setBrush(GetButtonColor(colors.button, pressed.value, pressed.turbo));
2500 DrawRectangle(p, center, button_size, button_size / 3.0f); 2499 DrawRectangle(p, center, button_size, button_size / 3.0f);
2501} 2500}
2502void PlayerControlPreview::DrawPlusButton(QPainter& p, const QPointF center, 2501void PlayerControlPreview::DrawPlusButton(QPainter& p, const QPointF center,
@@ -2504,7 +2503,7 @@ void PlayerControlPreview::DrawPlusButton(QPainter& p, const QPointF center,
2504 int button_size) { 2503 int button_size) {
2505 // Draw outer line 2504 // Draw outer line
2506 p.setPen(colors.outline); 2505 p.setPen(colors.outline);
2507 p.setBrush(pressed.value ? colors.highlight : colors.button); 2506 p.setBrush(GetButtonColor(colors.button, pressed.value, pressed.turbo));
2508 DrawRectangle(p, center, button_size, button_size / 3.0f); 2507 DrawRectangle(p, center, button_size, button_size / 3.0f);
2509 DrawRectangle(p, center, button_size / 3.0f, button_size); 2508 DrawRectangle(p, center, button_size / 3.0f, button_size);
2510 2509
@@ -2526,7 +2525,7 @@ void PlayerControlPreview::DrawGCButtonX(QPainter& p, const QPointF center,
2526 } 2525 }
2527 2526
2528 p.setPen(colors.outline); 2527 p.setPen(colors.outline);
2529 p.setBrush(pressed.value ? colors.highlight : colors.button); 2528 p.setBrush(GetButtonColor(colors.button, pressed.value, pressed.turbo));
2530 DrawPolygon(p, button_x); 2529 DrawPolygon(p, button_x);
2531} 2530}
2532 2531
@@ -2539,7 +2538,7 @@ void PlayerControlPreview::DrawGCButtonY(QPainter& p, const QPointF center,
2539 } 2538 }
2540 2539
2541 p.setPen(colors.outline); 2540 p.setPen(colors.outline);
2542 p.setBrush(pressed.value ? colors.highlight : colors.button); 2541 p.setBrush(GetButtonColor(colors.button, pressed.value, pressed.turbo));
2543 DrawPolygon(p, button_x); 2542 DrawPolygon(p, button_x);
2544} 2543}
2545 2544
@@ -2553,17 +2552,15 @@ void PlayerControlPreview::DrawGCButtonZ(QPainter& p, const QPointF center,
2553 } 2552 }
2554 2553
2555 p.setPen(colors.outline); 2554 p.setPen(colors.outline);
2556 p.setBrush(pressed.value ? colors.highlight : colors.button2); 2555 p.setBrush(GetButtonColor(colors.button2, pressed.value, pressed.turbo));
2557 DrawPolygon(p, button_x); 2556 DrawPolygon(p, button_x);
2558} 2557}
2559 2558
2560void PlayerControlPreview::DrawCircleButton(QPainter& p, const QPointF center, 2559void PlayerControlPreview::DrawCircleButton(QPainter& p, const QPointF center,
2561 const Common::Input::ButtonStatus& pressed, 2560 const Common::Input::ButtonStatus& pressed,
2562 float button_size) { 2561 float button_size) {
2563 p.setBrush(button_color); 2562
2564 if (pressed.value) { 2563 p.setBrush(GetButtonColor(button_color, pressed.value, pressed.turbo));
2565 p.setBrush(colors.highlight);
2566 }
2567 p.drawEllipse(center, button_size, button_size); 2564 p.drawEllipse(center, button_size, button_size);
2568} 2565}
2569 2566
@@ -2620,7 +2617,7 @@ void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center,
2620 2617
2621 // Draw arrow button 2618 // Draw arrow button
2622 p.setPen(pressed.value ? colors.highlight : colors.button); 2619 p.setPen(pressed.value ? colors.highlight : colors.button);
2623 p.setBrush(pressed.value ? colors.highlight : colors.button); 2620 p.setBrush(GetButtonColor(colors.button, pressed.value, pressed.turbo));
2624 DrawPolygon(p, arrow_button); 2621 DrawPolygon(p, arrow_button);
2625 2622
2626 switch (direction) { 2623 switch (direction) {
@@ -2672,10 +2669,20 @@ void PlayerControlPreview::DrawTriggerButton(QPainter& p, const QPointF center,
2672 2669
2673 // Draw arrow button 2670 // Draw arrow button
2674 p.setPen(colors.outline); 2671 p.setPen(colors.outline);
2675 p.setBrush(pressed.value ? colors.highlight : colors.button); 2672 p.setBrush(GetButtonColor(colors.button, pressed.value, pressed.turbo));
2676 DrawPolygon(p, qtrigger_button); 2673 DrawPolygon(p, qtrigger_button);
2677} 2674}
2678 2675
2676QColor PlayerControlPreview::GetButtonColor(QColor default_color, bool is_pressed, bool turbo) {
2677 if (is_pressed && turbo) {
2678 return colors.button_turbo;
2679 }
2680 if (is_pressed) {
2681 return colors.highlight;
2682 }
2683 return default_color;
2684}
2685
2679void PlayerControlPreview::DrawBattery(QPainter& p, QPointF center, 2686void PlayerControlPreview::DrawBattery(QPainter& p, QPointF center,
2680 Common::Input::BatteryLevel battery) { 2687 Common::Input::BatteryLevel battery) {
2681 if (battery == Common::Input::BatteryLevel::None) { 2688 if (battery == Common::Input::BatteryLevel::None) {
diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h
index b258c6d77..0e9e95e85 100644
--- a/src/yuzu/configuration/configure_input_player_widget.h
+++ b/src/yuzu/configuration/configure_input_player_widget.h
@@ -81,6 +81,7 @@ private:
81 QColor right{}; 81 QColor right{};
82 QColor button{}; 82 QColor button{};
83 QColor button2{}; 83 QColor button2{};
84 QColor button_turbo{};
84 QColor font{}; 85 QColor font{};
85 QColor font2{}; 86 QColor font2{};
86 QColor highlight{}; 87 QColor highlight{};
@@ -183,6 +184,7 @@ private:
183 const Common::Input::ButtonStatus& pressed, float size = 1.0f); 184 const Common::Input::ButtonStatus& pressed, float size = 1.0f);
184 void DrawTriggerButton(QPainter& p, QPointF center, Direction direction, 185 void DrawTriggerButton(QPainter& p, QPointF center, Direction direction,
185 const Common::Input::ButtonStatus& pressed); 186 const Common::Input::ButtonStatus& pressed);
187 QColor GetButtonColor(QColor default_color, bool is_pressed, bool turbo);
186 188
187 // Draw battery functions 189 // Draw battery functions
188 void DrawBattery(QPainter& p, QPointF center, Common::Input::BatteryLevel battery); 190 void DrawBattery(QPainter& p, QPointF center, Common::Input::BatteryLevel battery);