summarylogtreecommitdiffstats
path: root/gui.diff
diff options
context:
space:
mode:
Diffstat (limited to 'gui.diff')
-rw-r--r--gui.diff40
1 files changed, 40 insertions, 0 deletions
diff --git a/gui.diff b/gui.diff
new file mode 100644
index 000000000000..78ed8ce1ae21
--- /dev/null
+++ b/gui.diff
@@ -0,0 +1,40 @@
+--- a/src/gui/input/panels/InputPanel.cpp
++++ b/src/gui/input/panels/InputPanel.cpp
+@@ -9,6 +9,20 @@ InputPanel::InputPanel(wxWindow* parent)
+ : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxNO_BORDER | wxWANTS_CHARS)
+ {
+ Bind(wxEVT_LEFT_UP, &InputPanel::on_left_click, this);
++
++ // get the background color so we can determine the theme in use
++ wxColour bgColour = GetBackgroundColour();
++ uint32 bgLightness = (bgColour.GetRed() + bgColour.GetGreen() + bgColour.GetBlue()) / 3;
++ bool isDarkTheme = bgLightness < 128;
++ wxColour bgColourPrimary = bgColour; // color for odd rows
++ wxColour bgColourSecondary = bgColour.ChangeLightness(isDarkTheme ? 110 : 90); // color for even rows
++
++ // for very light themes we'll use a blue tint to match the older Windows Cemu look
++ if (bgLightness > 250)
++ bgColourSecondary = wxColour(bgColour.Red() - 13, bgColour.Green() - 6, bgColour.Blue() - 2);
++
++ kKeyColourNormalMode = bgColourPrimary;
++ kKeyColourActiveMode = bgColourSecondary;
+ }
+
+ void InputPanel::on_timer(const EmulatedControllerPtr& emulated_controller, const ControllerPtr& controller)
+diff --git a/src/gui/input/panels/InputPanel.h b/src/gui/input/panels/InputPanel.h
+index 6ac15089..3d7bb3ab 100644
+--- a/src/gui/input/panels/InputPanel.h
++++ b/src/gui/input/panels/InputPanel.h
+@@ -12,9 +12,9 @@ class wxComboBox;
+ class InputPanel : public wxPanel
+ {
+ public:
+- const wxColour kKeyColourNormalMode = 0xfafafa;
+- const wxColour kKeyColourEditMode = 0x99ccff;
+- const wxColour kKeyColourActiveMode = 0xE0E0E0;
++ wxColour kKeyColourNormalMode = 0xfafafa;
++ wxColour kKeyColourEditMode = 0x99ccff;
++ wxColour kKeyColourActiveMode = 0xE0E0E0;
+
+ InputPanel(wxWindow* parent);
+