diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_help.cpp | 6 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 18 | ||||
-rw-r--r-- | editor/editor_sectioned_inspector.cpp | 13 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 20 |
4 files changed, 28 insertions, 29 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 97f5363bb8..de89cd8df4 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -567,6 +567,8 @@ void EditorHelp::_update_doc() { class_desc->pop(); // font class_desc->add_newline(); + const String non_breaking_space = String::chr(160); + // Inheritance tree // Ascendents @@ -579,7 +581,7 @@ void EditorHelp::_update_doc() { while (!inherits.is_empty()) { _add_type_icon(inherits); - class_desc->add_text(" "); // Extra space, otherwise icon borrows hyperlink from _add_type(). + class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type(). _add_type(inherits); inherits = doc->class_list[inherits].inherits; @@ -612,7 +614,7 @@ void EditorHelp::_update_doc() { class_desc->add_text(" , "); } _add_type_icon(E.value.name); - class_desc->add_text(" "); // Extra space, otherwise icon borrows hyperlink from _add_type(). + class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type(). _add_type(E.value.name); prev = true; } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index d78fee6ad6..7364258a07 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -4182,8 +4182,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, const Varian } struct EditorPropertyRangeHint { - bool greater = true; - bool lesser = true; + bool or_greater = true; + bool or_less = true; double min = -99999.0; double max = 99999.0; double step = 1.0; @@ -4201,8 +4201,8 @@ static EditorPropertyRangeHint _parse_range_hint(PropertyHint p_hint, const Stri ERR_FAIL_COND_V_MSG(slices.size() < 2, hint, vformat("Invalid PROPERTY_HINT_RANGE with hint \"%s\": Missing required min and/or max values.", p_hint_text)); - hint.greater = false; // If using ranged, assume false by default. - hint.lesser = false; + hint.or_greater = false; // If using ranged, assume false by default. + hint.or_less = false; hint.min = slices[0].to_float(); hint.max = slices[1].to_float(); @@ -4215,9 +4215,9 @@ static EditorPropertyRangeHint _parse_range_hint(PropertyHint p_hint, const Stri for (int i = 2; i < slices.size(); i++) { String slice = slices[i].strip_edges(); if (slice == "or_greater") { - hint.greater = true; - } else if (slice == "or_lesser") { - hint.lesser = true; + hint.or_greater = true; + } else if (slice == "or_less") { + hint.or_less = true; } else if (slice == "no_slider") { hint.hide_slider = true; } else if (slice == "exp") { @@ -4314,7 +4314,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ EditorPropertyInteger *editor = memnew(EditorPropertyInteger); EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1); - editor->setup(hint.min, hint.max, hint.step, hint.greater, hint.lesser, hint.suffix); + editor->setup(hint.min, hint.max, hint.step, hint.or_greater, hint.or_less, hint.suffix); return editor; } @@ -4342,7 +4342,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ EditorPropertyFloat *editor = memnew(EditorPropertyFloat); EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, default_float_step); - editor->setup(hint.min, hint.max, hint.step, hint.hide_slider, hint.exp_range, hint.greater, hint.lesser, hint.suffix, hint.radians); + editor->setup(hint.min, hint.max, hint.step, hint.hide_slider, hint.exp_range, hint.or_greater, hint.or_less, hint.suffix, hint.radians); return editor; } diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index 94ee741db5..e078bea037 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -113,18 +113,13 @@ class SectionedInspectorFilter : public Object { } } - bool property_can_revert(const StringName &p_name) { + bool _property_can_revert(const StringName &p_name) const { return edited->property_can_revert(section + "/" + p_name); } - Variant property_get_revert(const StringName &p_name) { - return edited->property_get_revert(section + "/" + p_name); - } - -protected: - static void _bind_methods() { - ClassDB::bind_method("property_can_revert", &SectionedInspectorFilter::property_can_revert); - ClassDB::bind_method("property_get_revert", &SectionedInspectorFilter::property_get_revert); + bool _property_get_revert(const StringName &p_name, Variant &r_property) const { + r_property = edited->property_get_revert(section + "/" + p_name); + return true; } public: diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index d0bb63dde9..76d5daadfb 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -182,7 +182,7 @@ static Ref<StyleBoxFlat> make_flat_stylebox(Color p_color, float p_margin_left = Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); style->set_bg_color(p_color); // Adjust level of detail based on the corners' effective sizes. - style->set_corner_detail(Math::ceil(1.5 * p_corner_width * EDSCALE)); + style->set_corner_detail(Math::ceil(0.8 * p_corner_width * EDSCALE)); style->set_corner_radius_all(p_corner_width * EDSCALE); style->set_default_margin(SIDE_LEFT, p_margin_left * EDSCALE); style->set_default_margin(SIDE_RIGHT, p_margin_right * EDSCALE); @@ -593,7 +593,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { Ref<StyleBoxFlat> style_default = make_flat_stylebox(base_color, default_margin_size, default_margin_size, default_margin_size, default_margin_size, corner_width); style_default->set_border_width_all(border_width); style_default->set_border_color(base_color); - style_default->set_draw_center(true); // Button and widgets const float extra_spacing = EDITOR_GET("interface/theme/additional_spacing"); @@ -635,6 +634,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const Color shadow_color = Color(0, 0, 0, dark_theme ? 0.3 : 0.1); style_popup->set_shadow_color(shadow_color); style_popup->set_shadow_size(4 * EDSCALE); + // Popups are separate windows by default in the editor. Windows currently don't support per-pixel transparency + // in 4.0, and even if it was, it may not always work in practice (e.g. running with compositing disabled). + style_popup->set_corner_radius_all(0); Ref<StyleBoxLine> style_popup_separator(memnew(StyleBoxLine)); style_popup_separator->set_color(separator_color); @@ -661,10 +663,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_tab_base->set_border_width_all(0); // Don't round the top corners to avoid creating a small blank space between the tabs and the main panel. // This also makes the top highlight look better. - style_tab_base->set_corner_detail(corner_width); - style_tab_base->set_corner_radius_all(0); - style_tab_base->set_corner_radius(CORNER_TOP_LEFT, corner_radius * EDSCALE); - style_tab_base->set_corner_radius(CORNER_TOP_RIGHT, corner_radius * EDSCALE); + style_tab_base->set_corner_radius(CORNER_BOTTOM_LEFT, 0); + style_tab_base->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); // Prevent visible artifacts and cover the top-left rounded corner of the panel below the tab if selected // We can't prevent them with both rounded corners and non-zero border width, though @@ -975,9 +975,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Always display a border for PopupMenus so they can be distinguished from their background. style_popup_menu->set_border_width_all(EDSCALE); style_popup_menu->set_border_color(dark_color_2); - // Popups are separate windows by default in the editor. Windows currently don't support per-pixel transparency - // in 4.0, and even if it was, it may not always work in practice (e.g. running with compositing disabled). - style_popup_menu->set_corner_radius_all(0); theme->set_stylebox("panel", "PopupMenu", style_popup_menu); Ref<StyleBoxFlat> style_menu_hover = style_widget_hover->duplicate(); @@ -1653,6 +1650,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { graphsbcomment->set_border_width(SIDE_TOP, 24 * EDSCALE); graphsbcommentselected->set_border_width(SIDE_TOP, 24 * EDSCALE); + graphsb->set_corner_detail(corner_radius * EDSCALE); + graphsbselected->set_corner_detail(corner_radius * EDSCALE); + graphsbcomment->set_corner_detail(corner_radius * EDSCALE); + graphsbcommentselected->set_corner_detail(corner_radius * EDSCALE); + theme->set_stylebox("frame", "GraphNode", graphsb); theme->set_stylebox("selected_frame", "GraphNode", graphsbselected); theme->set_stylebox("comment", "GraphNode", graphsbcomment); |