MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_theme_constant

Method get_theme_constant

scene/main/window.cpp:2521–2543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2519}
2520
2521int Window::get_theme_constant(const StringName &p_name, const StringName &p_theme_type) const {
2522 ERR_READ_THREAD_GUARD_V(0);
2523 if (!initialized) {
2524 WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description()));
2525 }
2526
2527 if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) {
2528 const int *constant = theme_constant_override.getptr(p_name);
2529 if (constant) {
2530 return *constant;
2531 }
2532 }
2533
2534 if (theme_constant_cache.has(p_theme_type) && theme_constant_cache[p_theme_type].has(p_name)) {
2535 return theme_constant_cache[p_theme_type][p_name];
2536 }
2537
2538 Vector<StringName> theme_types;
2539 theme_owner->get_theme_type_dependencies(this, p_theme_type, theme_types);
2540 int constant = theme_owner->get_theme_item_in_types(Theme::DATA_TYPE_CONSTANT, p_name, theme_types);
2541 theme_constant_cache[p_theme_type][p_name] = constant;
2542 return constant;
2543}
2544
2545Variant Window::get_theme_item(Theme::DataType p_data_type, const StringName &p_name, const StringName &p_theme_type) const {
2546 switch (p_data_type) {

Callers 7

_scene_tabs_resizedMethod · 0.45
test_tab_bar.hFile · 0.45

Calls 6

vformatFunction · 0.85
StringNameClass · 0.50
getptrMethod · 0.45
hasMethod · 0.45

Tested by 2