fix(ui): compact, left-aligned friends rows
Per design feedback: put Remove directly to the right of the name box (was separated by the id column), and shrink the oversized add-friend inputs to fixed half-widths (node id 340px, name 170px) instead of stretching across the panel. A trailing horizontal_space absorbs the rest so rows are left-aligned and nothing reaches the scrollbar edge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9
-11
@@ -1632,18 +1632,15 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
|||||||
.on_input(move |v| AppMessage::RenameFriend(fid, v))
|
.on_input(move |v| AppMessage::RenameFriend(fid, v))
|
||||||
.style(t_style)
|
.style(t_style)
|
||||||
.padding(6)
|
.padding(6)
|
||||||
.width(iced::Length::FillPortion(2)),
|
.width(iced::Length::Fixed(240.0)),
|
||||||
text(id_short)
|
|
||||||
.size(11)
|
|
||||||
.color(color_subtext)
|
|
||||||
.width(iced::Length::FillPortion(2)),
|
|
||||||
button(text("Remove").size(12))
|
button(text("Remove").size(12))
|
||||||
.on_press(AppMessage::RemoveFriend(fid))
|
.on_press(AppMessage::RemoveFriend(fid))
|
||||||
.style(b_style(color_surface, color_maroon, color_text, 6.0))
|
.style(b_style(color_surface, color_maroon, color_text, 6.0))
|
||||||
.padding(6),
|
.padding(6),
|
||||||
// Reserve clearance so the button doesn't sit under the
|
text(id_short).size(11).color(color_subtext),
|
||||||
// scrollbar gutter at the right edge.
|
// Absorb the remaining width so the row is left-aligned and
|
||||||
horizontal_space().width(iced::Length::Fixed(12.0)),
|
// nothing stretches to / under the scrollbar edge.
|
||||||
|
horizontal_space(),
|
||||||
]
|
]
|
||||||
.spacing(8)
|
.spacing(8)
|
||||||
.align_y(iced::alignment::Vertical::Center),
|
.align_y(iced::alignment::Vertical::Center),
|
||||||
@@ -1665,17 +1662,18 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
|||||||
.on_input(AppMessage::FriendAddIdChanged)
|
.on_input(AppMessage::FriendAddIdChanged)
|
||||||
.style(t_style)
|
.style(t_style)
|
||||||
.padding(6)
|
.padding(6)
|
||||||
.width(iced::Length::FillPortion(3)),
|
.width(iced::Length::Fixed(340.0)),
|
||||||
text_input("Name (optional)", &state.friend_add_name)
|
text_input("Name (optional)", &state.friend_add_name)
|
||||||
.on_input(AppMessage::FriendAddNameChanged)
|
.on_input(AppMessage::FriendAddNameChanged)
|
||||||
.style(t_style)
|
.style(t_style)
|
||||||
.padding(6)
|
.padding(6)
|
||||||
.width(iced::Length::FillPortion(2)),
|
.width(iced::Length::Fixed(170.0)),
|
||||||
button(text("Add").size(13))
|
button(text("Add").size(13))
|
||||||
.on_press(AppMessage::AddFriend)
|
.on_press(AppMessage::AddFriend)
|
||||||
.style(b_style(color_surface, color_blue, color_text, 6.0))
|
.style(b_style(color_surface, color_blue, color_text, 6.0))
|
||||||
.padding(8),
|
.padding(8),
|
||||||
horizontal_space().width(iced::Length::Fixed(12.0)),
|
// Left-align the compact inputs; absorb the rest of the row.
|
||||||
|
horizontal_space(),
|
||||||
]
|
]
|
||||||
.spacing(8)
|
.spacing(8)
|
||||||
.align_y(iced::alignment::Vertical::Center),
|
.align_y(iced::alignment::Vertical::Center),
|
||||||
|
|||||||
Reference in New Issue
Block a user