Center the detail tabs over the chat area
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -325,10 +325,23 @@ impl App {
|
|||||||
.padding([0, 6])
|
.padding([0, 6])
|
||||||
.on_press(Message::ToggleSidebar)
|
.on_press(Message::ToggleSidebar)
|
||||||
.style(button::text);
|
.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![
|
stack![
|
||||||
container(self.detail_tabs())
|
row![
|
||||||
.center_x(Length::Fill)
|
Space::with_width(detail_offset),
|
||||||
.center_y(Length::Fill),
|
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),
|
container(row![Space::with_width(TRAFFIC_LIGHT_WIDTH), toggle]).center_y(Length::Fill),
|
||||||
]
|
]
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
|
|||||||
Reference in New Issue
Block a user