1
0
Fork 0
forked from wry/wry

renderer: fix overextended borders for floating windows w/ title gaps

This commit is contained in:
atagen 2026-04-07 12:14:48 +10:00
parent fc3c39bded
commit 381c5f8478

View file

@ -683,31 +683,44 @@ impl Renderer<'_> {
theme.colors.unfocused_title_background.get()
};
let uc = theme.colors.separator.get();
let gap = theme.sizes.gap.get();
let floating_title = theme.floating_titles.get() && gap != 0;
let srgb_srgb = self.state.color_manager.srgb_gamma22();
let srgb = &srgb_srgb.linear;
let perceptual = RenderIntent::Perceptual;
if floating_title {
let title_frame = [
Rect::new_sized_saturating(x, y, pos.width(), bw),
Rect::new_sized_saturating(x, y + bw, bw, th),
Rect::new_sized_saturating(x + pos.width() - bw, y + bw, bw, th),
Rect::new_sized_saturating(x, y + bw + th, pos.width(), bw),
];
self.base.fill_boxes(&title_frame, &bc, srgb, perceptual);
let title_bg = [Rect::new_sized_saturating(x + bw, y + bw, pos.width() - 2 * bw, th)];
self.base.fill_boxes(&title_bg, &tc, srgb, perceptual);
let body_top = y + tpuh;
let body_inner_top = y + bw + tpuh;
let body_inner_height = pos.height() - 2 * bw - tpuh;
let body_frame = [
Rect::new_sized_saturating(x, body_top, pos.width(), bw),
Rect::new_sized_saturating(x, body_inner_top, bw, body_inner_height),
Rect::new_sized_saturating(x + pos.width() - bw, body_inner_top, bw, body_inner_height),
Rect::new_sized_saturating(x, y + pos.height() - bw, pos.width(), bw),
];
self.base.fill_boxes(&body_frame, &bc, srgb, perceptual);
} else {
let borders = [
Rect::new_sized_saturating(x, y, pos.width(), bw),
Rect::new_sized_saturating(x, y + bw, bw, pos.height() - bw),
Rect::new_sized_saturating(x + pos.width() - bw, y + bw, bw, pos.height() - bw),
Rect::new_sized_saturating(x + bw, y + pos.height() - bw, pos.width() - 2 * bw, bw),
];
let srgb_srgb = self.state.color_manager.srgb_gamma22();
let srgb = &srgb_srgb.linear;
let perceptual = RenderIntent::Perceptual;
self.base.fill_boxes(&borders, &bc, srgb, perceptual);
let title = [Rect::new_sized_saturating(
x + bw,
y + bw,
pos.width() - 2 * bw,
th,
)];
let title = [Rect::new_sized_saturating(x + bw, y + bw, pos.width() - 2 * bw, th)];
self.base.fill_boxes(&title, &tc, srgb, perceptual);
let title_underline = [Rect::new_sized_saturating(
x + bw,
y + bw + th,
pos.width() - 2 * bw,
tuh,
)];
self.base
.fill_boxes(&title_underline, &uc, srgb, perceptual);
let title_underline = [Rect::new_sized_saturating(x + bw, y + bw + th, pos.width() - 2 * bw, tuh)];
self.base.fill_boxes(&title_underline, &uc, srgb, perceptual);
}
let rect = floating.title_rect.get().move_(x, y);
let bounds = self.base.scale_rect(rect);
let (mut x1, y1) = rect.position();