move show_profile to its own fn
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -245,15 +245,7 @@ impl<'a> NavTitle<'a> {
|
|||||||
TimelineRoute::Quote(_note_id) => {}
|
TimelineRoute::Quote(_note_id) => {}
|
||||||
|
|
||||||
TimelineRoute::Profile(pubkey) => {
|
TimelineRoute::Profile(pubkey) => {
|
||||||
let txn = Transaction::new(self.ndb).unwrap();
|
self.show_profile(ui, pubkey, pfp_size);
|
||||||
if let Some(pfp) = self.pubkey_pfp(&txn, pubkey.bytes(), pfp_size) {
|
|
||||||
ui.add(pfp);
|
|
||||||
} else {
|
|
||||||
ui.add(
|
|
||||||
ui::ProfilePic::new(self.img_cache, ui::ProfilePic::no_pfp_url())
|
|
||||||
.size(pfp_size),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -267,6 +259,17 @@ impl<'a> NavTitle<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn show_profile(&mut self, ui: &mut egui::Ui, pubkey: &Pubkey, pfp_size: f32) {
|
||||||
|
let txn = Transaction::new(self.ndb).unwrap();
|
||||||
|
if let Some(pfp) = self.pubkey_pfp(&txn, pubkey.bytes(), pfp_size) {
|
||||||
|
ui.add(pfp);
|
||||||
|
} else {
|
||||||
|
ui.add(
|
||||||
|
ui::ProfilePic::new(self.img_cache, ui::ProfilePic::no_pfp_url()).size(pfp_size),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
fn title_label_value(title: &str) -> egui::Label {
|
fn title_label_value(title: &str) -> egui::Label {
|
||||||
egui::Label::new(RichText::new(title).text_style(NotedeckTextStyle::Body.text_style()))
|
egui::Label::new(RichText::new(title).text_style(NotedeckTextStyle::Body.text_style()))
|
||||||
.selectable(false)
|
.selectable(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user