diff options
Diffstat (limited to 'scene/theme/default_theme.cpp')
-rw-r--r-- | scene/theme/default_theme.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp index 5315b0acc9..b2a3843b02 100644 --- a/scene/theme/default_theme.cpp +++ b/scene/theme/default_theme.cpp @@ -165,11 +165,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("disabled", "Button", button_disabled); theme->set_stylebox("focus", "Button", focus); - theme->set_font("font", "Button", Ref<Font>()); - theme->set_font_size("font_size", "Button", -1); + theme->set_font(SceneStringName(font), "Button", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "Button", -1); theme->set_constant("outline_size", "Button", 0); - theme->set_color("font_color", "Button", control_font_color); + theme->set_color(SceneStringName(font_color), "Button", control_font_color); theme->set_color("font_pressed_color", "Button", control_font_pressed_color); theme->set_color("font_hover_color", "Button", control_font_hover_color); theme->set_color("font_focus_color", "Button", control_font_focus_color); @@ -195,11 +195,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox(SceneStringName(pressed), "MenuBar", button_pressed); theme->set_stylebox("disabled", "MenuBar", button_disabled); - theme->set_font("font", "MenuBar", Ref<Font>()); - theme->set_font_size("font_size", "MenuBar", -1); + theme->set_font(SceneStringName(font), "MenuBar", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "MenuBar", -1); theme->set_constant("outline_size", "MenuBar", 0); - theme->set_color("font_color", "MenuBar", control_font_color); + theme->set_color(SceneStringName(font_color), "MenuBar", control_font_color); theme->set_color("font_pressed_color", "MenuBar", control_font_pressed_color); theme->set_color("font_hover_color", "MenuBar", control_font_hover_color); theme->set_color("font_focus_color", "MenuBar", control_font_focus_color); @@ -213,10 +213,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("focus", "LinkButton", focus); - theme->set_font("font", "LinkButton", Ref<Font>()); - theme->set_font_size("font_size", "LinkButton", -1); + theme->set_font(SceneStringName(font), "LinkButton", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "LinkButton", -1); - theme->set_color("font_color", "LinkButton", control_font_color); + theme->set_color(SceneStringName(font_color), "LinkButton", control_font_color); theme->set_color("font_pressed_color", "LinkButton", control_font_pressed_color); theme->set_color("font_hover_color", "LinkButton", control_font_hover_color); theme->set_color("font_focus_color", "LinkButton", control_font_focus_color); @@ -250,10 +250,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("arrow", "OptionButton", icons["option_button_arrow"]); - theme->set_font("font", "OptionButton", Ref<Font>()); - theme->set_font_size("font_size", "OptionButton", -1); + theme->set_font(SceneStringName(font), "OptionButton", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "OptionButton", -1); - theme->set_color("font_color", "OptionButton", control_font_color); + theme->set_color(SceneStringName(font_color), "OptionButton", control_font_color); theme->set_color("font_pressed_color", "OptionButton", control_font_pressed_color); theme->set_color("font_hover_color", "OptionButton", control_font_hover_color); theme->set_color("font_hover_pressed_color", "OptionButton", control_font_pressed_color); @@ -274,10 +274,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("disabled", "MenuButton", button_disabled); theme->set_stylebox("focus", "MenuButton", focus); - theme->set_font("font", "MenuButton", Ref<Font>()); - theme->set_font_size("font_size", "MenuButton", -1); + theme->set_font(SceneStringName(font), "MenuButton", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "MenuButton", -1); - theme->set_color("font_color", "MenuButton", control_font_color); + theme->set_color(SceneStringName(font_color), "MenuButton", control_font_color); theme->set_color("font_pressed_color", "MenuButton", control_font_pressed_color); theme->set_color("font_hover_color", "MenuButton", control_font_hover_color); theme->set_color("font_focus_color", "MenuButton", control_font_focus_color); @@ -310,10 +310,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("radio_unchecked", "CheckBox", icons["radio_unchecked"]); theme->set_icon("radio_unchecked_disabled", "CheckBox", icons["radio_unchecked_disabled"]); - theme->set_font("font", "CheckBox", Ref<Font>()); - theme->set_font_size("font_size", "CheckBox", -1); + theme->set_font(SceneStringName(font), "CheckBox", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "CheckBox", -1); - theme->set_color("font_color", "CheckBox", control_font_color); + theme->set_color(SceneStringName(font_color), "CheckBox", control_font_color); theme->set_color("font_pressed_color", "CheckBox", control_font_pressed_color); theme->set_color("font_hover_color", "CheckBox", control_font_hover_color); theme->set_color("font_hover_pressed_color", "CheckBox", control_font_pressed_color); @@ -347,10 +347,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("unchecked_mirrored", "CheckButton", icons["toggle_off_mirrored"]); theme->set_icon("unchecked_disabled_mirrored", "CheckButton", icons["toggle_off_disabled_mirrored"]); - theme->set_font("font", "CheckButton", Ref<Font>()); - theme->set_font_size("font_size", "CheckButton", -1); + theme->set_font(SceneStringName(font), "CheckButton", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "CheckButton", -1); - theme->set_color("font_color", "CheckButton", control_font_color); + theme->set_color(SceneStringName(font_color), "CheckButton", control_font_color); theme->set_color("font_pressed_color", "CheckButton", control_font_pressed_color); theme->set_color("font_hover_color", "CheckButton", control_font_hover_color); theme->set_color("font_hover_pressed_color", "CheckButton", control_font_pressed_color); @@ -387,10 +387,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // Label theme->set_stylebox(CoreStringName(normal), "Label", memnew(StyleBoxEmpty)); - theme->set_font("font", "Label", Ref<Font>()); - theme->set_font_size("font_size", "Label", -1); + theme->set_font(SceneStringName(font), "Label", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "Label", -1); - theme->set_color("font_color", "Label", Color(1, 1, 1)); + theme->set_color(SceneStringName(font_color), "Label", Color(1, 1, 1)); theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0)); theme->set_color("font_outline_color", "Label", Color(0, 0, 0)); @@ -401,13 +401,13 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_constant("line_spacing", "Label", Math::round(3 * scale)); theme->set_type_variation("HeaderSmall", "Label"); - theme->set_font_size("font_size", "HeaderSmall", default_font_size + 4); + theme->set_font_size(SceneStringName(font_size), "HeaderSmall", default_font_size + 4); theme->set_type_variation("HeaderMedium", "Label"); - theme->set_font_size("font_size", "HeaderMedium", default_font_size + 8); + theme->set_font_size(SceneStringName(font_size), "HeaderMedium", default_font_size + 8); theme->set_type_variation("HeaderLarge", "Label"); - theme->set_font_size("font_size", "HeaderLarge", default_font_size + 12); + theme->set_font_size(SceneStringName(font_size), "HeaderLarge", default_font_size + 12); // LineEdit @@ -425,10 +425,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const style_line_edit_read_only->set_border_color(style_pressed_color * Color(1, 1, 1, 0.5)); theme->set_stylebox("read_only", "LineEdit", style_line_edit_read_only); - theme->set_font("font", "LineEdit", Ref<Font>()); - theme->set_font_size("font_size", "LineEdit", -1); + theme->set_font(SceneStringName(font), "LineEdit", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "LineEdit", -1); - theme->set_color("font_color", "LineEdit", control_font_color); + theme->set_color(SceneStringName(font_color), "LineEdit", control_font_color); theme->set_color("font_selected_color", "LineEdit", control_font_pressed_color); theme->set_color("font_uneditable_color", "LineEdit", control_font_disabled_color); theme->set_color("font_placeholder_color", "LineEdit", control_font_placeholder_color); @@ -449,10 +449,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("background", "ProgressBar", make_flat_stylebox(style_disabled_color, 2, 2, 2, 2, 6)); theme->set_stylebox("fill", "ProgressBar", make_flat_stylebox(style_progress_color, 2, 2, 2, 2, 6)); - theme->set_font("font", "ProgressBar", Ref<Font>()); - theme->set_font_size("font_size", "ProgressBar", -1); + theme->set_font(SceneStringName(font), "ProgressBar", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "ProgressBar", -1); - theme->set_color("font_color", "ProgressBar", control_font_hover_color); + theme->set_color(SceneStringName(font_color), "ProgressBar", control_font_hover_color); theme->set_color("font_outline_color", "ProgressBar", Color(0, 0, 0)); theme->set_constant("outline_size", "ProgressBar", 0); @@ -466,11 +466,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("tab", "TextEdit", icons["text_edit_tab"]); theme->set_icon("space", "TextEdit", icons["text_edit_space"]); - theme->set_font("font", "TextEdit", Ref<Font>()); - theme->set_font_size("font_size", "TextEdit", -1); + theme->set_font(SceneStringName(font), "TextEdit", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "TextEdit", -1); theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); - theme->set_color("font_color", "TextEdit", control_font_color); + theme->set_color(SceneStringName(font_color), "TextEdit", control_font_color); theme->set_color("font_selected_color", "TextEdit", Color(0, 0, 0, 0)); theme->set_color("font_readonly_color", "TextEdit", control_font_disabled_color); theme->set_color("font_placeholder_color", "TextEdit", control_font_placeholder_color); @@ -505,8 +505,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("folded_code_region", "CodeEdit", icons["region_folded"]); theme->set_icon("folded_eol_icon", "CodeEdit", icons["text_edit_ellipsis"]); - theme->set_font("font", "CodeEdit", Ref<Font>()); - theme->set_font_size("font_size", "CodeEdit", -1); + theme->set_font(SceneStringName(font), "CodeEdit", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "CodeEdit", -1); theme->set_color("background_color", "CodeEdit", Color(0, 0, 0, 0)); theme->set_color("completion_background_color", "CodeEdit", Color(0.17, 0.16, 0.2)); @@ -514,7 +514,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("completion_existing_color", "CodeEdit", Color(0.87, 0.87, 0.87, 0.13)); theme->set_color("completion_scroll_color", "CodeEdit", control_font_pressed_color * Color(1, 1, 1, 0.29)); theme->set_color("completion_scroll_hovered_color", "CodeEdit", control_font_pressed_color * Color(1, 1, 1, 0.4)); - theme->set_color("font_color", "CodeEdit", control_font_color); + theme->set_color(SceneStringName(font_color), "CodeEdit", control_font_color); theme->set_color("font_selected_color", "CodeEdit", Color(0, 0, 0, 0)); theme->set_color("font_readonly_color", "CodeEdit", Color(control_font_color.r, control_font_color.g, control_font_color.b, 0.5f)); theme->set_color("font_placeholder_color", "CodeEdit", control_font_placeholder_color); @@ -699,12 +699,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("submenu", "PopupMenu", icons["popup_menu_arrow_right"]); theme->set_icon("submenu_mirrored", "PopupMenu", icons["popup_menu_arrow_left"]); - theme->set_font("font", "PopupMenu", Ref<Font>()); + theme->set_font(SceneStringName(font), "PopupMenu", Ref<Font>()); theme->set_font("font_separator", "PopupMenu", Ref<Font>()); - theme->set_font_size("font_size", "PopupMenu", -1); + theme->set_font_size(SceneStringName(font_size), "PopupMenu", -1); theme->set_font_size("font_separator_size", "PopupMenu", -1); - theme->set_color("font_color", "PopupMenu", control_font_color); + theme->set_color(SceneStringName(font_color), "PopupMenu", control_font_color); theme->set_color("font_accelerator_color", "PopupMenu", Color(0.7, 0.7, 0.7, 0.8)); theme->set_color("font_disabled_color", "PopupMenu", Color(0.4, 0.4, 0.4, 0.8)); theme->set_color("font_hover_color", "PopupMenu", control_font_color); @@ -749,9 +749,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_type_variation("GraphNodeTitleLabel", "Label"); theme->set_stylebox(CoreStringName(normal), "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0)); - theme->set_font("font", "GraphNodeTitleLabel", Ref<Font>()); - theme->set_font_size("font_size", "GraphNodeTitleLabel", -1); - theme->set_color("font_color", "GraphNodeTitleLabel", control_font_color); + theme->set_font(SceneStringName(font), "GraphNodeTitleLabel", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "GraphNodeTitleLabel", -1); + theme->set_color(SceneStringName(font_color), "GraphNodeTitleLabel", control_font_color); theme->set_color("font_shadow_color", "GraphNodeTitleLabel", Color(0, 0, 0, 0)); theme->set_color("font_outline_color", "GraphNodeTitleLabel", Color(0, 0, 0)); theme->set_constant("shadow_offset_x", "GraphNodeTitleLabel", Math::round(1 * scale)); @@ -780,8 +780,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_type_variation("GraphFrameTitleLabel", "Label"); theme->set_stylebox(CoreStringName(normal), "GraphFrameTitleLabel", memnew(StyleBoxEmpty)); - theme->set_font_size("font_size", "GraphFrameTitleLabel", 22); - theme->set_color("font_color", "GraphFrameTitleLabel", Color(1, 1, 1)); + theme->set_font_size(SceneStringName(font_size), "GraphFrameTitleLabel", 22); + theme->set_color(SceneStringName(font_color), "GraphFrameTitleLabel", Color(1, 1, 1)); theme->set_color("font_shadow_color", "GraphFrameTitleLabel", Color(0, 0, 0, 0)); theme->set_color("font_outline_color", "GraphFrameTitleLabel", Color(1, 1, 1)); theme->set_constant("shadow_offset_x", "GraphFrameTitleLabel", 1 * scale); @@ -819,12 +819,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("arrow_collapsed_mirrored", "Tree", icons["arrow_left"]); theme->set_font("title_button_font", "Tree", Ref<Font>()); - theme->set_font("font", "Tree", Ref<Font>()); - theme->set_font_size("font_size", "Tree", -1); + theme->set_font(SceneStringName(font), "Tree", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "Tree", -1); theme->set_font_size("title_button_font_size", "Tree", -1); theme->set_color("title_button_color", "Tree", control_font_color); - theme->set_color("font_color", "Tree", control_font_low_color); + theme->set_color(SceneStringName(font_color), "Tree", control_font_low_color); theme->set_color("font_selected_color", "Tree", control_font_pressed_color); theme->set_color("font_disabled_color", "Tree", control_font_disabled_color); theme->set_color("font_outline_color", "Tree", Color(0, 0, 0)); @@ -869,10 +869,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_constant("icon_margin", "ItemList", Math::round(4 * scale)); theme->set_constant(SceneStringName(line_separation), "ItemList", Math::round(2 * scale)); - theme->set_font("font", "ItemList", Ref<Font>()); - theme->set_font_size("font_size", "ItemList", -1); + theme->set_font(SceneStringName(font), "ItemList", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "ItemList", -1); - theme->set_color("font_color", "ItemList", control_font_lower_color); + theme->set_color(SceneStringName(font_color), "ItemList", control_font_lower_color); theme->set_color("font_hovered_color", "ItemList", control_font_hover_color); theme->set_color("font_selected_color", "ItemList", control_font_pressed_color); theme->set_color("font_outline_color", "ItemList", Color(0, 0, 0)); @@ -917,8 +917,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("menu", "TabContainer", icons["tabs_menu"]); theme->set_icon("menu_highlight", "TabContainer", icons["tabs_menu_hl"]); - theme->set_font("font", "TabContainer", Ref<Font>()); - theme->set_font_size("font_size", "TabContainer", -1); + theme->set_font(SceneStringName(font), "TabContainer", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "TabContainer", -1); theme->set_color("font_selected_color", "TabContainer", control_font_hover_color); theme->set_color("font_hovered_color", "TabContainer", control_font_hover_color); @@ -949,8 +949,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("drop_mark", "TabBar", icons["tabs_drop_mark"]); theme->set_icon("close", "TabBar", icons["close"]); - theme->set_font("font", "TabBar", Ref<Font>()); - theme->set_font_size("font_size", "TabBar", -1); + theme->set_font(SceneStringName(font), "TabBar", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "TabBar", -1); theme->set_color("font_selected_color", "TabBar", control_font_hover_color); theme->set_color("font_hovered_color", "TabBar", control_font_hover_color); @@ -1058,10 +1058,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("disabled", "ColorPickerButton", button_disabled); theme->set_stylebox("focus", "ColorPickerButton", focus); - theme->set_font("font", "ColorPickerButton", Ref<Font>()); - theme->set_font_size("font_size", "ColorPickerButton", -1); + theme->set_font(SceneStringName(font), "ColorPickerButton", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "ColorPickerButton", -1); - theme->set_color("font_color", "ColorPickerButton", Color(1, 1, 1, 1)); + theme->set_color(SceneStringName(font_color), "ColorPickerButton", Color(1, 1, 1, 1)); theme->set_color("font_pressed_color", "ColorPickerButton", Color(0.8, 0.8, 0.8, 1)); theme->set_color("font_hover_color", "ColorPickerButton", Color(1, 1, 1, 1)); theme->set_color("font_focus_color", "ColorPickerButton", Color(1, 1, 1, 1)); @@ -1089,10 +1089,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const make_flat_stylebox(Color(0, 0, 0, 0.5), 2 * default_margin, 0.5 * default_margin, 2 * default_margin, 0.5 * default_margin)); theme->set_type_variation("TooltipLabel", "Label"); - theme->set_font_size("font_size", "TooltipLabel", -1); - theme->set_font("font", "TooltipLabel", Ref<Font>()); + theme->set_font_size(SceneStringName(font_size), "TooltipLabel", -1); + theme->set_font(SceneStringName(font), "TooltipLabel", Ref<Font>()); - theme->set_color("font_color", "TooltipLabel", control_font_color); + theme->set_color(SceneStringName(font_color), "TooltipLabel", control_font_color); theme->set_color("font_shadow_color", "TooltipLabel", Color(0, 0, 0, 0)); theme->set_color("font_outline_color", "TooltipLabel", Color(0, 0, 0)); |