rename TimelineResponse -> ColumnNoteResponse
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ pub enum BarAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct TimelineResponse {
|
pub struct NoteActionResponse {
|
||||||
pub bar_action: Option<BarAction>,
|
pub bar_action: Option<BarAction>,
|
||||||
pub open_profile: Option<Pubkey>,
|
pub open_profile: Option<Pubkey>,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ pub use picture::ProfilePic;
|
|||||||
pub use preview::ProfilePreview;
|
pub use preview::ProfilePreview;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
actionbar::TimelineResponse, imgcache::ImageCache, notecache::NoteCache,
|
actionbar::NoteActionResponse, imgcache::ImageCache, notecache::NoteCache,
|
||||||
notes_holder::NotesHolderStorage, profile::Profile,
|
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));
|
let scroll_id = egui::Id::new(("profile_scroll", self.col_id, self.pubkey));
|
||||||
|
|
||||||
ScrollArea::vertical()
|
ScrollArea::vertical()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
actionbar::TimelineResponse,
|
actionbar::NoteActionResponse,
|
||||||
imgcache::ImageCache,
|
imgcache::ImageCache,
|
||||||
notecache::NoteCache,
|
notecache::NoteCache,
|
||||||
notes_holder::{NotesHolder, NotesHolderStorage},
|
notes_holder::{NotesHolder, NotesHolderStorage},
|
||||||
@@ -47,7 +47,7 @@ impl<'a> ThreadView<'a> {
|
|||||||
self
|
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 txn = Transaction::new(self.ndb).expect("txn");
|
||||||
|
|
||||||
let selected_note_key = if let Ok(key) = self
|
let selected_note_key = if let Ok(key) = self
|
||||||
@@ -58,7 +58,7 @@ impl<'a> ThreadView<'a> {
|
|||||||
key
|
key
|
||||||
} else {
|
} else {
|
||||||
// TODO: render 404 ?
|
// TODO: render 404 ?
|
||||||
return TimelineResponse::default();
|
return NoteActionResponse::default();
|
||||||
};
|
};
|
||||||
|
|
||||||
ui.label(
|
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) {
|
let note = if let Ok(note) = self.ndb.get_note_by_key(&txn, selected_note_key) {
|
||||||
note
|
note
|
||||||
} else {
|
} else {
|
||||||
return TimelineResponse::default();
|
return NoteActionResponse::default();
|
||||||
};
|
};
|
||||||
|
|
||||||
let root_id = {
|
let root_id = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use crate::actionbar::TimelineResponse;
|
use crate::actionbar::NoteActionResponse;
|
||||||
use crate::timeline::TimelineTab;
|
use crate::timeline::TimelineTab;
|
||||||
use crate::{
|
use crate::{
|
||||||
actionbar::BarAction, column::Columns, imgcache::ImageCache, notecache::NoteCache,
|
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(
|
timeline_ui(
|
||||||
ui,
|
ui,
|
||||||
self.ndb,
|
self.ndb,
|
||||||
@@ -71,7 +71,7 @@ fn timeline_ui(
|
|||||||
img_cache: &mut ImageCache,
|
img_cache: &mut ImageCache,
|
||||||
reversed: bool,
|
reversed: bool,
|
||||||
textmode: bool,
|
textmode: bool,
|
||||||
) -> TimelineResponse {
|
) -> NoteActionResponse {
|
||||||
//padding(4.0, ui, |ui| ui.heading("Notifications"));
|
//padding(4.0, ui, |ui| ui.heading("Notifications"));
|
||||||
/*
|
/*
|
||||||
let font_id = egui::TextStyle::Body.resolve(ui.style());
|
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");
|
error!("tried to render timeline in column, but timeline was missing");
|
||||||
// TODO (jb55): render error when timeline is missing?
|
// TODO (jb55): render error when timeline is missing?
|
||||||
// this shouldn't happen...
|
// this shouldn't happen...
|
||||||
return TimelineResponse::default();
|
return NoteActionResponse::default();
|
||||||
};
|
};
|
||||||
|
|
||||||
timeline.selected_view = tabs_ui(ui);
|
timeline.selected_view = tabs_ui(ui);
|
||||||
@@ -109,7 +109,7 @@ fn timeline_ui(
|
|||||||
error!("tried to render timeline in column, but timeline was missing");
|
error!("tried to render timeline in column, but timeline was missing");
|
||||||
// TODO (jb55): render error when timeline is missing?
|
// TODO (jb55): render error when timeline is missing?
|
||||||
// this shouldn't happen...
|
// this shouldn't happen...
|
||||||
return TimelineResponse::default();
|
return NoteActionResponse::default();
|
||||||
};
|
};
|
||||||
|
|
||||||
let txn = Transaction::new(ndb).expect("failed to create txn");
|
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 open_profile = None;
|
||||||
let mut bar_action: Option<BarAction> = None;
|
let mut bar_action: Option<BarAction> = None;
|
||||||
let len = self.tab.notes.len();
|
let len = self.tab.notes.len();
|
||||||
@@ -299,7 +299,7 @@ impl<'a> TimelineTabView<'a> {
|
|||||||
1
|
1
|
||||||
});
|
});
|
||||||
|
|
||||||
TimelineResponse {
|
NoteActionResponse {
|
||||||
open_profile,
|
open_profile,
|
||||||
bar_action,
|
bar_action,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user