Skip to content

Commit

Permalink
profile: fix avatar alignment in profile previews
Browse files Browse the repository at this point in the history
Changelog-Fixed: Fix avatar alignment in profile previews
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Dec 17, 2024
1 parent 4967f64 commit f748b8b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions crates/notedeck_columns/src/ui/profile/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,18 @@ impl<'a, 'cache> ProfilePreview<'a, 'cache> {
}

fn body(self, ui: &mut egui::Ui) {
crate::ui::padding(12.0, ui, |ui| {
ui.add(ProfilePic::new(self.cache, get_profile_url(Some(self.profile))).size(80.0));
let padding = 12.0;
crate::ui::padding(padding, ui, |ui| {
let mut pfp_rect = ui.available_rect_before_wrap();
let size = 80.0;
pfp_rect.set_width(size);
pfp_rect.set_height(size);
let pfp_rect = pfp_rect.translate(egui::vec2(0.0, -(padding + 2.0 + (size / 2.0))));

ui.put(
pfp_rect,
ProfilePic::new(self.cache, get_profile_url(Some(self.profile))).size(size),
);
ui.add(display_name_widget(
get_display_name(Some(self.profile)),
false,
Expand Down

0 comments on commit f748b8b

Please sign in to comment.