diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-09-20 12:57:41 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-02 09:33:08 +0300 |
| commit | 1fa9dd32ed028c88248644a13421c098fef72894 (patch) | |
| tree | e6ea60b5b0b7ebc390ecc623b091bbe3dc40fdf0 /src/layout/tab_indicator.rs | |
| parent | 2781d3a74338806f631acda99e9f702b1b59a3e6 (diff) | |
| download | niri-1fa9dd32ed028c88248644a13421c098fef72894.tar.gz niri-1fa9dd32ed028c88248644a13421c098fef72894.tar.bz2 niri-1fa9dd32ed028c88248644a13421c098fef72894.zip | |
config: Split Layout from LayoutPart
Diffstat (limited to 'src/layout/tab_indicator.rs')
| -rw-r--r-- | src/layout/tab_indicator.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/layout/tab_indicator.rs b/src/layout/tab_indicator.rs index e35874e8..45405ccc 100644 --- a/src/layout/tab_indicator.rs +++ b/src/layout/tab_indicator.rs @@ -83,10 +83,10 @@ impl TabIndicator { let progress = self.open_anim.as_ref().map_or(1., |a| a.value().max(0.)); - let width = round_max1(self.config.width.0); - let gap = self.config.gap.0; + let width = round_max1(self.config.width); + let gap = self.config.gap; let gap = round_max1(gap.abs()).copysign(gap); - let gaps_between = round_max1(self.config.gaps_between_tabs.0); + let gaps_between = round_max1(self.config.gaps_between_tabs); let position = self.config.position; let side = match position { @@ -104,7 +104,7 @@ impl TabIndicator { let px_per_tab = (length + gaps_between) / count as f64 - gaps_between; let px_per_tab = px_per_tab * progress; - let gaps_between = round(self.config.gaps_between_tabs.0 * progress); + let gaps_between = round(self.config.gaps_between_tabs * progress); let length = count as f64 * (px_per_tab + gaps_between) - gaps_between; let px_per_tab = floor_logical_in_physical_max1(scale, px_per_tab); @@ -185,8 +185,8 @@ impl TabIndicator { self.shader_locs.resize_with(count, Default::default); let position = self.config.position; - let radius = self.config.corner_radius.0 as f32; - let shared_rounded_corners = self.config.gaps_between_tabs.0 == 0.; + let radius = self.config.corner_radius as f32; + let shared_rounded_corners = self.config.gaps_between_tabs == 0.; let mut tabs_left = tab_count; let rects = self.tab_rects(area, count, scale); @@ -317,8 +317,8 @@ impl TabIndicator { } let round = |logical: f64| round_logical_in_physical(scale, logical); - let width = round(self.config.width.0); - let gap = round(self.config.gap.0); + let width = round(self.config.width); + let gap = round(self.config.gap); // No, I am *not* falling into the rabbit hole of "what if the tab indicator is wide enough // that it peeks from the other side of the window". |
