fix(calls): name plate and menu sit on the speaker picture
The stage box is transparent. The picture carries the radius and the speaking border, and the plate and menu button sit inside it. The avatar fallback keeps a 16:9 box of the contain size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -724,50 +724,43 @@ pub fn render_focus_stage(
724
724
)
725
725
};
726
726
let image: Option<Arc<RenderImage>> = call.pictures.live(&key, now);
727
let picture = match image {
727
let avatar_only = image.is_none();
728
let (picture_size, picture) = match image {
728
729
Some(image) => {
729
let picture_size = image.size(0);
730
let (width, height) = contain_size(
731
(size.0 - 2. * FOCUS_BORDER, size.1 - 2. * FOCUS_BORDER),
732
(picture_size.width.0 as f32, picture_size.height.0 as f32),
733
);
730
let pixels = image.size(0);
731
let (width, height) = contain_size(size, (pixels.width.0 as f32, pixels.height.0 as f32));
732
let picture = img(ImageSource::Render(image))
733
.size_full()
734
.object_fit(ObjectFit::Fill)
735
.rounded(px(FOCUS_RADIUS))
736
.into_any_element();
737
((width, height), picture)
738
}
739
None => (
740
contain_size(size, (16., 9.)),
734
741
div()
735
742
.size_full()
736
743
.flex()
737
744
.items_center()
738
745
.justify_center()
739
.child(
740
img(ImageSource::Render(image))
741
.w(px(width))
742
.h(px(height))
743
.flex_none()
744
.object_fit(ObjectFit::Fill)
745
.rounded(px(FOCUS_RADIUS)),
746
)
747
.into_any_element()
748
}
749
None => div()
750
.size_full()
751
.flex()
752
.items_center()
753
.justify_center()
754
.child(person_avatar(
755
&state.directory,
756
user_id.as_deref(),
757
&name,
758
FOCUS_AVATAR,
759
))
760
.into_any_element(),
746
.child(person_avatar(
747
&state.directory,
748
user_id.as_deref(),
749
&name,
750
FOCUS_AVATAR,
751
))
752
.into_any_element(),
753
),
761
754
};
762
755
let stage = div()
763
756
.id("call-focus-stage")
764
757
.relative()
765
.w(px(size.0))
766
.h(px(size.1))
758
.w(px(picture_size.0))
759
.h(px(picture_size.1))
767
760
.flex_none()
768
761
.overflow_hidden()
769
762
.rounded(px(FOCUS_RADIUS))
770
.bg(hsla(0., 0., 0.04, 1.))
763
.when(avatar_only, |stage| stage.bg(hsla(0., 0., 0.04, 1.)))
771
764
.border(px(FOCUS_BORDER))
772
765
.border_color(if speaking {
773
766
theme::green()
@@ -787,8 +780,8 @@ pub fn render_focus_stage(
787
780
.child(
788
781
h_flex()
789
782
.absolute()
790
.left(px(12.))
791
.bottom(px(12.))
783
.left(px(8.))
784
.bottom(px(8.))
792
785
.gap(px(8.))
793
786
.px(px(8.))
794
787
.py(px(4.))
@@ -802,9 +795,18 @@ pub fn render_focus_stage(
802
795
plate.child(icon(IconName::MicOff, 14., theme::red()))
803
796
}),
804
797
);
805
Some(attach_tile_menu(
806
stage, app, model, &focus.mri, &name, focus.own,
807
))
798
let stage = attach_tile_menu(stage, app, model, &focus.mri, &name, focus.own);
799
Some(
800
div()
801
.w(px(size.0))
802
.h(px(size.1))
803
.flex_none()
804
.flex()
805
.items_center()
806
.justify_center()
807
.child(stage)
808
.into_any_element(),
809
)
808
810
}
809
811
810
812
pub fn captions_state_hint(model: &CallModel) -> Option<&'static str> {
@@ -724,50 +724,43 @@ pub fn render_focus_stage(724
)724
)725
};725
};726
let image: Option<Arc<RenderImage>> = call.pictures.live(&key, now);726
let image: Option<Arc<RenderImage>> = call.pictures.live(&key, now);727
let picture = match image {727
let avatar_only = image.is_none();728
let (picture_size, picture) = match image {728
Some(image) => {729
Some(image) => {729
let picture_size = image.size(0);730
let pixels = image.size(0);730
let (width, height) = contain_size(731
let (width, height) = contain_size(size, (pixels.width.0 as f32, pixels.height.0 as f32));731
(size.0 - 2. * FOCUS_BORDER, size.1 - 2. * FOCUS_BORDER),732
let picture = img(ImageSource::Render(image))732
(picture_size.width.0 as f32, picture_size.height.0 as f32),733
.size_full()733
);734
.object_fit(ObjectFit::Fill)735
.rounded(px(FOCUS_RADIUS))736
.into_any_element();737
((width, height), picture)738
}739
None => (740
contain_size(size, (16., 9.)),734
div()741
div()735
.size_full()742
.size_full()736
.flex()743
.flex()737
.items_center()744
.items_center()738
.justify_center()745
.justify_center()739
.child(746
.child(person_avatar(740
img(ImageSource::Render(image))747
&state.directory,741
.w(px(width))748
user_id.as_deref(),742
.h(px(height))749
&name,743
.flex_none()750
FOCUS_AVATAR,744
.object_fit(ObjectFit::Fill)751
))745
.rounded(px(FOCUS_RADIUS)),752
.into_any_element(),746
)753
),747
.into_any_element()748
}749
None => div()750
.size_full()751
.flex()752
.items_center()753
.justify_center()754
.child(person_avatar(755
&state.directory,756
user_id.as_deref(),757
&name,758
FOCUS_AVATAR,759
))760
.into_any_element(),761
};754
};762
let stage = div()755
let stage = div()763
.id("call-focus-stage")756
.id("call-focus-stage")764
.relative()757
.relative()765
.w(px(size.0))758
.w(px(picture_size.0))766
.h(px(size.1))759
.h(px(picture_size.1))767
.flex_none()760
.flex_none()768
.overflow_hidden()761
.overflow_hidden()769
.rounded(px(FOCUS_RADIUS))762
.rounded(px(FOCUS_RADIUS))770
.bg(hsla(0., 0., 0.04, 1.))763
.when(avatar_only, |stage| stage.bg(hsla(0., 0., 0.04, 1.)))771
.border(px(FOCUS_BORDER))764
.border(px(FOCUS_BORDER))772
.border_color(if speaking {765
.border_color(if speaking {773
theme::green()766
theme::green()@@ -787,8 +780,8 @@ pub fn render_focus_stage(787
.child(780
.child(788
h_flex()781
h_flex()789
.absolute()782
.absolute()790
.left(px(12.))783
.left(px(8.))791
.bottom(px(12.))784
.bottom(px(8.))792
.gap(px(8.))785
.gap(px(8.))793
.px(px(8.))786
.px(px(8.))794
.py(px(4.))787
.py(px(4.))@@ -802,9 +795,18 @@ pub fn render_focus_stage(802
plate.child(icon(IconName::MicOff, 14., theme::red()))795
plate.child(icon(IconName::MicOff, 14., theme::red()))803
}),796
}),804
);797
);805
Some(attach_tile_menu(798
let stage = attach_tile_menu(stage, app, model, &focus.mri, &name, focus.own);806
stage, app, model, &focus.mri, &name, focus.own,799
Some(807
))800
div()801
.w(px(size.0))802
.h(px(size.1))803
.flex_none()804
.flex()805
.items_center()806
.justify_center()807
.child(stage)808
.into_any_element(),809
)808
}810
}809
811
810
pub fn captions_state_hint(model: &CallModel) -> Option<&'static str> {812
pub fn captions_state_hint(model: &CallModel) -> Option<&'static str> {