summaryrefslogtreecommitdiff
path: root/editor/editor_themes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_themes.cpp')
-rw-r--r--editor/editor_themes.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index de0c3f55cc..4661fcf668 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -568,6 +568,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("modulate_arrow", "OptionButton", true);
// CheckButton
+ theme->set_stylebox("normal", "CheckButton", style_menu);
+ theme->set_stylebox("pressed", "CheckButton", style_menu);
+ theme->set_stylebox("disabled", "CheckButton", style_menu);
+ theme->set_stylebox("hover", "CheckButton", style_menu);
+
theme->set_icon("on", "CheckButton", theme->get_icon("GuiToggleOn", "EditorIcons"));
theme->set_icon("off", "CheckButton", theme->get_icon("GuiToggleOff", "EditorIcons"));
@@ -577,7 +582,22 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_color_disabled", "CheckButton", font_color_disabled);
theme->set_color("icon_color_hover", "CheckButton", font_color_hl);
+ theme->set_constant("hseparation", "CheckButton", 4 * EDSCALE);
+ theme->set_constant("check_vadjust", "CheckButton", 0 * EDSCALE);
+
// Checkbox
+ Ref<StyleBoxFlat> sb_checkbox = style_menu->duplicate();
+ // HACK, in reality, the checkbox draws the text over the icon by default, so the margin compensates that.
+ const int cb_w = theme->get_icon("GuiChecked", "EditorIcons")->get_width() + default_margin_size;
+ sb_checkbox->set_default_margin(MARGIN_LEFT, cb_w * EDSCALE);
+ sb_checkbox->set_default_margin(MARGIN_RIGHT, default_margin_size * EDSCALE);
+ sb_checkbox->set_default_margin(MARGIN_TOP, default_margin_size * EDSCALE);
+ sb_checkbox->set_default_margin(MARGIN_BOTTOM, default_margin_size * EDSCALE);
+
+ theme->set_stylebox("normal", "CheckBox", sb_checkbox);
+ theme->set_stylebox("pressed", "CheckBox", sb_checkbox);
+ theme->set_stylebox("disabled", "CheckBox", sb_checkbox);
+ theme->set_stylebox("hover", "CheckBox", sb_checkbox);
theme->set_icon("checked", "CheckBox", theme->get_icon("GuiChecked", "EditorIcons"));
theme->set_icon("unchecked", "CheckBox", theme->get_icon("GuiUnchecked", "EditorIcons"));
theme->set_icon("radio_checked", "CheckBox", theme->get_icon("GuiRadioChecked", "EditorIcons"));
@@ -589,6 +609,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_color_disabled", "CheckBox", font_color_disabled);
theme->set_color("icon_color_hover", "CheckBox", font_color_hl);
+ theme->set_constant("hseparation", "CheckBox", 4 * EDSCALE);
+ theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE);
+
// PopupMenu
Ref<StyleBoxFlat> style_popup_menu = style_popup;
theme->set_stylebox("panel", "PopupMenu", style_popup_menu);
@@ -715,6 +738,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("button", "Tabs", style_menu);
theme->set_icon("increment", "TabContainer", theme->get_icon("GuiScrollArrowRight", "EditorIcons"));
theme->set_icon("decrement", "TabContainer", theme->get_icon("GuiScrollArrowLeft", "EditorIcons"));
+ theme->set_icon("increment", "Tabs", theme->get_icon("GuiScrollArrowRight", "EditorIcons"));
+ theme->set_icon("decrement", "Tabs", theme->get_icon("GuiScrollArrowLeft", "EditorIcons"));
+ theme->set_icon("increment_highlight", "Tabs", theme->get_icon("GuiScrollArrowRight", "EditorIcons"));
+ theme->set_icon("decrement_highlight", "Tabs", theme->get_icon("GuiScrollArrowLeft", "EditorIcons"));
+ theme->set_icon("increment_highlight", "TabContainer", theme->get_icon("GuiScrollArrowRight", "EditorIcons"));
+ theme->set_icon("decrement_highlight", "TabContainer", theme->get_icon("GuiScrollArrowLeft", "EditorIcons"));
+ theme->set_constant("hseparation", "Tabs", 4 * EDSCALE);
// Content of each tab
Ref<StyleBoxFlat> style_content_panel = style_default->duplicate();
@@ -763,6 +793,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
// TextEdit
theme->set_stylebox("normal", "TextEdit", style_widget);
theme->set_stylebox("focus", "TextEdit", style_widget_hover);
+ theme->set_stylebox("read_only", "TextEdit", style_widget_disabled);
theme->set_constant("side_margin", "TabContainer", 0);
theme->set_icon("tab", "TextEdit", theme->get_icon("GuiTab", "EditorIcons"));
theme->set_color("font_color", "TextEdit", font_color);
@@ -1008,6 +1039,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color member_variable_color = mono_color;
const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3);
const Color breakpoint_color = error_color;
+ const Color code_folding_color = alpha4;
const Color search_result_color = alpha1;
const Color search_result_border_color = alpha4;
@@ -1038,18 +1070,21 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("text_editor/theme/member_variable_color", "Editor", member_variable_color);
theme->set_color("text_editor/theme/mark_color", "Editor", mark_color);
theme->set_color("text_editor/theme/breakpoint_color", "Editor", breakpoint_color);
+ theme->set_color("text_editor/theme/code_folding_color", "Editor", code_folding_color);
theme->set_color("text_editor/theme/search_result_color", "Editor", search_result_color);
theme->set_color("text_editor/theme/search_result_border_color", "Editor", search_result_border_color);
return theme;
}
-Ref<Theme> create_custom_theme() {
- Ref<Theme> theme = create_editor_theme();
+Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) {
+ Ref<Theme> theme;
String custom_theme = EditorSettings::get_singleton()->get("interface/theme/custom_theme");
if (custom_theme != "") {
theme = ResourceLoader::load(custom_theme);
+ } else {
+ theme = create_editor_theme(p_theme);
}
String global_font = EditorSettings::get_singleton()->get("interface/editor/custom_font");