diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-03-27 15:06:18 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-03-27 15:12:23 +0800 |
commit | 66b325b7281fcecaa2393e900ba683f42020cd08 (patch) | |
tree | 182f5549ce6a2488f324e509e0ad927c923d4175 | |
parent | 9b0bee860f4d53614c218d28c9c32f88cf8b5cff (diff) | |
download | redot-engine-66b325b7281fcecaa2393e900ba683f42020cd08.tar.gz |
Fix height of subresource button in Inspector
-rw-r--r-- | editor/editor_path.cpp | 6 | ||||
-rw-r--r-- | editor/editor_path.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index 6ae25cc224..3f425c0f0b 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -35,6 +35,12 @@ #include "editor/editor_scale.h" #include "editor/multi_node_edit.h" +Size2 EditorPath::get_minimum_size() const { + Ref<Font> font = get_theme_font(SNAME("font")); + int font_size = get_theme_font_size(SNAME("font_size")); + return Button::get_minimum_size() + Size2(0, font->get_height(font_size)); +} + void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) { if (p_depth > 8) { return; diff --git a/editor/editor_path.h b/editor/editor_path.h index 747ff5a656..b6778b682e 100644 --- a/editor/editor_path.h +++ b/editor/editor_path.h @@ -61,6 +61,8 @@ protected: static void _bind_methods(); public: + virtual Size2 get_minimum_size() const override; + void update_path(); void clear_path(); void enable_path(); |