Skip to content

Commit 93946ea

Browse files
committed
Use monospaced font for code names (methods, signals, properties)
Add monospace font styling to more items in signal workflow Use monospace font in method and property selection dialogs
1 parent 250ef8d commit 93946ea

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

editor/inspector/property_selector.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include "editor/doc/editor_help.h"
3434
#include "editor/editor_node.h"
35+
#include "editor/editor_string_names.h"
3536
#include "editor/themes/editor_scale.h"
3637
#include "scene/gui/line_edit.h"
3738
#include "scene/gui/tree.h"
@@ -145,6 +146,7 @@ void PropertySelector::_update_search() {
145146

146147
TreeItem *item = search_options->create_item(category ? category : root);
147148
item->set_text(0, E.name);
149+
item->set_custom_font(0, get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
148150
item->set_metadata(0, E.name);
149151
item->set_icon(0, search_options->get_editor_theme_icon(Variant::get_type_name(E.type)));
150152

@@ -306,6 +308,7 @@ void PropertySelector::_update_search() {
306308
}
307309

308310
item->set_text(0, desc);
311+
item->set_custom_font(0, get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
309312
item->set_metadata(0, name);
310313
item->set_selectable(0, true);
311314

@@ -504,6 +507,7 @@ void PropertySelector::_create_subproperty(TreeItem *p_parent_item, const String
504507

505508
TreeItem *item = search_options->create_item(p_parent_item);
506509
item->set_text(0, p_name);
510+
item->set_custom_font(0, get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
507511
item->set_metadata(0, String(p_parent_item->get_metadata(0)) + ":" + p_name);
508512
item->set_icon(0, search_options->get_editor_theme_icon(Variant::get_type_name(p_type)));
509513

editor/scene/connections_dialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ void ConnectDialog::_create_method_tree_items(const List<MethodInfo> &p_methods,
315315
for (const MethodInfo &mi : p_methods) {
316316
TreeItem *method_item = method_tree->create_item(p_parent_item);
317317
method_item->set_text(0, get_signature(mi));
318+
method_item->set_custom_font(0, get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
318319
method_item->set_metadata(0, mi.name);
319320
}
320321
}
@@ -535,6 +536,9 @@ void ConnectDialog::_notification(int p_what) {
535536
case NOTIFICATION_THEME_CHANGED: {
536537
method_search->set_right_icon(get_editor_theme_icon("Search"));
537538
open_method_tree->set_button_icon(get_editor_theme_icon("Edit"));
539+
540+
from_signal->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
541+
dst_method->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
538542
} break;
539543
}
540544
}
@@ -1641,6 +1645,7 @@ void ConnectionsDock::update_tree() {
16411645
TreeItem *signal_item = tree->create_item(section_item);
16421646
String signame = connect_dialog->get_signature(mi, &argnames);
16431647
signal_item->set_text(0, signame);
1648+
signal_item->set_custom_font(0, get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
16441649

16451650
if (signame == prev_selected) {
16461651
signal_item->select(0);
@@ -1699,6 +1704,7 @@ void ConnectionsDock::update_tree() {
16991704
connection_item->set_text(0, path);
17001705
connection_item->set_metadata(0, connection);
17011706
connection_item->set_icon(0, get_editor_theme_icon(SNAME("Slot")));
1707+
connection_item->set_custom_font(0, get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
17021708

17031709
if (_is_connection_inherited(connection)) {
17041710
// The scene inherits this connection.

0 commit comments

Comments
 (0)