diff options
-rw-r--r-- | doc/classes/TabContainer.xml | 4 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 56 | ||||
-rw-r--r-- | modules/mono/csharp_script.h | 6 | ||||
-rw-r--r-- | platform/windows/display_server_windows.cpp | 24 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 4 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 2 |
6 files changed, 63 insertions, 33 deletions
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 22e92ae5d9..d56781105b 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -204,8 +204,8 @@ <theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> Font color of the currently selected tab. </theme_item> - <theme_item name="hseparation" type="int" default="4"> - Horizontal separation between tabs. + <theme_item name="icon_separation" type="int" default="4"> + Space between tab's name and its icon. </theme_item> <theme_item name="increment" type="Texture2D"> Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 6e3bdf8e41..958d72adb1 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2419,15 +2419,22 @@ bool CSharpScript::_update_exports() { StringName member_name = field->get_name(); member_info[member_name] = prop_info; + + if (exported) { #ifdef TOOLS_ENABLED - if (is_editor && exported) { - exported_members_cache.push_front(prop_info); + if (is_editor) { + exported_members_cache.push_front(prop_info); - if (tmp_object) { - exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(field->get_value(tmp_object)); + if (tmp_object) { + exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(field->get_value(tmp_object)); + } } - } #endif + +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + exported_members_names.insert(member_name); +#endif + } } } @@ -2440,21 +2447,28 @@ bool CSharpScript::_update_exports() { StringName member_name = property->get_name(); member_info[member_name] = prop_info; + + if (exported) { #ifdef TOOLS_ENABLED - if (is_editor && exported) { - exported_members_cache.push_front(prop_info); - if (tmp_object) { - MonoException *exc = nullptr; - MonoObject *ret = property->get_value(tmp_object, &exc); - if (exc) { - exported_members_defval_cache[member_name] = Variant(); - GDMonoUtils::debug_print_unhandled_exception(exc); - } else { - exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(ret); + if (is_editor) { + exported_members_cache.push_front(prop_info); + if (tmp_object) { + MonoException *exc = nullptr; + MonoObject *ret = property->get_value(tmp_object, &exc); + if (exc) { + exported_members_defval_cache[member_name] = Variant(); + GDMonoUtils::debug_print_unhandled_exception(exc); + } else { + exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(ret); + } } } - } #endif + +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + exported_members_names.insert(member_name); +#endif + } } } @@ -3591,6 +3605,16 @@ CSharpScript::~CSharpScript() { #endif } +void CSharpScript::get_members(Set<StringName> *p_members) { +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + if (p_members) { + for (Set<StringName>::Element *E = exported_members_names.front(); E; E = E->next()) { + p_members->insert(E->get()); + } + } +#endif +} + /*************** RESOURCE ***************/ RES ResourceFormatLoaderCSharpScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 52b0783a6e..0bf08ceafd 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -138,6 +138,10 @@ private: virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder); #endif +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + Set<StringName> exported_members_names; +#endif + Map<StringName, PropertyInfo> member_info; void _clear(); @@ -191,6 +195,8 @@ public: virtual void get_script_property_list(List<PropertyInfo> *p_list) const; virtual void update_exports(); + void get_members(Set<StringName> *p_members) override; + virtual bool is_tool() const { return tool; } virtual bool is_valid() const { return valid; } diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 30a3ad5a01..85acdababc 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -3074,18 +3074,6 @@ DisplayServerWindows::~DisplayServerWindows() { cursors_cache.clear(); -#if defined(VULKAN_ENABLED) - if (rendering_driver == "vulkan") { - if (rendering_device_vulkan) { - rendering_device_vulkan->finalize(); - memdelete(rendering_device_vulkan); - } - - if (context_vulkan) - memdelete(context_vulkan); - } -#endif - if (user_proc) { SetWindowLongPtr(windows[MAIN_WINDOW_ID].hWnd, GWLP_WNDPROC, (LONG_PTR)user_proc); }; @@ -3102,4 +3090,16 @@ DisplayServerWindows::~DisplayServerWindows() { } DestroyWindow(windows[MAIN_WINDOW_ID].hWnd); } + +#if defined(VULKAN_ENABLED) + if (rendering_driver == "vulkan") { + if (rendering_device_vulkan) { + rendering_device_vulkan->finalize(); + memdelete(rendering_device_vulkan); + } + + if (context_vulkan) + memdelete(context_vulkan); + } +#endif } diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 97b8362214..8c4d9a5ece 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -278,7 +278,7 @@ void TabContainer::_notification(int p_what) { Color font_color_bg = get_theme_color("font_color_bg"); Color font_color_disabled = get_theme_color("font_color_disabled"); int side_margin = get_theme_constant("side_margin"); - int icon_text_distance = get_theme_constant("hseparation"); + int icon_text_distance = get_theme_constant("icon_separation"); // Find out start and width of the header area. int header_x = side_margin; @@ -465,7 +465,7 @@ int TabContainer::_get_tab_width(int p_index) const { if (icon.is_valid()) { width += icon->get_width(); if (text != "") { - width += get_theme_constant("hseparation"); + width += get_theme_constant("icon_separation"); } } } diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index f5b987e8df..de39fac627 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -681,7 +681,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("font_color_disabled", "TabContainer", control_font_color_disabled); theme->set_constant("side_margin", "TabContainer", 8 * scale); - theme->set_constant("hseparation", "TabContainer", 4 * scale); + theme->set_constant("icon_separation", "TabContainer", 4 * scale); // Tabs |