You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Fix accessing editor theme items throughout the UI
This also exposes `EditorInterface::get_editor_theme`.
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/control.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/resources/theme.h"
|
||||
|
||||
EditorInterface *EditorInterface::singleton = nullptr;
|
||||
|
||||
@@ -196,6 +197,10 @@ bool EditorInterface::is_plugin_enabled(const String &p_plugin) const {
|
||||
|
||||
// Editor GUI.
|
||||
|
||||
Ref<Theme> EditorInterface::get_editor_theme() const {
|
||||
return EditorNode::get_singleton()->get_editor_theme();
|
||||
}
|
||||
|
||||
Control *EditorInterface::get_base_control() const {
|
||||
return EditorNode::get_singleton()->get_gui_base();
|
||||
}
|
||||
@@ -405,6 +410,7 @@ void EditorInterface::_bind_methods() {
|
||||
|
||||
// Editor GUI.
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_editor_theme"), &EditorInterface::get_editor_theme);
|
||||
ClassDB::bind_method(D_METHOD("get_base_control"), &EditorInterface::get_base_control);
|
||||
ClassDB::bind_method(D_METHOD("get_editor_main_screen"), &EditorInterface::get_editor_main_screen);
|
||||
ClassDB::bind_method(D_METHOD("get_script_editor"), &EditorInterface::get_script_editor);
|
||||
|
||||
Reference in New Issue
Block a user