summaryrefslogtreecommitdiffstats
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-05-14 15:57:29 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-06-18 17:24:27 +0200
commitd519715d94dc1062addcfc8efad47abb494fa4c5 (patch)
treef0a07687df7c9ce6f6d31874a44a4e0dedc836f9 /editor/editor_inspector.cpp
parentb435551682f93cf49f606d260b28e13ff5526beb (diff)
downloadredot-engine-d519715d94dc1062addcfc8efad47abb494fa4c5.tar.gz
[Scene] Add `SceneStringNames::font(_size/_color)`
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 7f21bb9ca8..9e85b276be 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -69,8 +69,8 @@ bool EditorInspector::_property_path_matches(const String &p_property_path, cons
Size2 EditorProperty::get_minimum_size() const {
Size2 ms;
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
ms.height = label.is_empty() ? 0 : font->get_height(font_size) + 4 * EDSCALE;
for (int i = 0; i < get_child_count(); i++) {
@@ -132,8 +132,8 @@ void EditorProperty::_notification(int p_what) {
{
int child_room = size.width * (1.0 - split_ratio);
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
int height = label.is_empty() ? 0 : font->get_height(font_size) + 4 * EDSCALE;
bool no_children = true;
@@ -240,8 +240,8 @@ void EditorProperty::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
bool rtl = is_layout_rtl();
Size2 size = get_size();
@@ -1251,7 +1251,7 @@ void EditorInspectorCategory::_notification(int p_what) {
w -= hs + icon_size;
}
- Color color = get_theme_color(SNAME("font_color"), SNAME("Tree"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Tree"));
if (is_layout_rtl()) {
ofs = get_size().width - ofs - w;
}
@@ -1452,7 +1452,7 @@ void EditorInspectorSection::_notification(int p_what) {
Ref<Font> font = get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
int font_size = get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
- Color font_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
if (folded && revertable_properties.size()) {
int label_width = font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, available, font_size, TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS).x;
@@ -1545,8 +1545,8 @@ Size2 EditorInspectorSection::get_minimum_size() const {
ms = ms.max(minsize);
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
ms.height += font->get_height(font_size) + get_theme_constant(SNAME("v_separation"), SNAME("Tree"));
ms.width += get_theme_constant(SNAME("inspector_margin"), EditorStringName(Editor));
@@ -2252,7 +2252,7 @@ void EditorInspectorArray::_setup() {
if (numbered) {
ae.number = memnew(Label);
- ae.number->add_theme_font_override("font", numbers_font);
+ ae.number->add_theme_font_override(SceneStringName(font), numbers_font);
ae.number->set_custom_minimum_size(Size2(numbers_min_w, 0));
ae.number->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
ae.number->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);