Add custom background settings controls

This commit is contained in:
2026-06-20 17:54:27 -04:00
parent 70a0e6798f
commit eab9357f23
+32
View File
@@ -2432,6 +2432,35 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
.spacing(10) .spacing(10)
.width(iced::Length::Fill); .width(iced::Length::Fill);
let remove_background: Element<'_, AppMessage> = if state.config.background.is_some() {
button(text("Remove background").size(13))
.on_press(AppMessage::RemoveBackground)
.style(b_style(color_surface, color_blue, color_text, 6.0))
.padding(8)
.into()
} else {
iced::widget::Space::new().width(0.0).height(0.0).into()
};
let background_section = column![
row![
button(text("Choose image…").size(13))
.on_press(AppMessage::PickBackgroundFile)
.style(b_style(color_surface, color_blue, color_text, 6.0))
.padding(8),
remove_background,
].spacing(8),
text(format!("Background dimming: {:.0}%", state.config.background_dim * 100.0))
.size(11)
.color(color_subtext),
slider(0.0..=1.0, state.config.background_dim, AppMessage::SetBackgroundDim)
.step(0.05),
text("Set a picture from your computer as the app background. Auto-resized; a dimming overlay keeps text readable. Applies live.")
.size(11)
.color(color_subtext),
]
.spacing(10)
.width(iced::Length::Fill);
// Inline avatar chooser (W4): the monogram fallback plus the bundled // Inline avatar chooser (W4): the monogram fallback plus the bundled
// presets, each a clickable tile. Same SelectAvatar message, applied live // presets, each a clickable tile. Same SelectAvatar message, applied live
// + persisted (and re-announced to the room). // + persisted (and re-announced to the room).
@@ -2780,6 +2809,9 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
vertical_space(section_gap), vertical_space(section_gap),
section_header("Theme"), section_header("Theme"),
theme_section, theme_section,
vertical_space(section_gap),
section_header("Background"),
background_section,
] ]
.spacing(10) .spacing(10)
.width(iced::Length::Fill) .width(iced::Length::Fill)