You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
This commit is contained in:
@@ -139,7 +139,7 @@ void ProgressDialog::_popup() {
|
||||
Size2 ms = main->get_combined_minimum_size();
|
||||
ms.width = MAX(500 * EDSCALE, ms.width);
|
||||
|
||||
Ref<StyleBox> style = main->get_theme_stylebox("panel", "PopupMenu");
|
||||
Ref<StyleBox> style = main->get_theme_stylebox(SNAME("panel"), SNAME("PopupMenu"));
|
||||
ms += style->get_minimum_size();
|
||||
main->set_offset(SIDE_LEFT, style->get_margin(SIDE_LEFT));
|
||||
main->set_offset(SIDE_RIGHT, -style->get_margin(SIDE_RIGHT));
|
||||
|
||||
Reference in New Issue
Block a user