From a29a6809209f54c412a1774b7bf6d4f5ca28f51f Mon Sep 17 00:00:00 2001 From: Hendrik Brucker Date: Fri, 14 Jul 2023 22:35:39 +0200 Subject: [PATCH] Extract StyleBoxFlat, StyleBoxTexture and StyleBoxLine in their own file --- editor/editor_inspector.cpp | 1 + editor/editor_inspector.h | 1 + editor/editor_themes.cpp | 3 + editor/gui/editor_toaster.cpp | 1 + editor/gui/editor_toaster.h | 1 + .../animation_blend_tree_editor_plugin.cpp | 1 + .../animation_state_machine_editor.cpp | 1 + editor/plugins/canvas_item_editor_plugin.cpp | 1 + editor/plugins/canvas_item_editor_plugin.h | 3 +- editor/plugins/style_box_editor_plugin.cpp | 1 + editor/plugins/texture_region_editor_plugin.h | 2 +- .../plugins/visual_shader_editor_plugin.cpp | 1 + scene/gui/color_picker.cpp | 2 + scene/gui/color_picker.h | 1 + scene/gui/graph_edit.cpp | 1 + scene/register_scene_types.cpp | 3 + .../resources/default_theme/default_theme.cpp | 2 + scene/resources/style_box.cpp | 924 ------------------ scene/resources/style_box.h | 188 +--- scene/resources/style_box_flat.cpp | 642 ++++++++++++ scene/resources/style_box_flat.h | 118 +++ scene/resources/style_box_line.cpp | 132 +++ scene/resources/style_box_line.h | 70 ++ scene/resources/style_box_texture.cpp | 243 +++++ scene/resources/style_box_texture.h | 99 ++ tests/scene/test_theme.h | 1 + 26 files changed, 1334 insertions(+), 1109 deletions(-) create mode 100644 scene/resources/style_box_flat.cpp create mode 100644 scene/resources/style_box_flat.h create mode 100644 scene/resources/style_box_line.cpp create mode 100644 scene/resources/style_box_line.h create mode 100644 scene/resources/style_box_texture.cpp create mode 100644 scene/resources/style_box_texture.h diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 367373dc1764..d95b1de36580 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -45,6 +45,7 @@ #include "scene/gui/texture_rect.h" #include "scene/property_utils.h" #include "scene/resources/packed_scene.h" +#include "scene/resources/style_box_flat.h" bool EditorInspector::_property_path_matches(const String &p_property_path, const String &p_filter, EditorPropertyNameProcessor::Style p_style) { if (p_property_path.findn(p_filter) != -1) { diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index a5737b7dc69e..9a4c4f7f9924 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -44,6 +44,7 @@ class OptionButton; class PanelContainer; class PopupMenu; class SpinBox; +class StyleBoxFlat; class TextureRect; class EditorPropertyRevert { diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 92c111a418e0..99feee42b85e 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -37,6 +37,9 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "scene/resources/image_texture.h" +#include "scene/resources/style_box_flat.h" +#include "scene/resources/style_box_line.h" +#include "scene/resources/style_box_texture.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp index 866a6db2a65b..f928a0fd30e9 100644 --- a/editor/gui/editor_toaster.cpp +++ b/editor/gui/editor_toaster.cpp @@ -35,6 +35,7 @@ #include "scene/gui/button.h" #include "scene/gui/label.h" #include "scene/gui/panel_container.h" +#include "scene/resources/style_box_flat.h" EditorToaster *EditorToaster::singleton = nullptr; diff --git a/editor/gui/editor_toaster.h b/editor/gui/editor_toaster.h index 4837756b4eff..3e39d9d5191a 100644 --- a/editor/gui/editor_toaster.h +++ b/editor/gui/editor_toaster.h @@ -37,6 +37,7 @@ class Button; class PanelContainer; +class StyleBoxFlat; class EditorToaster : public HBoxContainer { GDCLASS(EditorToaster, HBoxContainer); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index ea210872f7c4..1abf9d57cec5 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -48,6 +48,7 @@ #include "scene/gui/separator.h" #include "scene/gui/view_panner.h" #include "scene/main/window.h" +#include "scene/resources/style_box_flat.h" void AnimationNodeBlendTreeEditor::add_custom_type(const String &p_name, const Ref