add scroll_id for all views with vertical scroll

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-07-24 09:43:53 -06:00
parent 6db6cf7b7a
commit 8960b3f052
8 changed files with 49 additions and 6 deletions

View File

@@ -24,9 +24,14 @@ impl<'a> EditProfileView<'a> {
}
}
pub fn scroll_id() -> egui::Id {
egui::Id::new("edit_profile")
}
// return true to save
pub fn ui(&mut self, ui: &mut egui::Ui) -> bool {
ScrollArea::vertical()
.id_salt(EditProfileView::scroll_id())
.show(ui, |ui| {
banner(ui, self.state.banner(), 188.0);

View File

@@ -59,8 +59,12 @@ impl<'a, 'd> ProfileView<'a, 'd> {
}
}
pub fn scroll_id(col_id: usize, profile_pubkey: &Pubkey) -> egui::Id {
egui::Id::new(("profile_scroll", col_id, profile_pubkey))
}
pub fn ui(&mut self, ui: &mut egui::Ui) -> Option<ProfileViewAction> {
let scroll_id = egui::Id::new(("profile_scroll", self.col_id, self.pubkey));
let scroll_id = ProfileView::scroll_id(self.col_id, self.pubkey);
let offset_id = scroll_id.with("scroll_offset");
let mut scroll_area = ScrollArea::vertical().id_salt(scroll_id);