rename TimelineResponse -> ColumnNoteResponse

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-10-15 12:16:26 -04:00
parent 54d49f0110
commit 2d7da83872
4 changed files with 14 additions and 14 deletions

View File

@@ -16,7 +16,7 @@ pub enum BarAction {
}
#[derive(Default)]
pub struct TimelineResponse {
pub struct NoteActionResponse {
pub bar_action: Option<BarAction>,
pub open_profile: Option<Pubkey>,
}

View File

@@ -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()

View File

@@ -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 = {

View File

@@ -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<BarAction> = None;
let len = self.tab.notes.len();
@@ -299,7 +299,7 @@ impl<'a> TimelineTabView<'a> {
1
});
TimelineResponse {
NoteActionResponse {
open_profile,
bar_action,
}