1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Add bulk change guards to successive theme overrides in Editor and GUI

This commit is contained in:
Yuri Sizov
2023-10-19 18:05:19 +02:00
parent f8818f85e6
commit 215e036600
24 changed files with 145 additions and 70 deletions

View File

@@ -143,25 +143,23 @@ void Texture3DEditor::edit(Ref<Texture3D> p_texture) {
Texture3DEditor::Texture3DEditor() {
set_texture_repeat(TextureRepeat::TEXTURE_REPEAT_ENABLED);
set_custom_minimum_size(Size2(1, 150));
texture_rect = memnew(Control);
texture_rect->connect("draw", callable_mp(this, &Texture3DEditor::_texture_rect_draw));
texture_rect->set_mouse_filter(MOUSE_FILTER_IGNORE);
add_child(texture_rect);
texture_rect->connect("draw", callable_mp(this, &Texture3DEditor::_texture_rect_draw));
layer = memnew(SpinBox);
layer->set_step(1);
layer->set_max(100);
layer->set_h_grow_direction(GROW_DIRECTION_BEGIN);
layer->set_modulate(Color(1, 1, 1, 0.8));
add_child(layer);
layer->set_anchor(SIDE_RIGHT, 1);
layer->set_anchor(SIDE_LEFT, 1);
layer->set_h_grow_direction(GROW_DIRECTION_BEGIN);
layer->set_modulate(Color(1, 1, 1, 0.8));
layer->connect("value_changed", callable_mp(this, &Texture3DEditor::_layer_changed));
info = memnew(Label);
add_child(info);
info->set_anchor(SIDE_RIGHT, 1);
info->set_anchor(SIDE_LEFT, 1);
info->set_anchor(SIDE_BOTTOM, 1);
info->set_anchor(SIDE_TOP, 1);
info->set_h_grow_direction(GROW_DIRECTION_BEGIN);
info->set_v_grow_direction(GROW_DIRECTION_BEGIN);
info->add_theme_color_override("font_color", Color(1, 1, 1, 1));
@@ -169,9 +167,11 @@ Texture3DEditor::Texture3DEditor() {
info->add_theme_constant_override("shadow_outline_size", 1);
info->add_theme_constant_override("shadow_offset_x", 2);
info->add_theme_constant_override("shadow_offset_y", 2);
setting = false;
layer->connect("value_changed", callable_mp(this, &Texture3DEditor::_layer_changed));
add_child(info);
info->set_anchor(SIDE_RIGHT, 1);
info->set_anchor(SIDE_LEFT, 1);
info->set_anchor(SIDE_BOTTOM, 1);
info->set_anchor(SIDE_TOP, 1);
}
Texture3DEditor::~Texture3DEditor() {