Grid view split takes the space under the header so the side composer fits
Browse files at this commit9e7fb6d366738fbbbbe9f472fce57f1d1dbd512aParent: 8fd10d5- fix
- grid view split takes the space under the header so the side composer fits
- drop the members/chat swap
1 changed file +32 -52
- crates/client/src/gui/chat.rs +32 -52
crates/client/src/gui/chat.rsmodified+32 -52
| @@ -282,7 +282,6 @@ pub struct Chat { | |||
| 282 | pub(super) camera_task: Option<Task<()>>, | 282 | pub(super) camera_task: Option<Task<()>>, |
| 283 | pub(super) stage: Stage, | 283 | pub(super) stage: Stage, |
| 284 | pub(super) grid_size: (f32, f32), | 284 | pub(super) grid_size: (f32, f32), |
| 285 | - pub(super) chat_on_top: bool, | ||
| 286 | pub(super) typing: HashMap<Id, HashMap<Id, Instant>>, | 285 | pub(super) typing: HashMap<Id, HashMap<Id, Instant>>, |
| 287 | pub(super) typing_sent: HashMap<Id, Instant>, | 286 | pub(super) typing_sent: HashMap<Id, Instant>, |
| 288 | } | 287 | } |
| @@ -580,7 +579,6 @@ impl Chat { | |||
| 580 | camera_task: None, | 579 | camera_task: None, |
| 581 | stage: Stage::Strip, | 580 | stage: Stage::Strip, |
| 582 | grid_size: (1280., 720.), | 581 | grid_size: (1280., 720.), |
| 583 | - chat_on_top: false, | ||
| 584 | composer: Composer::Compose { reply: None }, | 582 | composer: Composer::Compose { reply: None }, |
| 585 | } | 583 | } |
| 586 | } | 584 | } |
| @@ -1458,51 +1456,41 @@ impl Yumush { | |||
| 1458 | }; | 1456 | }; |
| 1459 | let members = members_column(entity, self, palette); | 1457 | let members = members_column(entity, self, palette); |
| 1460 | match (viewer, grid, members) { | 1458 | match (viewer, grid, members) { |
| 1461 | - (None, Some(grid), Some(members)) => h_resizable("stage_split") | 1459 | + (None, Some(grid), Some(members)) => div() |
| 1462 | - .child( | 1460 | + .flex_1() |
| 1463 | - resizable_panel() | 1461 | + .min_h_0() |
| 1464 | - .size_range(px(size::PAGE)..gpui_kit::Pixels::MAX) | ||
| 1465 | - .child(div().size_full().flex().flex_col().child(grid)), | ||
| 1466 | - ) | ||
| 1467 | .child( | 1462 | .child( |
| 1468 | - resizable_panel() | 1463 | + h_resizable("stage_split") |
| 1469 | - .size(px(size::MARGIN_CHAT)) | 1464 | + .child( |
| 1470 | - .size_range(px(size::MARGIN)..px(size::MARGIN * 2.)) | 1465 | + resizable_panel() |
| 1471 | - .fixed() | 1466 | + .size_range(px(size::PAGE)..gpui_kit::Pixels::MAX) |
| 1472 | - .child({ | 1467 | + .child(div().size_full().flex().flex_col().child(grid)), |
| 1473 | - let members = resizable_panel() | 1468 | + ) |
| 1474 | - .size(px(size::THUMB * 2.)) | 1469 | + .child( |
| 1475 | - .size_range(px(size::ROW * 2.)..gpui_kit::Pixels::MAX) | 1470 | + resizable_panel() |
| 1471 | + .size(px(size::MARGIN_CHAT)) | ||
| 1472 | + .size_range(px(size::MARGIN)..px(size::MARGIN * 2.)) | ||
| 1476 | .fixed() | 1473 | .fixed() |
| 1477 | .child( | 1474 | .child( |
| 1478 | - members | 1475 | + v_resizable("side_split") |
| 1479 | - .size_full() | 1476 | + .child( |
| 1480 | - .on_drag(SideSwap, |_, _, _, cx| cx.new(|_| SideSwap)), | 1477 | + resizable_panel() |
| 1481 | - ); | 1478 | + .size(px(size::THUMB * 2.)) |
| 1482 | - let swap = entity.clone(); | 1479 | + .size_range( |
| 1483 | - let hover = palette.tokens.hov(); | 1480 | + px(size::ROW * 2.)..gpui_kit::Pixels::MAX, |
| 1484 | - let chat = resizable_panel() | 1481 | + ) |
| 1485 | - .size_range(px(size::THUMB * 2.)..gpui_kit::Pixels::MAX) | 1482 | + .fixed() |
| 1486 | - .child( | 1483 | + .child(members.size_full()), |
| 1487 | - chat() | 1484 | + ) |
| 1488 | - .drag_over::<SideSwap>(move |style, _, _, _| { | 1485 | + .child( |
| 1489 | - style.bg(hover) | 1486 | + resizable_panel() |
| 1490 | - }) | 1487 | + .size_range( |
| 1491 | - .on_drop(move |_: &SideSwap, _, cx| { | 1488 | + px(size::THUMB * 2.)..gpui_kit::Pixels::MAX, |
| 1492 | - swap.update(cx, |yumush, cx| { | 1489 | + ) |
| 1493 | - yumush.chat.chat_on_top = !yumush.chat.chat_on_top; | 1490 | + .child(chat()), |
| 1494 | - cx.notify(); | 1491 | + ), |
| 1495 | - }) | 1492 | + ), |
| 1496 | - }), | 1493 | + ), |
| 1497 | - ); | ||
| 1498 | - if self.chat.chat_on_top { | ||
| 1499 | - v_resizable("side_split_chat_top") | ||
| 1500 | - .child(chat) | ||
| 1501 | - .child(members) | ||
| 1502 | - } else { | ||
| 1503 | - v_resizable("side_split").child(members).child(chat) | ||
| 1504 | - } | ||
| 1505 | - }), | ||
| 1506 | ) | 1494 | ) |
| 1507 | .into_any_element(), | 1495 | .into_any_element(), |
| 1508 | (viewer, grid, members) => div() | 1496 | (viewer, grid, members) => div() |
| @@ -3783,11 +3771,3 @@ fn stage_button( | |||
| 3783 | }) | 3771 | }) |
| 3784 | .child(super::parts::small_icon(icon)) | 3772 | .child(super::parts::small_icon(icon)) |
| 3785 | } | 3773 | } |
| 3786 | - | ||
| 3787 | -struct SideSwap; | ||
| 3788 | - | ||
| 3789 | -impl gpui_kit::Render for SideSwap { | ||
| 3790 | - fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement { | ||
| 3791 | - div() | ||
| 3792 | - } | ||
| 3793 | -} | ||