1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Use 75% editor scale on small displays automatically

This also makes borders always display in the editor theme,
even if the editor scale is below 100%. Otherwise, "focus" outlines
would vanish when using an editor scale below 100%,
which harms usability.
This commit is contained in:
Hugo Locurcio
2020-11-17 11:17:41 +01:00
parent d0a5ef9c7a
commit fc5e60f4cc
3 changed files with 65 additions and 36 deletions

View File

@@ -445,7 +445,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
// Highlighted tabs and border width
Color tab_color = highlight_tabs ? base_color.linear_interpolate(font_color, contrast) : base_color;
const int border_width = CLAMP(border_size, 0, 3) * EDSCALE;
// Ensure borders are visible when using an editor scale below 100%.
const int border_width = CLAMP(border_size, 0, 3) * MAX(1, EDSCALE);
const int default_margin_size = 4;
const int margin_size_extra = default_margin_size + CLAMP(border_size, 0, 3);