mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Fix a Wayland-related graphic bug for the status bar (#46466)
Release Notes: - Address a scenario where scaling in Wayland can cause a 1px gap above the status bar Closes #46008 --------- Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
This commit is contained in:
parent
4b01676a3b
commit
70d07f9088
1 changed files with 11 additions and 0 deletions
|
|
@ -92,6 +92,17 @@ impl Render for StatusBar {
|
|||
)
|
||||
// This border is to avoid a transparent gap in the rounded corners
|
||||
.mb(px(-1.))
|
||||
.mt({
|
||||
#[cfg(target_os = "linux")]
|
||||
let needs_gap_fix = {
|
||||
// Running on Wayland and using some scaling levels other than 100% causes a
|
||||
// 1px gap above the status bar; adding a margin avoids this.
|
||||
gpui::guess_compositor() == "Wayland" && window.scale_factor() != 1.0
|
||||
};
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let needs_gap_fix = false;
|
||||
if needs_gap_fix { px(-1.) } else { px(0.) }
|
||||
})
|
||||
.border_b(px(1.0))
|
||||
.border_color(cx.theme().colors().status_bar_background),
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue