BlueGit

ict rusty-teams

fix(ui): own avatar presence dot no longer clipped or cut by the menu ring

The ring now wraps only the avatar, the dot sits on the ring's corner, and the button is large enough for the dot's overhang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-12 · 7 weeks ago

Hash
6207eafbcf3cef82dabf1211c9f015c59c83d2c2
Parent
a09f2fd4
1 file changed +17 −13
crates/app/src/views/status_menu.rs +17 −13
@@ -28,6 +28,8 @@ pub const MENU_WIDTH: f32 = 250.;
28 28 const TITLE_AVATAR_SIZE: f32 = 26.;
29 29 const HEADER_AVATAR_SIZE: f32 = 40.;
30 30 const RING_WIDTH: f32 = 2.;
31 const PRESENCE_OVERHANG: f32 = 2.;
32 const OWN_STATUS_BUTTON_SIZE: f32 = TITLE_AVATAR_SIZE + 2. * (1. + RING_WIDTH + PRESENCE_OVERHANG);
31 33 const MENU_ICON_SIZE: f32 = 14.;
32 34 const ICON_COLUMN: f32 = 16.;
33 35 const HEADER_INSET: f32 = 24.;
@@ -61,17 +63,6 @@ pub fn own_status_button(app: &Entity<AppState>, state: &AppState) -> Option<Any
61 63 summary,
62 64 person: person.clone(),
63 65 };
64 let avatar = with_presence(
65 person_avatar(
66 &state.directory,
67 Some(&person.user_id),
68 &person.display_name,
69 TITLE_AVATAR_SIZE,
70 ),
71 presence,
72 TITLE_AVATAR_SIZE,
73 theme::background(),
74 );
75 66 let ringed = div()
76 67 .p(px(1.))
77 68 .rounded_full()
@@ -81,14 +72,27 @@ pub fn own_status_button(app: &Entity<AppState>, state: &AppState) -> Option<Any
81 72 } else {
82 73 transparent_black()
83 74 })
84 .child(avatar);
75 .child(person_avatar(
76 &state.directory,
77 Some(&person.user_id),
78 &person.display_name,
79 TITLE_AVATAR_SIZE,
80 ))
81 .into_any_element();
82 let ringed = with_presence(
83 ringed,
84 presence,
85 TITLE_AVATAR_SIZE + 2. * (1. + RING_WIDTH),
86 theme::background(),
87 );
85 88 let toggle = app.clone();
86 89 Some(
87 90 Button::new("title-own-status")
88 91 .ghost()
89 92 .p_0()
93 .size(px(OWN_STATUS_BUTTON_SIZE))
90 94 .rounded_full()
91 .child(ringed)
95 .child(div().p(px(PRESENCE_OVERHANG)).child(ringed))
92 96 .dropdown_menu_with_anchor(Anchor::TopRight, move |popup, window, cx| {
93 97 status_menu(popup, window, cx, &context)
94 98 })
@@ -28,6 +28,8 @@ pub const MENU_WIDTH: f32 = 250.;
28const TITLE_AVATAR_SIZE: f32 = 26.;
28const TITLE_AVATAR_SIZE: f32 = 26.;
29const HEADER_AVATAR_SIZE: f32 = 40.;
29const HEADER_AVATAR_SIZE: f32 = 40.;
30const RING_WIDTH: f32 = 2.;
30const RING_WIDTH: f32 = 2.;
31const PRESENCE_OVERHANG: f32 = 2.;
32const OWN_STATUS_BUTTON_SIZE: f32 = TITLE_AVATAR_SIZE + 2. * (1. + RING_WIDTH + PRESENCE_OVERHANG);
31const MENU_ICON_SIZE: f32 = 14.;
33const MENU_ICON_SIZE: f32 = 14.;
32const ICON_COLUMN: f32 = 16.;
34const ICON_COLUMN: f32 = 16.;
33const HEADER_INSET: f32 = 24.;
35const HEADER_INSET: f32 = 24.;
@@ -61,17 +63,6 @@ pub fn own_status_button(app: &Entity<AppState>, state: &AppState) -> Option<Any
61 summary,
63 summary,
62 person: person.clone(),
64 person: person.clone(),
63 };
65 };
64 let avatar = with_presence(
65 person_avatar(
66 &state.directory,
67 Some(&person.user_id),
68 &person.display_name,
69 TITLE_AVATAR_SIZE,
70 ),
71 presence,
72 TITLE_AVATAR_SIZE,
73 theme::background(),
74 );
75 let ringed = div()
66 let ringed = div()
76 .p(px(1.))
67 .p(px(1.))
77 .rounded_full()
68 .rounded_full()
@@ -81,14 +72,27 @@ pub fn own_status_button(app: &Entity<AppState>, state: &AppState) -> Option<Any
81 } else {
72 } else {
82 transparent_black()
73 transparent_black()
83 })
74 })
84 .child(avatar);
75 .child(person_avatar(
76 &state.directory,
77 Some(&person.user_id),
78 &person.display_name,
79 TITLE_AVATAR_SIZE,
80 ))
81 .into_any_element();
82 let ringed = with_presence(
83 ringed,
84 presence,
85 TITLE_AVATAR_SIZE + 2. * (1. + RING_WIDTH),
86 theme::background(),
87 );
85 let toggle = app.clone();
88 let toggle = app.clone();
86 Some(
89 Some(
87 Button::new("title-own-status")
90 Button::new("title-own-status")
88 .ghost()
91 .ghost()
89 .p_0()
92 .p_0()
93 .size(px(OWN_STATUS_BUTTON_SIZE))
90 .rounded_full()
94 .rounded_full()
91 .child(ringed)
95 .child(div().p(px(PRESENCE_OVERHANG)).child(ringed))
92 .dropdown_menu_with_anchor(Anchor::TopRight, move |popup, window, cx| {
96 .dropdown_menu_with_anchor(Anchor::TopRight, move |popup, window, cx| {
93 status_menu(popup, window, cx, &context)
97 status_menu(popup, window, cx, &context)
94 })
98 })