diff --git a/src/app/view.rs b/src/app/view.rs index b8a620c..79f54b7 100644 --- a/src/app/view.rs +++ b/src/app/view.rs @@ -325,10 +325,23 @@ impl App { .padding([0, 6]) .on_press(Message::ToggleSidebar) .style(button::text); + // Center the tabs over the detail area, not the whole window, so the + // sidebar's width (plus its divider) shifts them along. + let detail_offset = if self.preferences.sidebar_collapsed { + 0.0 + } else { + self.preferences + .sidebar_width + .clamp(MIN_SIDEBAR_WIDTH, MAX_SIDEBAR_WIDTH) as f32 + + 5.0 + }; stack![ - container(self.detail_tabs()) - .center_x(Length::Fill) - .center_y(Length::Fill), + row![ + Space::with_width(detail_offset), + container(self.detail_tabs()) + .center_x(Length::Fill) + .center_y(Length::Fill), + ], container(row![Space::with_width(TRAFFIC_LIGHT_WIDTH), toggle]).center_y(Length::Fill), ] .width(Length::Fill)