add scroll_id for all views with vertical scroll
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user