Merge pull request #116412 from YeldhamDev/marginalized_shader_editor

Fix `ShaderEditor`'s UI overflowing when shrunk
This commit is contained in:
Thaddeus Crews 2026-03-09 15:18:12 -05:00
commit b5613b27e4
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
4 changed files with 3 additions and 10 deletions

View file

@ -30,14 +30,14 @@
#pragma once
#include "scene/gui/control.h"
#include "scene/gui/margin_container.h"
#include "scene/resources/shader.h"
class Button;
class MenuButton;
class ShaderEditor : public Control {
GDCLASS(ShaderEditor, Control);
class ShaderEditor : public MarginContainer {
GDCLASS(ShaderEditor, MarginContainer);
public:
virtual void edit_shader(const Ref<Shader> &p_shader) = 0;

View file

@ -208,7 +208,5 @@ public:
void tag_saved_version();
ShaderTextEditor *get_code_editor() { return code_editor; }
virtual Size2 get_minimum_size() const override { return Size2(0, 200); }
TextShaderEditor();
};

View file

@ -2566,10 +2566,6 @@ void VisualShaderEditor::_set_mode(int p_which) {
set_current_shader_type((VisualShader::Type)saved_type);
}
Size2 VisualShaderEditor::get_minimum_size() const {
return Size2(10, 200);
}
void VisualShaderEditor::update_toggle_files_button() {
ERR_FAIL_NULL(toggle_files_list);
bool forward = toggle_files_list->is_visible() == is_layout_rtl();

View file

@ -684,7 +684,6 @@ public:
Dictionary get_custom_node_data(Ref<VisualShaderNodeCustom> &p_custom_node);
void update_custom_type(const Ref<Resource> &p_resource);
virtual Size2 get_minimum_size() const override;
virtual void update_toggle_files_button() override;
Ref<VisualShader> get_visual_shader() const { return visual_shader; }