diff --git a/src/actionbar.rs b/src/actionbar.rs index 17523056..593045de 100644 --- a/src/actionbar.rs +++ b/src/actionbar.rs @@ -16,7 +16,7 @@ pub enum BarAction { } #[derive(Default)] -pub struct TimelineResponse { +pub struct NoteActionResponse { pub bar_action: Option, pub open_profile: Option, } diff --git a/src/ui/profile/mod.rs b/src/ui/profile/mod.rs index 8c9b08e0..f9de10cb 100644 --- a/src/ui/profile/mod.rs +++ b/src/ui/profile/mod.rs @@ -8,7 +8,7 @@ pub use picture::ProfilePic; pub use preview::ProfilePreview; use crate::{ - actionbar::TimelineResponse, imgcache::ImageCache, notecache::NoteCache, + actionbar::NoteActionResponse, imgcache::ImageCache, notecache::NoteCache, notes_holder::NotesHolderStorage, profile::Profile, }; @@ -42,7 +42,7 @@ impl<'a> ProfileView<'a> { } } - pub fn ui(&mut self, ui: &mut egui::Ui) -> TimelineResponse { + pub fn ui(&mut self, ui: &mut egui::Ui) -> NoteActionResponse { let scroll_id = egui::Id::new(("profile_scroll", self.col_id, self.pubkey)); ScrollArea::vertical() diff --git a/src/ui/thread.rs b/src/ui/thread.rs index ee568e81..6cf6b48e 100644 --- a/src/ui/thread.rs +++ b/src/ui/thread.rs @@ -1,5 +1,5 @@ use crate::{ - actionbar::TimelineResponse, + actionbar::NoteActionResponse, imgcache::ImageCache, notecache::NoteCache, notes_holder::{NotesHolder, NotesHolderStorage}, @@ -47,7 +47,7 @@ impl<'a> ThreadView<'a> { self } - pub fn ui(&mut self, ui: &mut egui::Ui) -> TimelineResponse { + pub fn ui(&mut self, ui: &mut egui::Ui) -> NoteActionResponse { let txn = Transaction::new(self.ndb).expect("txn"); let selected_note_key = if let Ok(key) = self @@ -58,7 +58,7 @@ impl<'a> ThreadView<'a> { key } else { // TODO: render 404 ? - return TimelineResponse::default(); + return NoteActionResponse::default(); }; ui.label( @@ -75,7 +75,7 @@ impl<'a> ThreadView<'a> { let note = if let Ok(note) = self.ndb.get_note_by_key(&txn, selected_note_key) { note } else { - return TimelineResponse::default(); + return NoteActionResponse::default(); }; let root_id = { diff --git a/src/ui/timeline.rs b/src/ui/timeline.rs index 24e5ac38..bdad7f29 100644 --- a/src/ui/timeline.rs +++ b/src/ui/timeline.rs @@ -1,4 +1,4 @@ -use crate::actionbar::TimelineResponse; +use crate::actionbar::NoteActionResponse; use crate::timeline::TimelineTab; use crate::{ actionbar::BarAction, column::Columns, imgcache::ImageCache, notecache::NoteCache, @@ -42,7 +42,7 @@ impl<'a> TimelineView<'a> { } } - pub fn ui(&mut self, ui: &mut egui::Ui) -> TimelineResponse { + pub fn ui(&mut self, ui: &mut egui::Ui) -> NoteActionResponse { timeline_ui( ui, self.ndb, @@ -71,7 +71,7 @@ fn timeline_ui( img_cache: &mut ImageCache, reversed: bool, textmode: bool, -) -> TimelineResponse { +) -> NoteActionResponse { //padding(4.0, ui, |ui| ui.heading("Notifications")); /* let font_id = egui::TextStyle::Body.resolve(ui.style()); @@ -86,7 +86,7 @@ fn timeline_ui( error!("tried to render timeline in column, but timeline was missing"); // TODO (jb55): render error when timeline is missing? // this shouldn't happen... - return TimelineResponse::default(); + return NoteActionResponse::default(); }; timeline.selected_view = tabs_ui(ui); @@ -109,7 +109,7 @@ fn timeline_ui( error!("tried to render timeline in column, but timeline was missing"); // TODO (jb55): render error when timeline is missing? // this shouldn't happen... - return TimelineResponse::default(); + return NoteActionResponse::default(); }; let txn = Transaction::new(ndb).expect("failed to create txn"); @@ -242,7 +242,7 @@ impl<'a> TimelineTabView<'a> { } } - pub fn show(&mut self, ui: &mut egui::Ui) -> TimelineResponse { + pub fn show(&mut self, ui: &mut egui::Ui) -> NoteActionResponse { let mut open_profile = None; let mut bar_action: Option = None; let len = self.tab.notes.len(); @@ -299,7 +299,7 @@ impl<'a> TimelineTabView<'a> { 1 }); - TimelineResponse { + NoteActionResponse { open_profile, bar_action, }