1
0
Fork 0
forked from wry/wry

theme: add bar-position setting

This commit is contained in:
Stipe Kotarac 2025-11-28 21:26:15 +01:00
parent 3ea687a5c8
commit 2500c05f70
15 changed files with 178 additions and 32 deletions

View file

@ -66,6 +66,7 @@ use {
},
ahash::AHashMap,
jay_config::{
theme::BarPosition,
video::{TearingMode as ConfigTearingMode, Transform, VrrMode as ConfigVrrMode},
workspace::WorkspaceDisplayOrder,
},
@ -807,11 +808,23 @@ impl OutputNode {
let mut workspace_rect_rel = non_exclusive_rect_rel;
if self.state.show_bar.get() {
let underline_rect;
bar_rect = Rect::new_sized_unchecked(x1, y1, width, bh);
underline_rect = Rect::new_sized_unchecked(x1, y1 + bh, width, 1);
bar_rect_with_underline = Rect::new_sized_unchecked(x1, y1, width, bh + 1);
workspace_rect =
Rect::new_sized_unchecked(x1, y1 + bh + 1, width, (height - bh - 1).max(0));
match self.state.theme.bar_position.get() {
BarPosition::Bottom => {
workspace_rect =
Rect::new_sized_unchecked(x1, y1, width, (height - bh - 1).max(0));
bar_rect_with_underline =
Rect::new_sized_unchecked(x1, y1 + height - bh - 1, width, bh + 1);
underline_rect = Rect::new_sized_unchecked(x1, y1 + height - bh - 1, width, 1);
bar_rect = Rect::new_sized_unchecked(x1, y1 + height - bh, width, bh);
}
BarPosition::Top | _ => {
bar_rect = Rect::new_sized_unchecked(x1, y1, width, bh);
underline_rect = Rect::new_sized_unchecked(x1, y1 + bh, width, 1);
bar_rect_with_underline = Rect::new_sized_unchecked(x1, y1, width, bh + 1);
workspace_rect =
Rect::new_sized_unchecked(x1, y1 + bh + 1, width, (height - bh - 1).max(0));
}
}
bar_rect_rel = bar_rect.move_(-rect.x1(), -rect.y1());
underline_rect_rel = underline_rect.move_(-rect.x1(), -rect.y1());
workspace_rect_rel = workspace_rect.move_(-rect.x1(), -rect.y1());