28#include "model/ocpn_types.h"
37extern s52plib* ps52plib;
38extern wxColorHashMap* pcurrent_user_color_hash;
40wxColour GetGlobalColor(wxString colorName) {
44 if (ps52plib) ret_color = ps52plib->getwxColour(colorName);
45 if (!ret_color.Ok() && pcurrent_user_color_hash)
46 ret_color = (*pcurrent_user_color_hash)[colorName];
49 if (!ret_color.Ok()) {
50 ret_color.Set(128, 128, 128);
51 wxLogMessage(
"Warning: Color not found " + colorName);
53 if (pcurrent_user_color_hash)
54 (*pcurrent_user_color_hash)[colorName] = ret_color;
60 wxColour col = *wxRED;
62 bool bUseSysColors =
false;
63 bool bIsDarkMode =
false;
65 if (wxPlatformInfo::Get().CheckOSVersion(10, 14)) bUseSysColors =
true;
72 wxColour bg = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
80 if (bUseSysColors && bIsDarkMode) {
81 col = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
83 col = GetGlobalColor(
"DILG0");
87 if (bUseSysColors && bIsDarkMode) {
88 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
90 col = GetGlobalColor(
"DILG1");
94 if (bUseSysColors && bIsDarkMode) {
95 col = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
97 col = GetGlobalColor(
"DILG0");
102 if (bUseSysColors && bIsDarkMode) {
103 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
105 col = GetGlobalColor(
"DILG3");
109 if (bUseSysColors && bIsDarkMode) {
110 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
112 col = GetGlobalColor(
"DILG1");
116 if (bUseSysColors && bIsDarkMode) {
117 col = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
119 col = GetGlobalColor(
"DILG3");
123 if (bUseSysColors && bIsDarkMode) {
124 col = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
126 col = GetGlobalColor(
"UIBCK");
wxColour GetDialogColor(DialogColor color)
Retrieves a dialog color based on its role in the application's dialogs.
Global color handling by name.
DialogColor
Enumeration of color types used in dialogs.
@ DLG_ACCENT
Accent color.
@ DLG_SELECTED_ACCENT
Accent color for selected items.
@ DLG_SELECTED_BACKGROUND
Background color for selected items.
@ DLG_UNSELECTED_ACCENT
Accent color for unselected items.
@ DLG_UNSELECTED_BACKGROUND
Background color for unselected items.
@ DLG_BACKGROUND
Background color of the dialog.
@ DLG_HIGHLIGHT
Highlight color.
Miscellaneous globals primarely used by gui layer.