From eab9357f2387de29c2f6c3852557e428cd98ec3f Mon Sep 17 00:00:00 2001 From: Mollusk Date: Sat, 20 Jun 2026 17:54:27 -0400 Subject: [PATCH] Add custom background settings controls --- src/app/mod.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/app/mod.rs b/src/app/mod.rs index 6397cfc..5357341 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -2432,6 +2432,35 @@ fn view(state: &AppState) -> Element<'_, AppMessage> { .spacing(10) .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 // presets, each a clickable tile. Same SelectAvatar message, applied live // + persisted (and re-announced to the room). @@ -2780,6 +2809,9 @@ fn view(state: &AppState) -> Element<'_, AppMessage> { vertical_space(section_gap), section_header("Theme"), theme_section, + vertical_space(section_gap), + section_header("Background"), + background_section, ] .spacing(10) .width(iced::Length::Fill)