|
@@ -31,11 +31,111 @@
|
|
|
#ifndef EDITOR_THEME_MANAGER_H
|
|
|
#define EDITOR_THEME_MANAGER_H
|
|
|
|
|
|
+#include "scene/resources/style_box_flat.h"
|
|
|
#include "scene/resources/theme.h"
|
|
|
|
|
|
class EditorThemeManager {
|
|
|
+ struct ThemeConfiguration {
|
|
|
+ // Basic properties.
|
|
|
+
|
|
|
+ String preset;
|
|
|
+ bool dark_theme = false;
|
|
|
+
|
|
|
+ Color base_color;
|
|
|
+ Color accent_color;
|
|
|
+ float contrast = 1.0;
|
|
|
+ float icon_saturation = 1.0;
|
|
|
+
|
|
|
+ // Extra properties.
|
|
|
+
|
|
|
+ float extra_spacing = 0.0;
|
|
|
+ int border_width = 0;
|
|
|
+ int corner_radius = 3;
|
|
|
+
|
|
|
+ bool draw_extra_borders = false;
|
|
|
+ float relationship_line_opacity = 1.0;
|
|
|
+ int thumb_size = 16;
|
|
|
+ int class_icon_size = 16;
|
|
|
+ bool increase_scrollbar_touch_area = false;
|
|
|
+ float gizmo_handle_scale = 1.0;
|
|
|
+ int color_picker_button_height = 28;
|
|
|
+
|
|
|
+ float default_contrast = 1.0;
|
|
|
+
|
|
|
+ // Generated properties.
|
|
|
+
|
|
|
+ int base_margin = 4;
|
|
|
+ int increased_margin = 4;
|
|
|
+
|
|
|
+ int popup_margin = 12;
|
|
|
+ int window_border_margin = 8;
|
|
|
+ int top_bar_separation = 8;
|
|
|
+ int forced_even_separation = 0;
|
|
|
+
|
|
|
+ Color mono_color;
|
|
|
+ Color dark_color_1;
|
|
|
+ Color dark_color_2;
|
|
|
+ Color dark_color_3;
|
|
|
+ Color contrast_color_1;
|
|
|
+ Color contrast_color_2;
|
|
|
+ Color highlight_color;
|
|
|
+ Color highlight_disabled_color;
|
|
|
+ Color success_color;
|
|
|
+ Color warning_color;
|
|
|
+ Color error_color;
|
|
|
+ Color extra_border_color_1;
|
|
|
+ Color extra_border_color_2;
|
|
|
+
|
|
|
+ Color font_color;
|
|
|
+ Color font_focus_color;
|
|
|
+ Color font_hover_color;
|
|
|
+ Color font_pressed_color;
|
|
|
+ Color font_hover_pressed_color;
|
|
|
+ Color font_disabled_color;
|
|
|
+ Color font_readonly_color;
|
|
|
+ Color font_placeholder_color;
|
|
|
+ Color font_outline_color;
|
|
|
+
|
|
|
+ Color icon_normal_color;
|
|
|
+ Color icon_focus_color;
|
|
|
+ Color icon_hover_color;
|
|
|
+ Color icon_pressed_color;
|
|
|
+ Color icon_disabled_color;
|
|
|
+
|
|
|
+ Color shadow_color;
|
|
|
+ Color selection_color;
|
|
|
+ Color disabled_border_color;
|
|
|
+ Color disabled_bg_color;
|
|
|
+ Color separator_color;
|
|
|
+
|
|
|
+ Ref<StyleBoxFlat> base_style;
|
|
|
+ Ref<StyleBoxEmpty> base_empty_style;
|
|
|
+
|
|
|
+ Ref<StyleBoxFlat> button_style;
|
|
|
+ Ref<StyleBoxFlat> button_style_disabled;
|
|
|
+ Ref<StyleBoxFlat> button_style_focus;
|
|
|
+ Ref<StyleBoxFlat> button_style_pressed;
|
|
|
+ Ref<StyleBoxFlat> button_style_hover;
|
|
|
+
|
|
|
+ Ref<StyleBoxFlat> popup_style;
|
|
|
+ Ref<StyleBoxFlat> window_style;
|
|
|
+ Ref<StyleBoxFlat> dialog_style;
|
|
|
+ Ref<StyleBoxFlat> panel_container_style;
|
|
|
+ Ref<StyleBoxFlat> content_panel_style;
|
|
|
+ Ref<StyleBoxFlat> tree_panel_style;
|
|
|
+
|
|
|
+ Vector2 widget_margin;
|
|
|
+ };
|
|
|
|
|
|
static Ref<Theme> _create_base_theme(const Ref<Theme> &p_old_theme = nullptr);
|
|
|
+ static ThemeConfiguration _create_theme_config(const Ref<Theme> &p_theme);
|
|
|
+
|
|
|
+ static void _create_shared_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config);
|
|
|
+ static void _populate_standard_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config);
|
|
|
+ static void _populate_editor_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config);
|
|
|
+
|
|
|
+ static void _generate_text_editor_defaults(ThemeConfiguration &p_config);
|
|
|
+ static void _populate_text_editor_styles(const Ref<Theme> &p_theme, ThemeConfiguration &p_config);
|
|
|
|
|
|
public:
|
|
|
static Ref<Theme> generate_theme(const Ref<Theme> &p_old_theme = nullptr);
|