forge
Explore
Log in

Don't you dare go Hollow

focus-ring: Add thicken_corners setting

Browse files at this commit

df6c0dff9398a4903563015df6ae17e54d5ccceaIvan MolodetskikhParent: 9dad215
src/layout/focus_ring.rsmodified+8 -1
@@ -20,6 +20,7 @@ pub struct FocusRing {
20 is_border: bool,20 is_border: bool,
21 use_border_shader: bool,21 use_border_shader: bool,
22 config: niri_config::FocusRing,22 config: niri_config::FocusRing,
23+ thicken_corners: bool,
23 }24 }
24 25
25 niri_render_elements! {26 niri_render_elements! {
@@ -40,6 +41,7 @@ impl FocusRing {
40 is_border: false,41 is_border: false,
41 use_border_shader: false,42 use_border_shader: false,
42 config,43 config,
44+ thicken_corners: true,
43 }45 }
44 }46 }
45 47
@@ -104,7 +106,8 @@ impl FocusRing {
104 let rounded_corner_border_width = if self.is_border {106 let rounded_corner_border_width = if self.is_border {
105 // HACK: increase the border width used for the inner rounded corners a tiny bit to107 // HACK: increase the border width used for the inner rounded corners a tiny bit to
106 // reduce background bleed.108 // reduce background bleed.
107- width as f32 + 0.5109+ let extra = if self.thicken_corners { 0.5 } else { 0. };
110+ width as f32 + extra
108 } else {111 } else {
109 0.112 0.
110 };113 };
@@ -268,6 +271,10 @@ impl FocusRing {
268 self.config.off271 self.config.off
269 }272 }
270 273
274+ pub fn set_thicken_corners(&mut self, value: bool) {
275+ self.thicken_corners = value;
276+ }
277+
271 pub fn config(&self) -> &niri_config::FocusRing {278 pub fn config(&self) -> &niri_config::FocusRing {
272 &self.config279 &self.config
273 }280 }