trying to fix the scrolling in the verse editors
Some checks failed
/ clippy (push) Failing after 4m59s
/ test (push) Failing after 14m57s

This commit is contained in:
Chris Cochrun 2026-02-17 15:23:11 -06:00
parent a36af6bc3b
commit bc0464ef03
2 changed files with 29 additions and 11 deletions

View file

@ -632,6 +632,14 @@ impl SongEditor {
},
));
}
verse_editor::Action::ScrollVerses(
pixels,
) => {
//
//
//
()
}
verse_editor::Action::UpdateVerseName(
verse_name,
) => {

View file

@ -35,6 +35,7 @@ pub enum Action {
UpdateVerse((VerseName, String)),
UpdateVerseName(String),
DeleteVerse(VerseName),
ScrollVerses(f32),
None,
}
@ -53,18 +54,27 @@ impl VerseEditor {
}
pub fn update(&mut self, message: Message) -> Action {
match message {
Message::UpdateLyric(action) => {
self.content.perform(action.clone());
match action {
text_editor::Action::Edit(_edit) => {
let lyrics = self.content.text();
self.lyric.clone_from(&lyrics);
let verse = self.verse_name;
Action::UpdateVerse((verse, lyrics))
}
_ => Action::None,
Message::UpdateLyric(action) => match action {
text_editor::Action::Edit(ref _edit) => {
self.content.perform(action.clone());
let lyrics = self.content.text();
self.lyric.clone_from(&lyrics);
let verse = self.verse_name;
Action::UpdateVerse((verse, lyrics))
}
}
text_editor::Action::Scroll { pixels } => {
if self.content.line_count() > 6 {
self.content.perform(action.clone());
Action::None
} else {
Action::ScrollVerses(pixels)
}
}
_ => {
self.content.perform(action.clone());
Action::None
}
},
Message::UpdateVerseName(verse_name) => {
Action::UpdateVerseName(verse_name)
}