Fix positioning on face piles, fix panic on member invite removal
This commit is contained in:
parent
17c9b4ca96
commit
6a7245b92b
2 changed files with 9 additions and 3 deletions
|
@ -534,7 +534,7 @@ impl ChannelModalDelegate {
|
||||||
|
|
||||||
this.selected_index = this
|
this.selected_index = this
|
||||||
.selected_index
|
.selected_index
|
||||||
.min(this.matching_member_indices.len() - 1);
|
.min(this.matching_member_indices.len().saturating_sub(1));
|
||||||
|
|
||||||
cx.focus_self();
|
cx.focus_self();
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
|
@ -37,12 +37,18 @@ impl<V: View> Element<V> for FacePile<V> {
|
||||||
debug_assert!(constraint.max_along(Axis::Horizontal) == f32::INFINITY);
|
debug_assert!(constraint.max_along(Axis::Horizontal) == f32::INFINITY);
|
||||||
|
|
||||||
let mut width = 0.;
|
let mut width = 0.;
|
||||||
|
let mut max_height = 0.;
|
||||||
for face in &mut self.faces {
|
for face in &mut self.faces {
|
||||||
width += face.layout(constraint, view, cx).x();
|
let layout = face.layout(constraint, view, cx);
|
||||||
|
width += layout.x();
|
||||||
|
max_height = f32::max(max_height, layout.y());
|
||||||
}
|
}
|
||||||
width -= self.overlap * self.faces.len().saturating_sub(1) as f32;
|
width -= self.overlap * self.faces.len().saturating_sub(1) as f32;
|
||||||
|
|
||||||
(Vector2F::new(width, constraint.max.y()), ())
|
(
|
||||||
|
Vector2F::new(width, max_height.clamp(1., constraint.max.y())),
|
||||||
|
(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn paint(
|
fn paint(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue