Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions editor/scene/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4469,15 +4469,16 @@ void CanvasItemEditor::_update_scrollbars() {
}

// Move and resize the scrollbars, avoiding overlap.
const real_t sb_margin = 4 * EDSCALE;
if (is_layout_rtl()) {
v_scroll->set_begin(Point2(0, (show_rulers) ? ruler_width_scaled : 0));
v_scroll->set_end(Point2(vmin.width, size.height - (h_scroll->is_visible() ? hmin.height : 0)));
v_scroll->set_begin(Point2(sb_margin, (show_rulers) ? ruler_width_scaled + sb_margin : sb_margin));
v_scroll->set_end(Point2(vmin.width + sb_margin, size.height - (h_scroll->is_visible() ? hmin.height : 0) - sb_margin));
} else {
v_scroll->set_begin(Point2(size.width - vmin.width, (show_rulers) ? ruler_width_scaled : 0));
v_scroll->set_end(Point2(size.width, size.height - (h_scroll->is_visible() ? hmin.height : 0)));
v_scroll->set_begin(Point2(size.width - vmin.width - sb_margin, (show_rulers) ? ruler_width_scaled + sb_margin : sb_margin));
v_scroll->set_end(Point2(size.width - sb_margin, size.height - (h_scroll->is_visible() ? hmin.height : 0) - sb_margin));
}
h_scroll->set_begin(Point2((show_rulers) ? ruler_width_scaled : 0, size.height - hmin.height));
h_scroll->set_end(Point2(size.width - (v_scroll->is_visible() ? vmin.width : 0), size.height));
h_scroll->set_begin(Point2((show_rulers) ? ruler_width_scaled + sb_margin : sb_margin, size.height - hmin.height - sb_margin));
h_scroll->set_end(Point2(size.width - (v_scroll->is_visible() ? vmin.width : 0) - sb_margin, size.height - sb_margin));

// Calculate scrollable area.
v_scroll->set_value(view_offset.y);
Expand Down
16 changes: 7 additions & 9 deletions editor/themes/theme_modern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ void ThemeModern::populate_standard_styles(const Ref<EditorTheme> &p_theme, Edit
p_theme->set_constant("scrollbar_margin_top", "Tree", 0);
p_theme->set_constant("scrollbar_margin_right", "Tree", 0);
p_theme->set_constant("scrollbar_margin_bottom", "Tree", 0);
p_theme->set_constant("scrollbar_h_separation", "Tree", 1 * EDSCALE);
p_theme->set_constant("scrollbar_v_separation", "Tree", 1 * EDSCALE);
p_theme->set_constant("scrollbar_h_separation", "Tree", p_config.base_margin * EDSCALE);
p_theme->set_constant("scrollbar_v_separation", "Tree", p_config.base_margin * EDSCALE);

Color relationship_line_color = p_config.mono_color * Color(1, 1, 1, p_config.relationship_line_opacity);
Color highlight_line_color = p_config.mono_color * Color(1, 1, 1, p_config.relationship_line_opacity * 2);
Expand Down Expand Up @@ -1028,16 +1028,12 @@ void ThemeModern::populate_standard_styles(const Ref<EditorTheme> &p_theme, Edit
Ref<Texture2D> empty_icon = memnew(ImageTexture);

Ref<StyleBoxFlat> grabber_style = p_config.base_style->duplicate();
grabber_style->set_bg_color(_get_base_color(p_config, 0.5, 0.6));
grabber_style->set_border_color(p_config.base_color * Color(1, 1, 1, 0));
grabber_style->set_border_width_all(3 * EDSCALE);
grabber_style->set_bg_color(p_config.mono_color * Color(1, 1, 1, 0.225));

Ref<StyleBoxFlat> grabber_hl_style = p_config.base_style->duplicate();
grabber_hl_style->set_bg_color(_get_base_color(p_config, 1.4, 0.5));
grabber_hl_style->set_border_color(_get_base_color(p_config) * Color(1, 1, 1, 0));
grabber_hl_style->set_border_width_all(2.5 * EDSCALE);
grabber_hl_style->set_bg_color(p_config.mono_color * Color(1, 1, 1, 0.5));

int scroll_margin = (p_config.enable_touch_optimizations ? 12 : 6) * EDSCALE;
int scroll_margin = (p_config.enable_touch_optimizations ? 9 : 3) * EDSCALE;

// HScrollBar.

Expand Down Expand Up @@ -1542,6 +1538,8 @@ void ThemeModern::populate_editor_styles(const Ref<EditorTheme> &p_theme, Editor

p_theme->set_stylebox(SceneStringName(panel), "ScrollContainer", p_config.base_empty_style);
p_theme->set_stylebox("focus", "ScrollContainer", p_config.focus_style);
p_theme->set_constant("scrollbar_h_separation", "ScrollContainer", p_config.base_margin * EDSCALE);
p_theme->set_constant("scrollbar_v_separation", "ScrollContainer", p_config.base_margin * EDSCALE);

// This stylebox is used in 3d and 2d viewports (no borders).
Ref<StyleBoxFlat> style_content_panel_vp = p_config.content_panel_style->duplicate();
Expand Down