mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-24 03:24:21 +01:00
pfp: remove border except for profile
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -398,11 +398,7 @@ impl<'a> NavTitle<'a> {
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(move |p| {
|
.and_then(move |p| {
|
||||||
Some(
|
Some(ui::ProfilePic::from_profile(self.img_cache, p)?.size(pfp_size))
|
||||||
ui::ProfilePic::from_profile(self.img_cache, p)?
|
|
||||||
.size(pfp_size)
|
|
||||||
.border(2.0),
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -228,19 +228,14 @@ impl<'a> NoteView<'a> {
|
|||||||
anim_speed,
|
anim_speed,
|
||||||
);
|
);
|
||||||
|
|
||||||
ui.put(
|
ui.put(rect, ui::ProfilePic::new(self.img_cache, pic).size(size))
|
||||||
rect,
|
.on_hover_ui_at_pointer(|ui| {
|
||||||
ui::ProfilePic::new(self.img_cache, pic)
|
ui.set_max_width(300.0);
|
||||||
.size(size)
|
ui.add(ui::ProfilePreview::new(
|
||||||
.border(2.0),
|
profile.as_ref().unwrap(),
|
||||||
)
|
self.img_cache,
|
||||||
.on_hover_ui_at_pointer(|ui| {
|
));
|
||||||
ui.set_max_width(300.0);
|
});
|
||||||
ui.add(ui::ProfilePreview::new(
|
|
||||||
profile.as_ref().unwrap(),
|
|
||||||
self.img_cache,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
|
|
||||||
if resp.hovered() || resp.clicked() {
|
if resp.hovered() || resp.clicked() {
|
||||||
ui::show_pointer(ui);
|
ui::show_pointer(ui);
|
||||||
@@ -251,8 +246,7 @@ impl<'a> NoteView<'a> {
|
|||||||
None => ui
|
None => ui
|
||||||
.add(
|
.add(
|
||||||
ui::ProfilePic::new(self.img_cache, ui::ProfilePic::no_pfp_url())
|
ui::ProfilePic::new(self.img_cache, ui::ProfilePic::no_pfp_url())
|
||||||
.size(pfp_size)
|
.size(pfp_size),
|
||||||
.border(2.0),
|
|
||||||
)
|
)
|
||||||
.interact(sense),
|
.interact(sense),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,21 +113,13 @@ impl<'a> PostView<'a> {
|
|||||||
.get_profile_by_pubkey(txn, self.poster.pubkey.bytes())
|
.get_profile_by_pubkey(txn, self.poster.pubkey.bytes())
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|p| {
|
.and_then(|p| Some(ui::ProfilePic::from_profile(self.img_cache, p)?.size(pfp_size)));
|
||||||
Some(
|
|
||||||
ui::ProfilePic::from_profile(self.img_cache, p)?
|
|
||||||
.size(pfp_size)
|
|
||||||
.border(2.0),
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
if let Some(pfp) = poster_pfp {
|
if let Some(pfp) = poster_pfp {
|
||||||
ui.add(pfp);
|
ui.add(pfp);
|
||||||
} else {
|
} else {
|
||||||
ui.add(
|
ui.add(
|
||||||
ui::ProfilePic::new(self.img_cache, ui::ProfilePic::no_pfp_url())
|
ui::ProfilePic::new(self.img_cache, ui::ProfilePic::no_pfp_url()).size(pfp_size),
|
||||||
.size(pfp_size)
|
|
||||||
.border(2.0),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,11 +91,7 @@ impl egui::Widget for SimpleProfilePreview<'_, '_> {
|
|||||||
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
|
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
|
||||||
Frame::none()
|
Frame::none()
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
ui.add(
|
ui.add(ProfilePic::new(self.cache, get_profile_url(self.profile)).size(48.0));
|
||||||
ProfilePic::new(self.cache, get_profile_url(self.profile))
|
|
||||||
.size(48.0)
|
|
||||||
.border(2.0),
|
|
||||||
);
|
|
||||||
ui.vertical(|ui| {
|
ui.vertical(|ui| {
|
||||||
ui.add(display_name_widget(get_display_name(self.profile), true));
|
ui.add(display_name_widget(get_display_name(self.profile), true));
|
||||||
if !self.is_nsec {
|
if !self.is_nsec {
|
||||||
|
|||||||
@@ -266,9 +266,7 @@ impl<'a> DesktopSidePanel<'a> {
|
|||||||
let txn = nostrdb::Transaction::new(self.ndb).expect("should be able to create txn");
|
let txn = nostrdb::Transaction::new(self.ndb).expect("should be able to create txn");
|
||||||
let profile_url = get_account_url(&txn, self.ndb, self.selected_account);
|
let profile_url = get_account_url(&txn, self.ndb, self.selected_account);
|
||||||
|
|
||||||
let widget = ProfilePic::new(self.img_cache, profile_url)
|
let widget = ProfilePic::new(self.img_cache, profile_url).size(cur_pfp_size);
|
||||||
.size(cur_pfp_size)
|
|
||||||
.border(2.0);
|
|
||||||
|
|
||||||
ui.put(helper.get_animation_rect(), widget);
|
ui.put(helper.get_animation_rect(), widget);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user