1
0
Fork 0
forked from wry/wry

all: remove traditional i3 titlebars, add corner rounding

This commit is contained in:
kossLAN 2026-04-09 23:04:33 -04:00
parent e1928863d9
commit a41dbae899
No known key found for this signature in database
52 changed files with 1866 additions and 1047 deletions

View file

@ -189,10 +189,8 @@ pub struct State {
pub theme: Theme,
pub pending_container_layout: AsyncQueue<Rc<ContainerNode>>,
pub pending_container_render_positions: AsyncQueue<Rc<ContainerNode>>,
pub pending_container_render_title: AsyncQueue<Rc<ContainerNode>>,
pub pending_output_render_data: AsyncQueue<Rc<OutputNode>>,
pub pending_float_layout: AsyncQueue<Rc<FloatNode>>,
pub pending_float_titles: AsyncQueue<Rc<FloatNode>>,
pub pending_input_popup_positioning: AsyncQueue<Rc<ZwpInputPopupSurfaceV2>>,
pub pending_toplevel_screencasts: AsyncQueue<Rc<JayScreencast>>,
pub pending_screencast_reallocs_or_reconfigures: AsyncQueue<Rc<JayScreencast>>,
@ -275,6 +273,7 @@ pub struct State {
pub color_manager: Rc<ColorManager>,
pub float_above_fullscreen: Cell<bool>,
pub icons: Icons,
#[allow(dead_code)]
pub show_pin_icon: Cell<bool>,
pub cl_matcher_manager: ClMatcherManager,
pub tl_matcher_manager: TlMatcherManager,
@ -550,10 +549,6 @@ impl DrmDevData {
struct UpdateTextTexturesVisitor;
impl NodeVisitorBase for UpdateTextTexturesVisitor {
fn visit_container(&mut self, node: &Rc<ContainerNode>) {
node.children
.iter()
.for_each(|c| c.title_tex.borrow_mut().clear());
node.schedule_render_titles();
node.node_visit_children(self);
}
fn visit_output(&mut self, node: &Rc<OutputNode>) {
@ -561,8 +556,6 @@ impl NodeVisitorBase for UpdateTextTexturesVisitor {
node.node_visit_children(self);
}
fn visit_float(&mut self, node: &Rc<FloatNode>) {
node.title_textures.borrow_mut().clear();
node.schedule_render_titles();
node.node_visit_children(self);
}
fn visit_workspace(&mut self, node: &Rc<WorkspaceNode>) {
@ -685,10 +678,6 @@ impl State {
struct Walker;
impl NodeVisitorBase for Walker {
fn visit_container(&mut self, node: &Rc<ContainerNode>) {
node.render_data.borrow_mut().titles.clear();
node.children
.iter()
.for_each(|c| c.title_tex.borrow_mut().clear());
node.node_visit_children(self);
}
fn visit_workspace(&mut self, node: &Rc<WorkspaceNode>) {
@ -702,7 +691,6 @@ impl State {
node.node_visit_children(self);
}
fn visit_float(&mut self, node: &Rc<FloatNode>) {
node.title_textures.borrow_mut().clear();
node.node_visit_children(self);
}
fn visit_placeholder(&mut self, node: &Rc<PlaceholderNode>) {
@ -1118,10 +1106,8 @@ impl State {
self.dbus.clear();
self.pending_container_layout.clear();
self.pending_container_render_positions.clear();
self.pending_container_render_title.clear();
self.pending_output_render_data.clear();
self.pending_float_layout.clear();
self.pending_float_titles.clear();
self.pending_input_popup_positioning.clear();
self.pending_toplevel_screencasts.clear();
self.pending_screencast_reallocs_or_reconfigures.clear();
@ -1296,8 +1282,8 @@ impl State {
let (width, height) = target.logical_size(target_transform);
Rect::new_sized_saturating(0, 0, width, height)
},
icons: None,
stretch: None,
corner_radius: None,
};
let mut sample_rect = SampleRect::identity();
sample_rect.buffer_transform = transform;
@ -1621,8 +1607,7 @@ impl State {
.unwrap_or(c);
Some(target.predict_child_body_size())
} else {
let tpuh = self.theme.title_plus_underline_height();
Some((pos.width(), (pos.height() - tpuh).max(0)))
Some((pos.width(), pos.height()))
}
}
@ -1863,11 +1848,13 @@ impl State {
self.spaces_changed();
}
#[allow(dead_code)]
pub fn set_show_titles(&self, show: bool) {
self.theme.show_titles.set(show);
self.spaces_changed();
}
#[allow(dead_code)]
pub fn set_floating_titles(&self, floating: bool) {
self.theme.floating_titles.set(floating);
self.spaces_changed();
@ -1882,13 +1869,9 @@ impl State {
.set(threshold.saturating_mul(threshold));
}
#[allow(dead_code)]
pub fn set_show_pin_icon(&self, show: bool) {
self.show_pin_icon.set(show);
for stacked in self.root.stacked.iter() {
if let Some(float) = stacked.deref().clone().node_into_float() {
float.schedule_render_titles();
}
}
}
pub fn set_float_above_fullscreen(&self, v: bool) {
@ -1909,7 +1892,6 @@ impl State {
struct V;
impl NodeVisitorBase for V {
fn visit_container(&mut self, node: &Rc<ContainerNode>) {
node.schedule_render_titles();
node.node_visit_children(self);
}
fn visit_output(&mut self, node: &Rc<OutputNode>) {
@ -1917,7 +1899,6 @@ impl State {
node.node_visit_children(self);
}
fn visit_float(&mut self, node: &Rc<FloatNode>) {
node.schedule_render_titles();
node.node_visit_children(self);
}
}
@ -1943,6 +1924,7 @@ impl State {
self.fonts_changed();
}
#[allow(dead_code)]
pub fn set_title_font(&self, font: Option<&str>) {
let font = font.map(|font| Arc::new(font.to_string()));
self.theme.title_font.set(font);