diff options
author | kobewi <kobewi4e@gmail.com> | 2024-11-22 01:09:24 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2024-11-22 21:42:50 +0100 |
commit | 289e548e3477afe73a509cd3888b0dbb716735cb (patch) | |
tree | 380e1e6897eceaf5b544afcf9877a329c228bea1 | |
parent | 9e6098432aac35bae42c9089a29ba2a80320d823 (diff) | |
download | redot-engine-289e548e3477afe73a509cd3888b0dbb716735cb.tar.gz |
Untangle ColorPicker includes
-rw-r--r-- | editor/editor_properties.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/theme_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/theme_editor_preview.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | scene/gui/color_mode.h | 2 | ||||
-rw-r--r-- | scene/gui/color_picker.cpp | 20 | ||||
-rw-r--r-- | scene/gui/color_picker.h | 40 |
10 files changed, 42 insertions, 34 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 2b2b32eb22..9b3304254b 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -52,6 +52,7 @@ #include "scene/3d/fog_volume.h" #include "scene/3d/gpu_particles_3d.h" #include "scene/gui/color_picker.h" +#include "scene/gui/grid_container.h" #include "scene/main/window.h" #include "scene/resources/font.h" #include "scene/resources/mesh.h" diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 810d1674ca..2e50b7c019 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -92,6 +92,7 @@ #include "scene/gui/center_container.h" #include "scene/gui/color_picker.h" #include "scene/gui/flow_container.h" +#include "scene/gui/separator.h" #include "scene/gui/split_container.h" #include "scene/gui/subviewport_container.h" #include "scene/resources/3d/sky_material.h" diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 49ecbac751..2ed819baf4 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -64,6 +64,8 @@ #include "editor/themes/editor_scale.h" #include "editor/themes/editor_theme_manager.h" #include "editor/window_wrapper.h" +#include "scene/gui/separator.h" +#include "scene/gui/texture_rect.h" #include "scene/main/node.h" #include "scene/main/window.h" #include "script_text_editor.h" diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index cf586c792e..a28d709b15 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -40,6 +40,7 @@ #include "editor/editor_string_names.h" #include "editor/gui/editor_toaster.h" #include "editor/themes/editor_scale.h" +#include "scene/gui/menu_button.h" #include "scene/gui/rich_text_label.h" #include "scene/gui/split_container.h" diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index de75ed8c12..b5ddf2f48b 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -48,6 +48,8 @@ #include "scene/gui/option_button.h" #include "scene/gui/panel_container.h" #include "scene/gui/scroll_container.h" +#include "scene/gui/separator.h" +#include "scene/gui/spin_box.h" #include "scene/gui/split_container.h" #include "scene/gui/tab_bar.h" #include "scene/gui/tab_container.h" diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index ea5e8a8ad7..3790b23f76 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -41,9 +41,15 @@ #include "scene/gui/check_button.h" #include "scene/gui/color_picker.h" #include "scene/gui/color_rect.h" +#include "scene/gui/label.h" #include "scene/gui/margin_container.h" +#include "scene/gui/menu_button.h" +#include "scene/gui/option_button.h" +#include "scene/gui/panel.h" #include "scene/gui/progress_bar.h" #include "scene/gui/scroll_container.h" +#include "scene/gui/separator.h" +#include "scene/gui/spin_box.h" #include "scene/gui/tab_container.h" #include "scene/gui/text_edit.h" #include "scene/gui/tree.h" diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 8249596045..28f2913f0b 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -59,6 +59,7 @@ #include "scene/gui/rich_text_label.h" #include "scene/gui/separator.h" #include "scene/gui/split_container.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/tree.h" #include "scene/gui/view_panner.h" #include "scene/main/window.h" diff --git a/scene/gui/color_mode.h b/scene/gui/color_mode.h index 0abc90bb44..b762097dc3 100644 --- a/scene/gui/color_mode.h +++ b/scene/gui/color_mode.h @@ -33,8 +33,6 @@ #include "scene/gui/color_picker.h" -struct Color; - class ColorMode { public: ColorPicker *color_picker = nullptr; diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 997120ff25..d370ab2ac8 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -30,21 +30,25 @@ #include "color_picker.h" -#include "core/input/input.h" #include "core/io/image.h" -#include "core/math/color.h" +#include "scene/gui/aspect_ratio_container.h" #include "scene/gui/color_mode.h" +#include "scene/gui/grid_container.h" +#include "scene/gui/label.h" +#include "scene/gui/line_edit.h" #include "scene/gui/margin_container.h" +#include "scene/gui/menu_button.h" +#include "scene/gui/option_button.h" +#include "scene/gui/popup_menu.h" +#include "scene/gui/slider.h" +#include "scene/gui/spin_box.h" +#include "scene/gui/texture_rect.h" #include "scene/resources/image_texture.h" #include "scene/resources/style_box_flat.h" #include "scene/resources/style_box_texture.h" #include "scene/theme/theme_db.h" -#include "servers/display_server.h" #include "thirdparty/misc/ok_color_shader.h" -List<Color> ColorPicker::preset_cache; -List<Color> ColorPicker::recent_preset_cache; - void ColorPicker::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { @@ -159,10 +163,6 @@ void ColorPicker::_update_theme_item_cache() { theme_cache.base_scale = get_theme_default_base_scale(); } -Ref<Shader> ColorPicker::wheel_shader; -Ref<Shader> ColorPicker::circle_shader; -Ref<Shader> ColorPicker::circle_ok_color_shader; - void ColorPicker::init_shaders() { wheel_shader.instantiate(); wheel_shader->set_code(R"( diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 59540d9ace..be40f5ab67 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -31,28 +31,24 @@ #ifndef COLOR_PICKER_H #define COLOR_PICKER_H -#include "scene/gui/aspect_ratio_container.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" -#include "scene/gui/control.h" -#include "scene/gui/grid_container.h" -#include "scene/gui/label.h" -#include "scene/gui/line_edit.h" -#include "scene/gui/menu_button.h" -#include "scene/gui/option_button.h" -#include "scene/gui/panel.h" #include "scene/gui/popup.h" -#include "scene/gui/separator.h" -#include "scene/gui/slider.h" -#include "scene/gui/spin_box.h" -#include "scene/gui/texture_rect.h" -#include "scene/resources/style_box_flat.h" +class AspectRatioContainer; class ColorMode; -class ColorModeRGB; -class ColorModeHSV; -class ColorModeRAW; -class ColorModeOKHSL; +class ColorPickerShape; +class GridContainer; +class HSlider; +class Label; +class LineEdit; +class MarginContainer; +class MenuButton; +class OptionButton; +class PopupMenu; +class SpinBox; +class StyleBoxFlat; +class TextureRect; class ColorPresetButton : public BaseButton { GDCLASS(ColorPresetButton, BaseButton); @@ -110,11 +106,11 @@ public: static const int SLIDER_COUNT = 4; private: - static Ref<Shader> wheel_shader; - static Ref<Shader> circle_shader; - static Ref<Shader> circle_ok_color_shader; - static List<Color> preset_cache; - static List<Color> recent_preset_cache; + static inline Ref<Shader> wheel_shader; + static inline Ref<Shader> circle_shader; + static inline Ref<Shader> circle_ok_color_shader; + static inline List<Color> preset_cache; + static inline List<Color> recent_preset_cache; #ifdef TOOLS_ENABLED Object *editor_settings = nullptr; |