From 8db39b82ea73220169633cdc3936abd528bd0482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20T=2E=20Listwon?= Date: Mon, 14 Mar 2022 12:36:06 +0100 Subject: [PATCH 1/8] Include platform_config.h in thread.cpp and thread.h (cherry picked from commit 6c6291b84f384457967745684fde72831d838dd1) --- core/os/thread.cpp | 1 + core/os/thread.h | 1 + 2 files changed, 2 insertions(+) diff --git a/core/os/thread.cpp b/core/os/thread.cpp index c077ec507b5..9aaec0aa57d 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include "platform_config.h" #ifndef PLATFORM_THREAD_OVERRIDE // See details in thread.h #include "thread.h" diff --git a/core/os/thread.h b/core/os/thread.h index 0ed072d8e88..8073c4a1b2e 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include "platform_config.h" // Define PLATFORM_THREAD_OVERRIDE in your platform's `platform_config.h` // to use a custom Thread implementation defined in `platform/[your_platform]/platform_thread.h` // Overriding the platform implementation is required in some proprietary platforms From 8eb539d5c1960cafb5e6dd6d5fb727ef59784f84 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 15 Mar 2022 23:05:12 +0800 Subject: [PATCH 2/8] More icon updates on theme change (cherry picked from commit 0ac6e6acbe15b0a7ceddbdaea49ded083f2f7f5e) --- editor/editor_profiler.cpp | 9 ++++++--- .../plugins/resource_preloader_editor_plugin.cpp | 14 +++++--------- editor/plugins/shader_editor_plugin.cpp | 14 +++++++++++--- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 2967fa4913c..4ae620371b6 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -425,9 +425,12 @@ void EditorProfiler::_clear_pressed() { } void EditorProfiler::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - activate->set_icon(get_icon("Play", "EditorIcons")); - clear_button->set_icon(get_icon("Clear", "EditorIcons")); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + activate->set_icon(get_icon("Play", "EditorIcons")); + clear_button->set_icon(get_icon("Clear", "EditorIcons")); + } break; } } diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index 102a42be6d7..3a01c62e76e 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -39,15 +39,11 @@ void ResourcePreloaderEditor::_gui_input(Ref p_event) { } void ResourcePreloaderEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - load->set_icon(get_icon("Folder", "EditorIcons")); - } - - if (p_what == NOTIFICATION_READY) { - //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector(),true); - } - - if (p_what == NOTIFICATION_DRAW) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + load->set_icon(get_icon("Folder", "EditorIcons")); + } break; } } diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 0c0e40990e6..1f39636fb4b 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -349,8 +349,16 @@ void ShaderEditor::_menu_option(int p_option) { } void ShaderEditor::_notification(int p_what) { - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) { - _check_for_external_edit(); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + PopupMenu *popup = help_menu->get_popup(); + popup->set_item_icon(popup->get_item_index(HELP_DOCS), get_icon("Instance", "EditorIcons")); + } break; + + case MainLoop::NOTIFICATION_WM_FOCUS_IN: { + _check_for_external_edit(); + } break; } } @@ -664,7 +672,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { help_menu = memnew(MenuButton); help_menu->set_text(TTR("Help")); help_menu->set_switch_on_hover(true); - help_menu->get_popup()->add_icon_item(p_node->get_gui_base()->get_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS); + help_menu->get_popup()->add_item(TTR("Online Docs"), HELP_DOCS); help_menu->get_popup()->connect("id_pressed", this, "_menu_option"); add_child(main_container); From 1a300503c621d95faab34d374610019e64675ca8 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 14 Mar 2022 17:14:57 +0100 Subject: [PATCH 3/8] Document Range's `value_changed` signal is also emitted with code changes This also mentions that the signal is potentially emitted every frame, which can have performance implications. (cherry picked from commit cdbb31adc9fc5b44bd0304af5e3678e51d43d2b1) --- doc/classes/Range.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/classes/Range.xml b/doc/classes/Range.xml index efc74410581..6bc274d5beb 100644 --- a/doc/classes/Range.xml +++ b/doc/classes/Range.xml @@ -13,13 +13,13 @@ - Binds two ranges together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. + Binds two [Range]s together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. - Stops range from sharing its member variables with any other. + Stops the [Range] from sharing its member variables with any other. @@ -64,7 +64,8 @@ - Emitted when [member value] changes. + Emitted when [member value] changes. When used on a [Slider], this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to [signal value_changed], consider using a [i]debouncing[/i] [Timer] to call the function less often. + [b]Note:[/b] Unlike signals such as [signal LineEdit.text_changed], [signal value_changed] is also emitted when [code]value[/code] is set directly via code. From b8178a7f0ad1c3352cbc47c91838a881dfa36f08 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Mon, 14 Mar 2022 09:19:04 -0700 Subject: [PATCH 4/8] Setup logic to publish the Godot Android library to MavenCentral (cherry picked from commit a2bf47de2bfd539f0b50506b4b10095998892559) --- platform/android/java/app/config.gradle | 15 +++- platform/android/java/build.gradle | 4 + platform/android/java/lib/build.gradle | 17 +++++ .../java/scripts/publish-module.gradle | 74 +++++++++++++++++++ .../android/java/scripts/publish-root.gradle | 39 ++++++++++ 5 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 platform/android/java/scripts/publish-module.gradle create mode 100644 platform/android/java/scripts/publish-root.gradle diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle index 32e03998dab..c238d1b3615 100644 --- a/platform/android/java/app/config.gradle +++ b/platform/android/java/app/config.gradle @@ -4,7 +4,7 @@ ext.versions = [ minSdk : 19, // Also update 'platform/android/java/lib/AndroidManifest.xml#minSdkVersion' & 'platform/android/export/export_plugin.cpp#DEFAULT_MIN_SDK_VERSION' targetSdk : 30, // Also update 'platform/android/java/lib/AndroidManifest.xml#targetSdkVersion' & 'platform/android/export/export_plugin.cpp#DEFAULT_TARGET_SDK_VERSION' buildTools : '30.0.3', - kotlinVersion : '1.5.10', + kotlinVersion : '1.6.10', fragmentVersion : '1.3.6', javaVersion : 11, ndkVersion : '21.4.7075529' // Also update 'platform/android/detect.py#get_project_ndk_version()' when this is updated. @@ -86,13 +86,12 @@ ext.getGodotEditorVersion = { -> return editorVersion } -ext.getGodotLibraryVersion = { -> +ext.generateGodotLibraryVersion = { List requiredKeys -> // Attempt to read the version from the `version.py` file. String libraryVersion = "" File versionFile = new File("../../../version.py") if (versionFile.isFile()) { - List requiredKeys = ["major", "minor", "patch", "status", "module_config"] def map = [:] List lines = versionFile.readLines() @@ -121,6 +120,16 @@ ext.getGodotLibraryVersion = { -> return libraryVersion } +ext.getGodotLibraryVersion = { -> + List requiredKeys = ["major", "minor", "patch", "status", "module_config"] + return generateGodotLibraryVersion(requiredKeys) +} + +ext.getGodotPublishVersion = { -> + List requiredKeys = ["major", "minor", "patch", "status"] + return generateGodotLibraryVersion(requiredKeys) +} + final String VALUE_SEPARATOR_REGEX = "\\|" // get the list of ABIs the project should be exported to diff --git a/platform/android/java/build.gradle b/platform/android/java/build.gradle index ac008edbedb..83bc68c9929 100644 --- a/platform/android/java/build.gradle +++ b/platform/android/java/build.gradle @@ -1,4 +1,6 @@ +apply plugin: 'io.github.gradle-nexus.publish-plugin' apply from: 'app/config.gradle' +apply from: 'scripts/publish-root.gradle' buildscript { apply from: 'app/config.gradle' @@ -6,10 +8,12 @@ buildscript { repositories { google() mavenCentral() + maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath libraries.androidGradlePlugin classpath libraries.kotlinGradlePlugin + classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' } } diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index fbed4ed0787..120a40a31d1 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -1,6 +1,13 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +ext { + PUBLISH_VERSION = getGodotPublishVersion() + PUBLISH_ARTIFACT_ID = 'godot' +} + +apply from: "../scripts/publish-module.gradle" + dependencies { implementation libraries.kotlinStdLib implementation libraries.androidxFragment @@ -21,6 +28,8 @@ android { manifestPlaceholders = [godotLibraryVersion: getGodotLibraryVersion()] } + namespace = "org.godotengine.godot" + compileOptions { sourceCompatibility versions.javaVersion targetCompatibility versions.javaVersion @@ -111,4 +120,12 @@ android { // Schedule the tasks so the generated libs are present before the aar file is packaged. tasks["merge${buildType}JniLibFolders"].dependsOn taskName } + + // TODO: Enable when issues with AGP 7.1+ are resolved (https://github.com/GodotVR/godot_openxr/issues/187). +// publishing { +// singleVariant("release") { +// withSourcesJar() +// withJavadocJar() +// } +// } } diff --git a/platform/android/java/scripts/publish-module.gradle b/platform/android/java/scripts/publish-module.gradle new file mode 100644 index 00000000000..6b2aea5caf9 --- /dev/null +++ b/platform/android/java/scripts/publish-module.gradle @@ -0,0 +1,74 @@ +apply plugin: 'maven-publish' +apply plugin: 'signing' + +group = ossrhGroupId +version = PUBLISH_VERSION + +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + // The coordinates of the library, being set from variables that + // we'll set up later + groupId ossrhGroupId + artifactId PUBLISH_ARTIFACT_ID + version PUBLISH_VERSION + + // Two artifacts, the `aar` (or `jar`) and the sources + if (project.plugins.findPlugin("com.android.library")) { + from components.release + } else { + from components.java + } + + // Mostly self-explanatory metadata + pom { + name = PUBLISH_ARTIFACT_ID + description = 'Godot Engine Android Library' + url = 'https://godotengine.org/' + licenses { + license { + name = 'MIT License' + url = 'https://github.com/godotengine/godot/blob/master/LICENSE.txt' + } + } + developers { + developer { + id = 'm4gr3d' + name = 'Fredia Huya-Kouadio' + email = 'fhuyakou@gmail.com' + } + developer { + id = 'reduz' + name = 'Juan Linietsky' + email = 'reduzio@gmail.com' + } + developer { + id = 'akien-mga' + name = 'RĂ©mi Verschelde' + email = 'rverschelde@gmail.com' + } + // Add all other devs here... + } + + // Version control info - if you're using GitHub, follow the + // format as seen here + scm { + connection = 'scm:git:github.com/godotengine/godot.git' + developerConnection = 'scm:git:ssh://github.com/godotengine/godot.git' + url = 'https://github.com/godotengine/godot/tree/master' + } + } + } + } + } +} + +signing { + useInMemoryPgpKeys( + rootProject.ext["signing.keyId"], + rootProject.ext["signing.key"], + rootProject.ext["signing.password"], + ) + sign publishing.publications +} diff --git a/platform/android/java/scripts/publish-root.gradle b/platform/android/java/scripts/publish-root.gradle new file mode 100644 index 00000000000..ae88487c34c --- /dev/null +++ b/platform/android/java/scripts/publish-root.gradle @@ -0,0 +1,39 @@ +// Create variables with empty default values +ext["signing.keyId"] = '' +ext["signing.password"] = '' +ext["signing.key"] = '' +ext["ossrhGroupId"] = '' +ext["ossrhUsername"] = '' +ext["ossrhPassword"] = '' +ext["sonatypeStagingProfileId"] = '' + +File secretPropsFile = project.rootProject.file('local.properties') +if (secretPropsFile.exists()) { + // Read local.properties file first if it exists + Properties p = new Properties() + new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) } + p.each { name, value -> ext[name] = value } +} else { + // Use system environment variables + ext["ossrhGroupId"] = System.getenv('OSSRH_GROUP_ID') + ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') + ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') + ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') + ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') + ext["signing.password"] = System.getenv('SIGNING_PASSWORD') + ext["signing.key"] = System.getenv('SIGNING_KEY') +} + +// Set up Sonatype repository +nexusPublishing { + repositories { + sonatype { + stagingProfileId = sonatypeStagingProfileId + username = ossrhUsername + password = ossrhPassword + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + } + } +} + From b33eed23aef39db58dac563dc14d7110f16eca50 Mon Sep 17 00:00:00 2001 From: taigi100 Date: Tue, 15 Mar 2022 11:56:12 +0200 Subject: [PATCH 5/8] Fix children visibility check (cherry picked from commit 280956ddc325568af94b354630cfa28058b07e63) --- scene/gui/flow_container.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scene/gui/flow_container.cpp b/scene/gui/flow_container.cpp index 8bdd58a2a04..d6d59de6ea3 100644 --- a/scene/gui/flow_container.cpp +++ b/scene/gui/flow_container.cpp @@ -41,6 +41,11 @@ struct _LineData { }; void FlowContainer::_resort() { + // Avoid resorting if invisible. + if (!is_visible_in_tree()) { + return; + } + int separation_horizontal = get_constant("hseparation"); int separation_vertical = get_constant("vseparation"); @@ -58,7 +63,7 @@ void FlowContainer::_resort() { // First pass for line wrapping and minimum size calculation. for (int i = 0; i < get_child_count(); i++) { Control *child = Object::cast_to(get_child(i)); - if (!child || !child->is_visible_in_tree()) { + if (!child || !child->is_visible()) { continue; } if (child->is_set_as_toplevel()) { @@ -128,7 +133,7 @@ void FlowContainer::_resort() { for (int i = 0; i < get_child_count(); i++) { Control *child = Object::cast_to(get_child(i)); - if (!child || !child->is_visible_in_tree()) { + if (!child || !child->is_visible()) { continue; } if (child->is_set_as_toplevel()) { From d537a88299ee1faa79ea81d6acd0774e59c3a288 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 17 Mar 2022 13:50:16 +0800 Subject: [PATCH 6/8] Add item tooltip access to OptionButton (cherry picked from commit a635ecf6d497347d81905d551cec24fd011761fb) --- doc/classes/OptionButton.xml | 15 +++++++++++++++ scene/gui/option_button.cpp | 10 ++++++++++ scene/gui/option_button.h | 2 ++ 3 files changed, 27 insertions(+) diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index e46ca8ea6a5..a0f9aaa1c24 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -80,6 +80,13 @@ Returns the text of the item at index [code]idx[/code]. + + + + + Returns the tooltip of the item at index [code]idx[/code]. + + @@ -161,6 +168,14 @@ Sets the text of the item at index [code]idx[/code]. + + + + + + Sets the tooltip of the item at index [code]idx[/code]. + + diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index b847f772a4e..6add6f3e157 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -156,6 +156,10 @@ void OptionButton::set_item_metadata(int p_idx, const Variant &p_metadata) { popup->set_item_metadata(p_idx, p_metadata); } +void OptionButton::set_item_tooltip(int p_idx, const String &p_tooltip) { + popup->set_item_tooltip(p_idx, p_tooltip); +} + void OptionButton::set_item_disabled(int p_idx, bool p_disabled) { popup->set_item_disabled(p_idx, p_disabled); } @@ -180,6 +184,10 @@ Variant OptionButton::get_item_metadata(int p_idx) const { return popup->get_item_metadata(p_idx); } +String OptionButton::get_item_tooltip(int p_idx) const { + return popup->get_item_tooltip(p_idx); +} + bool OptionButton::is_item_disabled(int p_idx) const { return popup->is_item_disabled(p_idx); } @@ -305,11 +313,13 @@ void OptionButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_item_disabled", "idx", "disabled"), &OptionButton::set_item_disabled); ClassDB::bind_method(D_METHOD("set_item_id", "idx", "id"), &OptionButton::set_item_id); ClassDB::bind_method(D_METHOD("set_item_metadata", "idx", "metadata"), &OptionButton::set_item_metadata); + ClassDB::bind_method(D_METHOD("set_item_tooltip", "idx", "tooltip"), &OptionButton::set_item_tooltip); ClassDB::bind_method(D_METHOD("get_item_text", "idx"), &OptionButton::get_item_text); ClassDB::bind_method(D_METHOD("get_item_icon", "idx"), &OptionButton::get_item_icon); ClassDB::bind_method(D_METHOD("get_item_id", "idx"), &OptionButton::get_item_id); ClassDB::bind_method(D_METHOD("get_item_index", "id"), &OptionButton::get_item_index); ClassDB::bind_method(D_METHOD("get_item_metadata", "idx"), &OptionButton::get_item_metadata); + ClassDB::bind_method(D_METHOD("get_item_tooltip", "idx"), &OptionButton::get_item_tooltip); ClassDB::bind_method(D_METHOD("is_item_disabled", "idx"), &OptionButton::is_item_disabled); ClassDB::bind_method(D_METHOD("get_item_count"), &OptionButton::get_item_count); ClassDB::bind_method(D_METHOD("add_separator"), &OptionButton::add_separator); diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index 9c938d16359..5f873d194f4 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -64,6 +64,7 @@ public: void set_item_id(int p_idx, int p_id); void set_item_metadata(int p_idx, const Variant &p_metadata); void set_item_disabled(int p_idx, bool p_disabled); + void set_item_tooltip(int p_idx, const String &p_tooltip); String get_item_text(int p_idx) const; Ref get_item_icon(int p_idx) const; @@ -71,6 +72,7 @@ public: int get_item_index(int p_id) const; Variant get_item_metadata(int p_idx) const; bool is_item_disabled(int p_idx) const; + String get_item_tooltip(int p_idx) const; int get_item_count() const; From e49d8f8b4cef326cb057e41ebba002fb79930dc0 Mon Sep 17 00:00:00 2001 From: taigi100 Date: Thu, 17 Mar 2022 08:46:10 +0200 Subject: [PATCH 7/8] Update color constants to use HEX codes (cherry picked from commit bd247fa31579c100275d2f2fa03c1388d22f60dd) --- core/color_names.inc | 292 +++++++++++++++++++++--------------------- doc/classes/Color.xml | 266 +++++++++++++++++++------------------- 2 files changed, 279 insertions(+), 279 deletions(-) diff --git a/core/color_names.inc b/core/color_names.inc index 2b50d88b02f..b1a2b99616a 100644 --- a/core/color_names.inc +++ b/core/color_names.inc @@ -6,150 +6,150 @@ static void _populate_named_colors() { if (!_named_colors.empty()) { return; } - _named_colors.insert("aliceblue", Color(0.94, 0.97, 1.00)); - _named_colors.insert("antiquewhite", Color(0.98, 0.92, 0.84)); - _named_colors.insert("aqua", Color(0.00, 1.00, 1.00)); - _named_colors.insert("aquamarine", Color(0.50, 1.00, 0.83)); - _named_colors.insert("azure", Color(0.94, 1.00, 1.00)); - _named_colors.insert("beige", Color(0.96, 0.96, 0.86)); - _named_colors.insert("bisque", Color(1.00, 0.89, 0.77)); - _named_colors.insert("black", Color(0.00, 0.00, 0.00)); - _named_colors.insert("blanchedalmond", Color(1.00, 0.92, 0.80)); - _named_colors.insert("blue", Color(0.00, 0.00, 1.00)); - _named_colors.insert("blueviolet", Color(0.54, 0.17, 0.89)); - _named_colors.insert("brown", Color(0.65, 0.16, 0.16)); - _named_colors.insert("burlywood", Color(0.87, 0.72, 0.53)); - _named_colors.insert("cadetblue", Color(0.37, 0.62, 0.63)); - _named_colors.insert("chartreuse", Color(0.50, 1.00, 0.00)); - _named_colors.insert("chocolate", Color(0.82, 0.41, 0.12)); - _named_colors.insert("coral", Color(1.00, 0.50, 0.31)); - _named_colors.insert("cornflower", Color(0.39, 0.58, 0.93)); - _named_colors.insert("cornsilk", Color(1.00, 0.97, 0.86)); - _named_colors.insert("crimson", Color(0.86, 0.08, 0.24)); - _named_colors.insert("cyan", Color(0.00, 1.00, 1.00)); - _named_colors.insert("darkblue", Color(0.00, 0.00, 0.55)); - _named_colors.insert("darkcyan", Color(0.00, 0.55, 0.55)); - _named_colors.insert("darkgoldenrod", Color(0.72, 0.53, 0.04)); - _named_colors.insert("darkgray", Color(0.66, 0.66, 0.66)); - _named_colors.insert("darkgreen", Color(0.00, 0.39, 0.00)); - _named_colors.insert("darkkhaki", Color(0.74, 0.72, 0.42)); - _named_colors.insert("darkmagenta", Color(0.55, 0.00, 0.55)); - _named_colors.insert("darkolivegreen", Color(0.33, 0.42, 0.18)); - _named_colors.insert("darkorange", Color(1.00, 0.55, 0.00)); - _named_colors.insert("darkorchid", Color(0.60, 0.20, 0.80)); - _named_colors.insert("darkred", Color(0.55, 0.00, 0.00)); - _named_colors.insert("darksalmon", Color(0.91, 0.59, 0.48)); - _named_colors.insert("darkseagreen", Color(0.56, 0.74, 0.56)); - _named_colors.insert("darkslateblue", Color(0.28, 0.24, 0.55)); - _named_colors.insert("darkslategray", Color(0.18, 0.31, 0.31)); - _named_colors.insert("darkturquoise", Color(0.00, 0.81, 0.82)); - _named_colors.insert("darkviolet", Color(0.58, 0.00, 0.83)); - _named_colors.insert("deeppink", Color(1.00, 0.08, 0.58)); - _named_colors.insert("deepskyblue", Color(0.00, 0.75, 1.00)); - _named_colors.insert("dimgray", Color(0.41, 0.41, 0.41)); - _named_colors.insert("dodgerblue", Color(0.12, 0.56, 1.00)); - _named_colors.insert("firebrick", Color(0.70, 0.13, 0.13)); - _named_colors.insert("floralwhite", Color(1.00, 0.98, 0.94)); - _named_colors.insert("forestgreen", Color(0.13, 0.55, 0.13)); - _named_colors.insert("fuchsia", Color(1.00, 0.00, 1.00)); - _named_colors.insert("gainsboro", Color(0.86, 0.86, 0.86)); - _named_colors.insert("ghostwhite", Color(0.97, 0.97, 1.00)); - _named_colors.insert("gold", Color(1.00, 0.84, 0.00)); - _named_colors.insert("goldenrod", Color(0.85, 0.65, 0.13)); - _named_colors.insert("gray", Color(0.75, 0.75, 0.75)); - _named_colors.insert("webgray", Color(0.50, 0.50, 0.50)); - _named_colors.insert("green", Color(0.00, 1.00, 0.00)); - _named_colors.insert("webgreen", Color(0.00, 0.50, 0.00)); - _named_colors.insert("greenyellow", Color(0.68, 1.00, 0.18)); - _named_colors.insert("honeydew", Color(0.94, 1.00, 0.94)); - _named_colors.insert("hotpink", Color(1.00, 0.41, 0.71)); - _named_colors.insert("indianred", Color(0.80, 0.36, 0.36)); - _named_colors.insert("indigo", Color(0.29, 0.00, 0.51)); - _named_colors.insert("ivory", Color(1.00, 1.00, 0.94)); - _named_colors.insert("khaki", Color(0.94, 0.90, 0.55)); - _named_colors.insert("lavender", Color(0.90, 0.90, 0.98)); - _named_colors.insert("lavenderblush", Color(1.00, 0.94, 0.96)); - _named_colors.insert("lawngreen", Color(0.49, 0.99, 0.00)); - _named_colors.insert("lemonchiffon", Color(1.00, 0.98, 0.80)); - _named_colors.insert("lightblue", Color(0.68, 0.85, 0.90)); - _named_colors.insert("lightcoral", Color(0.94, 0.50, 0.50)); - _named_colors.insert("lightcyan", Color(0.88, 1.00, 1.00)); - _named_colors.insert("lightgoldenrod", Color(0.98, 0.98, 0.82)); - _named_colors.insert("lightgray", Color(0.83, 0.83, 0.83)); - _named_colors.insert("lightgreen", Color(0.56, 0.93, 0.56)); - _named_colors.insert("lightpink", Color(1.00, 0.71, 0.76)); - _named_colors.insert("lightsalmon", Color(1.00, 0.63, 0.48)); - _named_colors.insert("lightseagreen", Color(0.13, 0.70, 0.67)); - _named_colors.insert("lightskyblue", Color(0.53, 0.81, 0.98)); - _named_colors.insert("lightslategray", Color(0.47, 0.53, 0.60)); - _named_colors.insert("lightsteelblue", Color(0.69, 0.77, 0.87)); - _named_colors.insert("lightyellow", Color(1.00, 1.00, 0.88)); - _named_colors.insert("lime", Color(0.00, 1.00, 0.00)); - _named_colors.insert("limegreen", Color(0.20, 0.80, 0.20)); - _named_colors.insert("linen", Color(0.98, 0.94, 0.90)); - _named_colors.insert("magenta", Color(1.00, 0.00, 1.00)); - _named_colors.insert("maroon", Color(0.69, 0.19, 0.38)); - _named_colors.insert("webmaroon", Color(0.50, 0.00, 0.00)); - _named_colors.insert("mediumaquamarine", Color(0.40, 0.80, 0.67)); - _named_colors.insert("mediumblue", Color(0.00, 0.00, 0.80)); - _named_colors.insert("mediumorchid", Color(0.73, 0.33, 0.83)); - _named_colors.insert("mediumpurple", Color(0.58, 0.44, 0.86)); - _named_colors.insert("mediumseagreen", Color(0.24, 0.70, 0.44)); - _named_colors.insert("mediumslateblue", Color(0.48, 0.41, 0.93)); - _named_colors.insert("mediumspringgreen", Color(0.00, 0.98, 0.60)); - _named_colors.insert("mediumturquoise", Color(0.28, 0.82, 0.80)); - _named_colors.insert("mediumvioletred", Color(0.78, 0.08, 0.52)); - _named_colors.insert("midnightblue", Color(0.10, 0.10, 0.44)); - _named_colors.insert("mintcream", Color(0.96, 1.00, 0.98)); - _named_colors.insert("mistyrose", Color(1.00, 0.89, 0.88)); - _named_colors.insert("moccasin", Color(1.00, 0.89, 0.71)); - _named_colors.insert("navajowhite", Color(1.00, 0.87, 0.68)); - _named_colors.insert("navyblue", Color(0.00, 0.00, 0.50)); - _named_colors.insert("oldlace", Color(0.99, 0.96, 0.90)); - _named_colors.insert("olive", Color(0.50, 0.50, 0.00)); - _named_colors.insert("olivedrab", Color(0.42, 0.56, 0.14)); - _named_colors.insert("orange", Color(1.00, 0.65, 0.00)); - _named_colors.insert("orangered", Color(1.00, 0.27, 0.00)); - _named_colors.insert("orchid", Color(0.85, 0.44, 0.84)); - _named_colors.insert("palegoldenrod", Color(0.93, 0.91, 0.67)); - _named_colors.insert("palegreen", Color(0.60, 0.98, 0.60)); - _named_colors.insert("paleturquoise", Color(0.69, 0.93, 0.93)); - _named_colors.insert("palevioletred", Color(0.86, 0.44, 0.58)); - _named_colors.insert("papayawhip", Color(1.00, 0.94, 0.84)); - _named_colors.insert("peachpuff", Color(1.00, 0.85, 0.73)); - _named_colors.insert("peru", Color(0.80, 0.52, 0.25)); - _named_colors.insert("pink", Color(1.00, 0.75, 0.80)); - _named_colors.insert("plum", Color(0.87, 0.63, 0.87)); - _named_colors.insert("powderblue", Color(0.69, 0.88, 0.90)); - _named_colors.insert("purple", Color(0.63, 0.13, 0.94)); - _named_colors.insert("webpurple", Color(0.50, 0.00, 0.50)); - _named_colors.insert("rebeccapurple", Color(0.40, 0.20, 0.60)); - _named_colors.insert("red", Color(1.00, 0.00, 0.00)); - _named_colors.insert("rosybrown", Color(0.74, 0.56, 0.56)); - _named_colors.insert("royalblue", Color(0.25, 0.41, 0.88)); - _named_colors.insert("saddlebrown", Color(0.55, 0.27, 0.07)); - _named_colors.insert("salmon", Color(0.98, 0.50, 0.45)); - _named_colors.insert("sandybrown", Color(0.96, 0.64, 0.38)); - _named_colors.insert("seagreen", Color(0.18, 0.55, 0.34)); - _named_colors.insert("seashell", Color(1.00, 0.96, 0.93)); - _named_colors.insert("sienna", Color(0.63, 0.32, 0.18)); - _named_colors.insert("silver", Color(0.75, 0.75, 0.75)); - _named_colors.insert("skyblue", Color(0.53, 0.81, 0.92)); - _named_colors.insert("slateblue", Color(0.42, 0.35, 0.80)); - _named_colors.insert("slategray", Color(0.44, 0.50, 0.56)); - _named_colors.insert("snow", Color(1.00, 0.98, 0.98)); - _named_colors.insert("springgreen", Color(0.00, 1.00, 0.50)); - _named_colors.insert("steelblue", Color(0.27, 0.51, 0.71)); - _named_colors.insert("tan", Color(0.82, 0.71, 0.55)); - _named_colors.insert("teal", Color(0.00, 0.50, 0.50)); - _named_colors.insert("thistle", Color(0.85, 0.75, 0.85)); - _named_colors.insert("tomato", Color(1.00, 0.39, 0.28)); - _named_colors.insert("turquoise", Color(0.25, 0.88, 0.82)); - _named_colors.insert("transparent", Color(1.00, 1.00, 1.00, 0.00)); - _named_colors.insert("violet", Color(0.93, 0.51, 0.93)); - _named_colors.insert("wheat", Color(0.96, 0.87, 0.70)); - _named_colors.insert("white", Color(1.00, 1.00, 1.00)); - _named_colors.insert("whitesmoke", Color(0.96, 0.96, 0.96)); - _named_colors.insert("yellow", Color(1.00, 1.00, 0.00)); - _named_colors.insert("yellowgreen", Color(0.60, 0.80, 0.20)); + _named_colors.insert("aliceblue", Color::hex(0xF0F8FFFF)); + _named_colors.insert("antiquewhite", Color::hex(0xFAEBD7FF)); + _named_colors.insert("aqua", Color::hex(0x00FFFFFF)); + _named_colors.insert("aquamarine", Color::hex(0x7FFFD4FF)); + _named_colors.insert("azure", Color::hex(0xF0FFFFFF)); + _named_colors.insert("beige", Color::hex(0xF5F5DCFF)); + _named_colors.insert("bisque", Color::hex(0xFFE4C4FF)); + _named_colors.insert("black", Color::hex(0x000000FF)); + _named_colors.insert("blanchedalmond", Color::hex(0xFFEBCDFF)); + _named_colors.insert("blue", Color::hex(0x0000FFFF)); + _named_colors.insert("blueviolet", Color::hex(0x8A2BE2FF)); + _named_colors.insert("brown", Color::hex(0xA52A2AFF)); + _named_colors.insert("burlywood", Color::hex(0xDEB887FF)); + _named_colors.insert("cadetblue", Color::hex(0x5F9EA0FF)); + _named_colors.insert("chartreuse", Color::hex(0x7FFF00FF)); + _named_colors.insert("chocolate", Color::hex(0xD2691EFF)); + _named_colors.insert("coral", Color::hex(0xFF7F50FF)); + _named_colors.insert("cornflower", Color::hex(0x6495EDFF)); + _named_colors.insert("cornsilk", Color::hex(0xFFF8DCFF)); + _named_colors.insert("crimson", Color::hex(0xDC143CFF)); + _named_colors.insert("cyan", Color::hex(0x00FFFFFF)); + _named_colors.insert("darkblue", Color::hex(0x00008BFF)); + _named_colors.insert("darkcyan", Color::hex(0x008B8BFF)); + _named_colors.insert("darkgoldenrod", Color::hex(0xB8860BFF)); + _named_colors.insert("darkgray", Color::hex(0xA9A9A9FF)); + _named_colors.insert("darkgreen", Color::hex(0x006400FF)); + _named_colors.insert("darkkhaki", Color::hex(0xBDB76BFF)); + _named_colors.insert("darkmagenta", Color::hex(0x8B008BFF)); + _named_colors.insert("darkolivegreen", Color::hex(0x556B2FFF)); + _named_colors.insert("darkorange", Color::hex(0xFF8C00FF)); + _named_colors.insert("darkorchid", Color::hex(0x9932CCFF)); + _named_colors.insert("darkred", Color::hex(0x8B0000FF)); + _named_colors.insert("darksalmon", Color::hex(0xE9967AFF)); + _named_colors.insert("darkseagreen", Color::hex(0x8FBC8FFF)); + _named_colors.insert("darkslateblue", Color::hex(0x483D8BFF)); + _named_colors.insert("darkslategray", Color::hex(0x2F4F4FFF)); + _named_colors.insert("darkturquoise", Color::hex(0x00CED1FF)); + _named_colors.insert("darkviolet", Color::hex(0x9400D3FF)); + _named_colors.insert("deeppink", Color::hex(0xFF1493FF)); + _named_colors.insert("deepskyblue", Color::hex(0x00BFFFFF)); + _named_colors.insert("dimgray", Color::hex(0x696969FF)); + _named_colors.insert("dodgerblue", Color::hex(0x1E90FFFF)); + _named_colors.insert("firebrick", Color::hex(0xB22222FF)); + _named_colors.insert("floralwhite", Color::hex(0xFFFAF0FF)); + _named_colors.insert("forestgreen", Color::hex(0x228B22FF)); + _named_colors.insert("fuchsia", Color::hex(0xFF00FFFF)); + _named_colors.insert("gainsboro", Color::hex(0xDCDCDCFF)); + _named_colors.insert("ghostwhite", Color::hex(0xF8F8FFFF)); + _named_colors.insert("gold", Color::hex(0xFFD700FF)); + _named_colors.insert("goldenrod", Color::hex(0xDAA520FF)); + _named_colors.insert("gray", Color::hex(0xBEBEBEFF)); + _named_colors.insert("green", Color::hex(0x00FF00FF)); + _named_colors.insert("greenyellow", Color::hex(0xADFF2FFF)); + _named_colors.insert("honeydew", Color::hex(0xF0FFF0FF)); + _named_colors.insert("hotpink", Color::hex(0xFF69B4FF)); + _named_colors.insert("indianred", Color::hex(0xCD5C5CFF)); + _named_colors.insert("indigo", Color::hex(0x4B0082FF)); + _named_colors.insert("ivory", Color::hex(0xFFFFF0FF)); + _named_colors.insert("khaki", Color::hex(0xF0E68CFF)); + _named_colors.insert("lavender", Color::hex(0xE6E6FAFF)); + _named_colors.insert("lavenderblush", Color::hex(0xFFF0F5FF)); + _named_colors.insert("lawngreen", Color::hex(0x7CFC00FF)); + _named_colors.insert("lemonchiffon", Color::hex(0xFFFACDFF)); + _named_colors.insert("lightblue", Color::hex(0xADD8E6FF)); + _named_colors.insert("lightcoral", Color::hex(0xF08080FF)); + _named_colors.insert("lightcyan", Color::hex(0xE0FFFFFF)); + _named_colors.insert("lightgoldenrod", Color::hex(0xFAFAD2FF)); + _named_colors.insert("lightgray", Color::hex(0xD3D3D3FF)); + _named_colors.insert("lightgreen", Color::hex(0x90EE90FF)); + _named_colors.insert("lightpink", Color::hex(0xFFB6C1FF)); + _named_colors.insert("lightsalmon", Color::hex(0xFFA07AFF)); + _named_colors.insert("lightseagreen", Color::hex(0x20B2AAFF)); + _named_colors.insert("lightskyblue", Color::hex(0x87CEFAFF)); + _named_colors.insert("lightslategray", Color::hex(0x778899FF)); + _named_colors.insert("lightsteelblue", Color::hex(0xB0C4DEFF)); + _named_colors.insert("lightyellow", Color::hex(0xFFFFE0FF)); + _named_colors.insert("lime", Color::hex(0x00FF00FF)); + _named_colors.insert("limegreen", Color::hex(0x32CD32FF)); + _named_colors.insert("linen", Color::hex(0xFAF0E6FF)); + _named_colors.insert("magenta", Color::hex(0xFF00FFFF)); + _named_colors.insert("maroon", Color::hex(0xB03060FF)); + _named_colors.insert("mediumaquamarine", Color::hex(0x66CDAAFF)); + _named_colors.insert("mediumblue", Color::hex(0x0000CDFF)); + _named_colors.insert("mediumorchid", Color::hex(0xBA55D3FF)); + _named_colors.insert("mediumpurple", Color::hex(0x9370DBFF)); + _named_colors.insert("mediumseagreen", Color::hex(0x3CB371FF)); + _named_colors.insert("mediumslateblue", Color::hex(0x7B68EEFF)); + _named_colors.insert("mediumspringgreen", Color::hex(0x00FA9AFF)); + _named_colors.insert("mediumturquoise", Color::hex(0x48D1CCFF)); + _named_colors.insert("mediumvioletred", Color::hex(0xC71585FF)); + _named_colors.insert("midnightblue", Color::hex(0x191970FF)); + _named_colors.insert("mintcream", Color::hex(0xF5FFFAFF)); + _named_colors.insert("mistyrose", Color::hex(0xFFE4E1FF)); + _named_colors.insert("moccasin", Color::hex(0xFFE4B5FF)); + _named_colors.insert("navajowhite", Color::hex(0xFFDEADFF)); + _named_colors.insert("navyblue", Color::hex(0x000080FF)); + _named_colors.insert("oldlace", Color::hex(0xFDF5E6FF)); + _named_colors.insert("olive", Color::hex(0x808000FF)); + _named_colors.insert("olivedrab", Color::hex(0x6B8E23FF)); + _named_colors.insert("orange", Color::hex(0xFFA500FF)); + _named_colors.insert("orangered", Color::hex(0xFF4500FF)); + _named_colors.insert("orchid", Color::hex(0xDA70D6FF)); + _named_colors.insert("palegoldenrod", Color::hex(0xEEE8AAFF)); + _named_colors.insert("palegreen", Color::hex(0x98FB98FF)); + _named_colors.insert("paleturquoise", Color::hex(0xAFEEEEFF)); + _named_colors.insert("palevioletred", Color::hex(0xDB7093FF)); + _named_colors.insert("papayawhip", Color::hex(0xFFEFD5FF)); + _named_colors.insert("peachpuff", Color::hex(0xFFDAB9FF)); + _named_colors.insert("peru", Color::hex(0xCD853FFF)); + _named_colors.insert("pink", Color::hex(0xFFC0CBFF)); + _named_colors.insert("plum", Color::hex(0xDDA0DDFF)); + _named_colors.insert("powderblue", Color::hex(0xB0E0E6FF)); + _named_colors.insert("purple", Color::hex(0xA020F0FF)); + _named_colors.insert("rebeccapurple", Color::hex(0x663399FF)); + _named_colors.insert("red", Color::hex(0xFF0000FF)); + _named_colors.insert("rosybrown", Color::hex(0xBC8F8FFF)); + _named_colors.insert("royalblue", Color::hex(0x4169E1FF)); + _named_colors.insert("saddlebrown", Color::hex(0x8B4513FF)); + _named_colors.insert("salmon", Color::hex(0xFA8072FF)); + _named_colors.insert("sandybrown", Color::hex(0xF4A460FF)); + _named_colors.insert("seagreen", Color::hex(0x2E8B57FF)); + _named_colors.insert("seashell", Color::hex(0xFFF5EEFF)); + _named_colors.insert("sienna", Color::hex(0xA0522DFF)); + _named_colors.insert("silver", Color::hex(0xC0C0C0FF)); + _named_colors.insert("skyblue", Color::hex(0x87CEEBFF)); + _named_colors.insert("slateblue", Color::hex(0x6A5ACDFF)); + _named_colors.insert("slategray", Color::hex(0x708090FF)); + _named_colors.insert("snow", Color::hex(0xFFFAFAFF)); + _named_colors.insert("springgreen", Color::hex(0x00FF7FFF)); + _named_colors.insert("steelblue", Color::hex(0x4682B4FF)); + _named_colors.insert("tan", Color::hex(0xD2B48CFF)); + _named_colors.insert("teal", Color::hex(0x008080FF)); + _named_colors.insert("thistle", Color::hex(0xD8BFD8FF)); + _named_colors.insert("tomato", Color::hex(0xFF6347FF)); + _named_colors.insert("transparent", Color::hex(0xFFFFFF00)); + _named_colors.insert("turquoise", Color::hex(0x40E0D0FF)); + _named_colors.insert("violet", Color::hex(0xEE82EEFF)); + _named_colors.insert("webgray", Color::hex(0x808080FF)); + _named_colors.insert("webgreen", Color::hex(0x008000FF)); + _named_colors.insert("webmaroon", Color::hex(0x800000FF)); + _named_colors.insert("webpurple", Color::hex(0x800080FF)); + _named_colors.insert("wheat", Color::hex(0xF5DEB3FF)); + _named_colors.insert("white", Color::hex(0xFFFFFFFF)); + _named_colors.insert("whitesmoke", Color::hex(0xF5F5F5FF)); + _named_colors.insert("yellow", Color::hex(0xFFFF00FF)); + _named_colors.insert("yellowgreen", Color::hex(0x9ACD32FF)); } diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 58dce511b03..467e2a2dfae 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -280,343 +280,343 @@ - + Alice blue color. - + Antique white color. Aqua color. - + Aquamarine color. - + Azure color. - + Beige color. - + Bisque color. Black color. - + Blanche almond color. Blue color. - + Blue violet color. - + Brown color. - + Burly wood color. - + Cadet blue color. - + Chartreuse color. - + Chocolate color. - + Coral color. - + Cornflower color. - + Corn silk color. - + Crimson color. Cyan color. - + Dark blue color. - + Dark cyan color. - + Dark goldenrod color. - + Dark gray color. - + Dark green color. - + Dark khaki color. - + Dark magenta color. - + Dark olive green color. - + Dark orange color. - + Dark orchid color. - + Dark red color. - + Dark salmon color. - + Dark sea green color. - + Dark slate blue color. - + Dark slate gray color. - + Dark turquoise color. - + Dark violet color. - + Deep pink color. - + Deep sky blue color. - + Dim gray color. - + Dodger blue color. - + Firebrick color. - + Floral white color. - + Forest green color. Fuchsia color. - + Gainsboro color. - + Ghost white color. - + Gold color. - + Goldenrod color. - + Gray color. Green color. - + Green yellow color. - + Honeydew color. - + Hot pink color. - + Indian red color. - + Indigo color. - + Ivory color. - + Khaki color. - + Lavender color. - + Lavender blush color. - + Lawn green color. - + Lemon chiffon color. - + Light blue color. - + Light coral color. - + Light cyan color. - + Light goldenrod color. - + Light gray color. - + Light green color. - + Light pink color. - + Light salmon color. - + Light sea green color. - + Light sky blue color. - + Light slate gray color. - + Light steel blue color. - + Light yellow color. Lime color. - + Lime green color. - + Linen color. Magenta color. - + Maroon color. - + Medium aquamarine color. - + Medium blue color. - + Medium orchid color. - + Medium purple color. - + Medium sea green color. - + Medium slate blue color. - + Medium spring green color. - + Medium turquoise color. - + Medium violet red color. - + Midnight blue color. - + Mint cream color. - + Misty rose color. - + Moccasin color. - + Navajo white color. - + Navy blue color. - + Old lace color. - + Olive color. - + Olive drab color. - + Orange color. - + Orange red color. - + Orchid color. - + Pale goldenrod color. - + Pale green color. - + Pale turquoise color. - + Pale violet red color. - + Papaya whip color. - + Peach puff color. - + Peru color. - + Pink color. - + Plum color. - + Powder blue color. - + Purple color. @@ -625,97 +625,97 @@ Red color. - + Rosy brown color. - + Royal blue color. - + Saddle brown color. - + Salmon color. - + Sandy brown color. - + Sea green color. - + Seashell color. - + Sienna color. - + Silver color. - + Sky blue color. - + Slate blue color. - + Slate gray color. - + Snow color. - + Spring green color. - + Steel blue color. - + Tan color. - + Teal color. - + Thistle color. - + Tomato color. Transparent color (white with no alpha). - + Turquoise color. - + Violet color. - + Web gray color. - + Web green color. - + Web maroon color. - + Web purple color. - + Wheat color. White color. - + White smoke color. Yellow color. - + Yellow green color. From 658877c350dc3062d633902aac06050e1c3352e0 Mon Sep 17 00:00:00 2001 From: ztco224 Date: Thu, 17 Mar 2022 06:28:08 -0400 Subject: [PATCH 8/8] Fix DST Error on Windows (cherry picked from commit 4802f152317e5750f6d55a1cae621c9908dbdab5) --- platform/windows/os_windows.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 26409cbc5d4..e7d6209c2a9 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2400,12 +2400,19 @@ OS::Date OS_Windows::get_date(bool utc) const { else GetLocalTime(&systemtime); + // Get DST information from Windows, but only if utc is false. + TIME_ZONE_INFORMATION info; + bool daylight = false; + if (!utc && GetTimeZoneInformation(&info) == TIME_ZONE_ID_DAYLIGHT) { + daylight = true; + } + Date date; date.day = systemtime.wDay; date.month = Month(systemtime.wMonth); date.weekday = Weekday(systemtime.wDayOfWeek); date.year = systemtime.wYear; - date.dst = false; + date.dst = daylight; return date; } OS::Time OS_Windows::get_time(bool utc) const { @@ -2428,16 +2435,19 @@ OS::TimeZoneInfo OS_Windows::get_time_zone_info() const { if (GetTimeZoneInformation(&info) == TIME_ZONE_ID_DAYLIGHT) daylight = true; + // Daylight Bias needs to be added to the bias if DST is in effect, or else it will not properly update. TimeZoneInfo ret; if (daylight) { ret.name = info.DaylightName; + ret.bias = info.Bias + info.DaylightBias; } else { ret.name = info.StandardName; + ret.bias = info.Bias + info.StandardBias; } // Bias value returned by GetTimeZoneInformation is inverted of what we expect - // For example on GMT-3 GetTimeZoneInformation return a Bias of 180, so invert the value to get -180 - ret.bias = -info.Bias; + // For example, on GMT-3 GetTimeZoneInformation return a Bias of 180, so invert the value to get -180 + ret.bias = -ret.bias; return ret; }