refactor: remove unnecessary code

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-09-13 14:38:54 -04:00
parent a8eaea6509
commit 50293a6f34
3 changed files with 2 additions and 18 deletions

View File

@@ -65,13 +65,7 @@ impl<'a, 'd> ProfileView<'a, 'd> {
pub fn ui(&mut self, ui: &mut egui::Ui) -> Option<ProfileViewAction> {
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);
if let Some(offset) = ui.data(|i| i.get_temp::<f32>(offset_id)) {
scroll_area = scroll_area.vertical_scroll_offset(offset);
}
let scroll_area = ScrollArea::vertical().id_salt(scroll_id);
let output = scroll_area.show(ui, |ui| 's: {
let mut action = None;
@@ -127,8 +121,6 @@ impl<'a, 'd> ProfileView<'a, 'd> {
action
});
ui.data_mut(|d| d.insert_temp(offset_id, output.state.offset.y));
output.inner
}

View File

@@ -151,12 +151,6 @@ fn timeline_ui(
.auto_shrink([false, false])
.scroll_bar_visibility(ScrollBarVisibility::AlwaysVisible);
let offset_id = scroll_id.with("timeline_scroll_offset");
if let Some(offset) = ui.data(|i| i.get_temp::<f32>(offset_id)) {
scroll_area = scroll_area.vertical_scroll_offset(offset);
}
if goto_top_resp.is_some_and(|r| r.clicked()) {
scroll_area = scroll_area.vertical_scroll_offset(0.0);
}
@@ -195,8 +189,6 @@ fn timeline_ui(
.show(ui)
});
ui.data_mut(|d| d.insert_temp(offset_id, scroll_output.state.offset.y));
let at_top_after_scroll = scroll_output.state.offset.y == 0.0;
let cur_show_top_button = ui.ctx().data(|d| d.get_temp::<bool>(show_top_button_id));

View File

@@ -749,7 +749,7 @@ fn note_hitbox_id(
fn maybe_note_hitbox(ui: &mut egui::Ui, hitbox_id: egui::Id) -> Option<Response> {
ui.ctx()
.data_mut(|d| d.get_persisted(hitbox_id))
.data_mut(|d| d.get_temp(hitbox_id))
.map(|note_size: Vec2| {
// The hitbox should extend the entire width of the
// container. The hitbox height was cached last layout.