You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +00:00
Improve style changed signal in EditorDock
This commit is contained in:
@@ -39,6 +39,10 @@ void EditorDock::_set_default_slot_bind(EditorPlugin::DockSlot p_slot) {
|
||||
default_slot = (DockConstants::DockSlot)p_slot;
|
||||
}
|
||||
|
||||
void EditorDock::_emit_changed() {
|
||||
emit_signal(SNAME("_tab_style_changed"));
|
||||
}
|
||||
|
||||
void EditorDock::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("open"), &EditorDock::open);
|
||||
ClassDB::bind_method(D_METHOD("make_visible"), &EditorDock::make_visible);
|
||||
@@ -90,9 +94,10 @@ void EditorDock::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_available_layouts", "layouts"), &EditorDock::set_available_layouts);
|
||||
ClassDB::bind_method(D_METHOD("get_available_layouts"), &EditorDock::get_available_layouts);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "available_layouts", PROPERTY_HINT_FLAGS, "Vertical:1,Horizontal:2,Floating:3"), "set_available_layouts", "get_available_layouts");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "available_layouts", PROPERTY_HINT_FLAGS, "Vertical:1,Horizontal:2,Floating:4"), "set_available_layouts", "get_available_layouts");
|
||||
|
||||
ADD_SIGNAL(MethodInfo("closed"));
|
||||
ADD_SIGNAL(MethodInfo("_tab_style_changed"));
|
||||
|
||||
BIND_BITFIELD_FLAG(DOCK_LAYOUT_VERTICAL);
|
||||
BIND_BITFIELD_FLAG(DOCK_LAYOUT_HORIZONTAL);
|
||||
@@ -104,10 +109,6 @@ void EditorDock::_bind_methods() {
|
||||
GDVIRTUAL_BIND(_load_layout_from_config, "config", "section");
|
||||
}
|
||||
|
||||
EditorDock::EditorDock() {
|
||||
add_user_signal(MethodInfo("tab_style_changed"));
|
||||
}
|
||||
|
||||
void EditorDock::open() {
|
||||
if (!is_open) {
|
||||
EditorDockManager::get_singleton()->open_dock(this, false);
|
||||
@@ -129,7 +130,7 @@ void EditorDock::set_title(const String &p_title) {
|
||||
return;
|
||||
}
|
||||
title = p_title;
|
||||
emit_signal("tab_style_changed");
|
||||
_emit_changed();
|
||||
}
|
||||
|
||||
void EditorDock::set_global(bool p_global) {
|
||||
@@ -147,7 +148,7 @@ void EditorDock::set_icon_name(const StringName &p_name) {
|
||||
return;
|
||||
}
|
||||
icon_name = p_name;
|
||||
emit_signal("tab_style_changed");
|
||||
_emit_changed();
|
||||
}
|
||||
|
||||
void EditorDock::set_dock_icon(const Ref<Texture2D> &p_icon) {
|
||||
@@ -155,7 +156,7 @@ void EditorDock::set_dock_icon(const Ref<Texture2D> &p_icon) {
|
||||
return;
|
||||
}
|
||||
dock_icon = p_icon;
|
||||
emit_signal("tab_style_changed");
|
||||
_emit_changed();
|
||||
}
|
||||
|
||||
void EditorDock::set_force_show_icon(bool p_force) {
|
||||
@@ -163,7 +164,7 @@ void EditorDock::set_force_show_icon(bool p_force) {
|
||||
return;
|
||||
}
|
||||
force_show_icon = p_force;
|
||||
emit_signal("tab_style_changed");
|
||||
_emit_changed();
|
||||
}
|
||||
|
||||
void EditorDock::set_title_color(const Color &p_color) {
|
||||
@@ -171,7 +172,7 @@ void EditorDock::set_title_color(const Color &p_color) {
|
||||
return;
|
||||
}
|
||||
title_color = p_color;
|
||||
emit_signal("tab_style_changed");
|
||||
_emit_changed();
|
||||
}
|
||||
|
||||
void EditorDock::set_dock_shortcut(const Ref<Shortcut> &p_shortcut) {
|
||||
|
||||
Reference in New Issue
Block a user