summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-08-29 11:24:48 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-08-31 11:37:01 +0300
commit629ae58a8064e30860dcf83f71a1abe9560cc59c (patch)
tree2c39f5b94c2d66d563335668dbfce67e8de20668 /servers
parentf6714581cc29e14d2b0799a36d5ce91e172489c5 (diff)
Add support for system dark mode and accent color detection (macOS and Windows). Add support for dark mode title bar on Windows.
Diffstat (limited to 'servers')
-rw-r--r--servers/display_server.cpp4
-rw-r--r--servers/display_server.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp
index 22f42ca343..bd29294fca 100644
--- a/servers/display_server.cpp
+++ b/servers/display_server.cpp
@@ -586,6 +586,10 @@ void DisplayServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("tts_set_utterance_callback", "event", "callable"), &DisplayServer::tts_set_utterance_callback);
ClassDB::bind_method(D_METHOD("_tts_post_utterance_event", "event", "id", "char_pos"), &DisplayServer::tts_post_utterance_event);
+ ClassDB::bind_method(D_METHOD("is_dark_mode_supported"), &DisplayServer::is_dark_mode_supported);
+ ClassDB::bind_method(D_METHOD("is_dark_mode"), &DisplayServer::is_dark_mode);
+ ClassDB::bind_method(D_METHOD("get_accent_color"), &DisplayServer::get_accent_color);
+
ClassDB::bind_method(D_METHOD("mouse_set_mode", "mouse_mode"), &DisplayServer::mouse_set_mode);
ClassDB::bind_method(D_METHOD("mouse_get_mode"), &DisplayServer::mouse_get_mode);
diff --git a/servers/display_server.h b/servers/display_server.h
index 0b162fe491..453b6d4f86 100644
--- a/servers/display_server.h
+++ b/servers/display_server.h
@@ -210,6 +210,10 @@ public:
virtual void tts_set_utterance_callback(TTSUtteranceEvent p_event, const Callable &p_callable);
virtual void tts_post_utterance_event(TTSUtteranceEvent p_event, int p_id, int p_pos = 0);
+ virtual bool is_dark_mode_supported() const { return false; };
+ virtual bool is_dark_mode() const { return false; };
+ virtual Color get_accent_color() const { return Color(0, 0, 0, 0); };
+
enum MouseMode {
MOUSE_MODE_VISIBLE,
MOUSE_MODE_HIDDEN,