3#include "color_handler.h"
7extern s52plib *ps52plib;
8extern wxColorHashMap* pcurrent_user_color_hash;
11wxColour GetGlobalColor(wxString colorName) {
15 if (ps52plib) ret_color = ps52plib->getwxColour(colorName);
16 if (!ret_color.Ok() && pcurrent_user_color_hash)
17 ret_color = (*pcurrent_user_color_hash)[colorName];
20 if (!ret_color.Ok()) {
21 ret_color.Set(128, 128, 128);
22 wxLogMessage(_T(
"Warning: Color not found ") + colorName);
24 if (pcurrent_user_color_hash)
25 (*pcurrent_user_color_hash)[colorName] = ret_color;
30wxColour GetDialogColor(DialogColor color) {
31 wxColour col = *wxRED;
33 bool bUseSysColors =
false;
34 bool bIsDarkMode =
false;
36 if (wxPlatformInfo::Get().CheckOSVersion(10, 14)) bUseSysColors =
true;
43 wxColour bg = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
51 if (bUseSysColors && bIsDarkMode) {
52 col = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
54 col = GetGlobalColor(
"DILG0");
57 case DLG_SELECTED_BACKGROUND:
58 if (bUseSysColors && bIsDarkMode) {
59 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
61 col = GetGlobalColor(
"DILG1");
64 case DLG_UNSELECTED_BACKGROUND:
65 if (bUseSysColors && bIsDarkMode) {
66 col = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
68 col = GetGlobalColor(
"DILG0");
72 case DLG_SELECTED_ACCENT:
73 if (bUseSysColors && bIsDarkMode) {
74 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
76 col = GetGlobalColor(
"DILG3");
79 case DLG_UNSELECTED_ACCENT:
80 if (bUseSysColors && bIsDarkMode) {
81 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
83 col = GetGlobalColor(
"DILG1");
87 if (bUseSysColors && bIsDarkMode) {
88 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
90 col = GetGlobalColor(
"DILG3");
94 if (bUseSysColors && bIsDarkMode) {
95 col = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
97 col = GetGlobalColor(
"UIBCK");