From fd236a4b6cb4619844c7fd0bafa6a4dc089d8019 Mon Sep 17 00:00:00 2001 From: Geequlim Date: Tue, 20 Sep 2016 20:41:57 +0800 Subject: More custom theme support for editor --- tools/editor/editor_log.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tools/editor/editor_log.cpp') diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp index 20613467d..02af9712a 100644 --- a/tools/editor/editor_log.cpp +++ b/tools/editor/editor_log.cpp @@ -161,7 +161,7 @@ void EditorLog::_undo_redo_cbk(void *p_self,const String& p_name) { void EditorLog::_bind_methods() { ObjectTypeDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request ); - + ObjectTypeDB::bind_method("_override_logger_styles",&EditorLog::_override_logger_styles ); //ObjectTypeDB::bind_method(_MD("_dragged"),&EditorLog::_dragged ); ADD_SIGNAL( MethodInfo("clear_request")); } @@ -193,11 +193,10 @@ EditorLog::EditorLog() { ec->set_custom_minimum_size(Size2(0,180)); ec->set_v_size_flags(SIZE_EXPAND_FILL); - - PanelContainer *pc = memnew( PanelContainer ); - pc->add_style_override("panel",get_stylebox("normal","TextEdit")); + pc = memnew( PanelContainer ); ec->add_child(pc); pc->set_area_as_parent_rect(); + pc->connect("enter_tree", this, "_override_logger_styles"); log = memnew( RichTextLabel ); log->set_scroll_follow(true); @@ -224,6 +223,11 @@ void EditorLog::deinit() { } +void EditorLog::_override_logger_styles() { + + pc->add_style_override("panel",get_stylebox("normal","TextEdit")); + +} EditorLog::~EditorLog() { -- cgit v1.2.3-70-g09d2