nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/include/wx/settings.h b/include/wx/settings.h
2index 3967b98b46..8d7f3d2870 100644
3--- a/include/wx/settings.h
4+++ b/include/wx/settings.h
5@@ -13,6 +13,8 @@
6 #include "wx/colour.h"
7 #include "wx/font.h"
8
9+#include <memory>
10+
11 class WXDLLIMPEXP_FWD_CORE wxWindow;
12
13 // possible values for wxSystemSettings::GetFont() parameter
14@@ -241,9 +243,28 @@ public:
15 // include the declaration of the real platform-dependent class
16 // ----------------------------------------------------------------------------
17
18+struct wxColorHook
19+{
20+ virtual ~wxColorHook() {}
21+ virtual wxColor getColor(wxSystemColour index) const = 0;
22+};
23+WXDLLIMPEXP_CORE inline std::unique_ptr<wxColorHook>& refGlobalColorHook()
24+{
25+ static std::unique_ptr<wxColorHook> globalColorHook;
26+ return globalColorHook;
27+}
28+
29 class WXDLLIMPEXP_CORE wxSystemSettings : public wxSystemSettingsNative
30 {
31 public:
32+ static wxColour GetColour(wxSystemColour index)
33+ {
34+ if (refGlobalColorHook())
35+ return refGlobalColorHook()->getColor(index);
36+
37+ return wxSystemSettingsNative::GetColour(index);
38+ }
39+
40 #ifdef __WXUNIVERSAL__
41 // in wxUniversal we want to use the theme standard colours instead of the
42 // system ones, otherwise wxSystemSettings is just the same as
43@@ -264,7 +285,6 @@ public:
44
45 // Value
46 static wxSystemScreenType ms_screen;
47-
48 };
49
50 #endif