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.cpp57
1 files changed, 18 insertions, 39 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index b33c36867a..08bb976bcc 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -426,19 +426,19 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
Ref<StyleBoxEmpty> style_empty = make_empty_stylebox(default_margin_size, default_margin_size, default_margin_size, default_margin_size);
// Tabs
- const int tab_default_margin_side = 10 * EDSCALE;
Ref<StyleBoxFlat> style_tab_selected = style_widget->duplicate();
+
style_tab_selected->set_border_width_all(border_width);
style_tab_selected->set_border_width(MARGIN_BOTTOM, 0);
style_tab_selected->set_border_color_all(dark_color_3);
style_tab_selected->set_expand_margin_size(MARGIN_BOTTOM, border_width);
- style_tab_selected->set_default_margin(MARGIN_LEFT, tab_default_margin_side);
- style_tab_selected->set_default_margin(MARGIN_RIGHT, tab_default_margin_side);
+ style_tab_selected->set_default_margin(MARGIN_LEFT, 10 * EDSCALE);
+ style_tab_selected->set_default_margin(MARGIN_RIGHT, 10 * EDSCALE);
style_tab_selected->set_bg_color(tab_color);
Ref<StyleBoxFlat> style_tab_unselected = style_tab_selected->duplicate();
- style_tab_unselected->set_bg_color(Color(0.0, 0.0, 0.0, 0.0));
- style_tab_unselected->set_border_color_all(Color(0.0, 0.0, 0.0, 0.0));
+ style_tab_unselected->set_draw_center(false);
+ style_tab_unselected->set_border_width_all(0);
// Editor background
theme->set_stylebox("Background", "EditorStyles", make_flat_stylebox(background_color, default_margin_size, default_margin_size, default_margin_size, default_margin_size));
@@ -688,29 +688,18 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, border_width));
theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, border_width, 0, true));
- // HACK Debuger panel
+ // Debugger
+
Ref<StyleBoxFlat> style_panel_debugger = style_content_panel->duplicate();
- const int v_offset = theme->get_font("font", "Tabs")->get_height() + style_tab_selected->get_minimum_size().height + default_margin_size * EDSCALE;
- style_panel_debugger->set_expand_margin_size(MARGIN_TOP, -v_offset);
- theme->set_stylebox("debugger_panel", "EditorStyles", style_panel_debugger);
+ style_panel_debugger->set_border_width(MARGIN_BOTTOM, 0);
+ theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger);
+ theme->set_stylebox("DebuggerTabFG", "EditorStyles", style_tab_selected);
+ theme->set_stylebox("DebuggerTabBG", "EditorStyles", style_tab_unselected);
- // Debugger
- Ref<StyleBoxFlat> style_debugger_contents = style_content_panel->duplicate();
- style_debugger_contents->set_default_margin(MARGIN_LEFT, 0);
- style_debugger_contents->set_default_margin(MARGIN_BOTTOM, 0);
- style_debugger_contents->set_default_margin(MARGIN_RIGHT, 0);
- style_debugger_contents->set_border_width_all(0);
- style_debugger_contents->set_expand_margin_size(MARGIN_TOP, -v_offset);
- theme->set_constant("extra_margin", "DebuggerPanel", default_margin_size * EDSCALE + border_width);
- theme->set_stylebox("DebuggerPanel", "EditorStyles", style_debugger_contents);
- Ref<StyleBoxFlat> style_tab_fg_debugger = style_tab_selected->duplicate();
- style_tab_fg_debugger->set_expand_margin_size(MARGIN_LEFT, default_margin_size * EDSCALE + border_width);
- style_tab_fg_debugger->set_default_margin(MARGIN_LEFT, tab_default_margin_side - default_margin_size * EDSCALE);
- theme->set_stylebox("DebuggerTabFG", "EditorStyles", style_tab_fg_debugger);
- Ref<StyleBoxFlat> style_tab_bg_debugger = style_tab_unselected->duplicate();
- style_tab_bg_debugger->set_expand_margin_size(MARGIN_LEFT, default_margin_size * EDSCALE + border_width);
- style_tab_bg_debugger->set_default_margin(MARGIN_LEFT, tab_default_margin_side - default_margin_size * EDSCALE);
- theme->set_stylebox("DebuggerTabBG", "EditorStyles", style_tab_bg_debugger);
+ Ref<StyleBoxFlat> style_panel_invisible_top = style_content_panel->duplicate();
+ int stylebox_offset = theme->get_font("tab_fg", "TabContainer")->get_height() + theme->get_stylebox("tab_fg", "TabContainer")->get_minimum_size().height + theme->get_stylebox("panel", "TabContainer")->get_default_margin(MARGIN_TOP);
+ style_panel_invisible_top->set_expand_margin_size(MARGIN_TOP, -stylebox_offset);
+ theme->set_stylebox("BottomPanelDebuggerOverride", "EditorStyles", style_panel_invisible_top);
// LineEdit
theme->set_stylebox("normal", "LineEdit", style_widget);
@@ -809,21 +798,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("grabber_area", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0));
//RichTextLabel
- Color rtl_combined_bg_color = dark_color_1.linear_interpolate(script_bg_color, script_bg_color.a);
- Color rtl_mono_color = (rtl_combined_bg_color.r + rtl_combined_bg_color.g + rtl_combined_bg_color.b > 1.5) ? Color(0, 0, 0) : Color(1, 1, 1);
- Color rtl_font_color = rtl_mono_color.linear_interpolate(rtl_combined_bg_color, 0.25);
- theme->set_color("default_color", "RichTextLabel", rtl_font_color);
+ theme->set_color("default_color", "RichTextLabel", font_color);
theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
theme->set_stylebox("normal", "RichTextLabel", style_tree_bg);
- Ref<StyleBoxFlat> style_code = style_tree_bg->duplicate();
- style_code->set_bg_color(rtl_combined_bg_color);
- theme->set_stylebox("code_normal", "RichTextLabel", style_code);
- Ref<StyleBoxFlat> style_code_focus = style_tree_focus->duplicate();
- style_code_focus->set_bg_color(rtl_combined_bg_color);
- theme->set_stylebox("code_focus", "RichTextLabel", style_code_focus);
- theme->set_color("font_color", "RichTextLabel", rtl_font_color);
- theme->set_color("highlight_color", "RichTextLabel", rtl_mono_color);
+ theme->set_color("headline_color", "EditorHelp", mono_color);
// Panel
theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4));
@@ -990,7 +969,7 @@ Ref<Theme> create_custom_theme() {
theme = ResourceLoader::load(custom_theme);
}
- String global_font = EditorSettings::get_singleton()->get("interface/custom_font");
+ String global_font = EditorSettings::get_singleton()->get("interface/editor/custom_font");
if (global_font != "") {
Ref<Font> fnt = ResourceLoader::load(global_font);
if (fnt.is_valid()) {