adding a background button

This commit is contained in:
Chris Cochrun 2025-02-23 22:21:58 -06:00
parent a8f7651164
commit bbf1d0c162

View file

@ -2,8 +2,9 @@ use cosmic::{
iced::Length, iced::Length,
iced_widget::row, iced_widget::row,
widget::{ widget::{
column, combo_box, container, dropdown, text, text_editor, button, column, combo_box, container, dropdown,
text_input, vertical_space, horizontal_space, icon, text, text_editor, text_input,
vertical_space,
}, },
Element, Task, Element, Task,
}; };
@ -34,6 +35,7 @@ pub enum Message {
ChangeVerseOrder(String), ChangeVerseOrder(String),
ChangeLyrics(text_editor::Action), ChangeLyrics(text_editor::Action),
Edit(bool), Edit(bool),
None,
} }
impl SongEditor { impl SongEditor {
@ -102,6 +104,7 @@ impl SongEditor {
self.editing = edit; self.editing = edit;
Task::none() Task::none()
} }
Message::None => Task::none(),
} }
} }
@ -168,7 +171,21 @@ order",
Message::ChangeFontSize, Message::ChangeFontSize,
); );
row![font_selector, font_size].into() let background_selector = button::icon(
icon::from_name("folder-pictures-symbolic").scale(2),
)
.label("Background")
.tooltip("Select an image or video background")
.on_press(Message::None)
.padding(10);
row![
font_selector,
font_size,
horizontal_space(),
background_selector
]
.into()
} }
pub fn editing(&self) -> bool { pub fn editing(&self) -> bool {