chore: bump gpui

This commit is contained in:
2026-04-25 07:01:14 +07:00
parent 80186a79e5
commit 6d60726f27
15 changed files with 342 additions and 775 deletions

View File

@@ -2,7 +2,7 @@ use std::rc::Rc;
use gpui::prelude::FluentBuilder;
use gpui::{
Action, AnyElement, App, AppContext, Axis, Bounds, ClickEvent, Context, Corner, DismissEvent,
Action, Anchor, AnyElement, App, AppContext, Axis, Bounds, ClickEvent, Context, DismissEvent,
Edges, Entity, EventEmitter, FocusHandle, Focusable, Half, InteractiveElement, IntoElement,
KeyBinding, MouseDownEvent, OwnedMenuItem, ParentElement, Pixels, Point, Render, ScrollHandle,
SharedString, StatefulInteractiveElement, Styled, Subscription, WeakEntity, Window, anchored,
@@ -299,7 +299,7 @@ pub struct PopupMenu {
scroll_handle: ScrollHandle,
/// This will update on render
submenu_anchor: (Corner, Pixels),
submenu_anchor: (Anchor, Pixels),
_subscriptions: Vec<Subscription>,
}
@@ -322,7 +322,7 @@ impl PopupMenu {
scroll_handle: ScrollHandle::default(),
external_link_icon: true,
size: Size::default(),
submenu_anchor: (Corner::TopLeft, Pixels::ZERO),
submenu_anchor: (Anchor::TopLeft, Pixels::ZERO),
_subscriptions: vec![],
}
}
@@ -840,7 +840,7 @@ impl PopupMenu {
}
fn select_left(&mut self, _: &SelectLeft, window: &mut Window, cx: &mut Context<Self>) {
let handled = if matches!(self.submenu_anchor.0, Corner::TopLeft | Corner::BottomLeft) {
let handled = if matches!(self.submenu_anchor.0, Anchor::TopLeft | Anchor::BottomLeft) {
self._unselect_submenu(window, cx)
} else {
self._select_submenu(window, cx)
@@ -861,7 +861,7 @@ impl PopupMenu {
}
fn select_right(&mut self, _: &SelectRight, window: &mut Window, cx: &mut Context<Self>) {
let handled = if matches!(self.submenu_anchor.0, Corner::TopLeft | Corner::BottomLeft) {
let handled = if matches!(self.submenu_anchor.0, Anchor::TopLeft | Anchor::BottomLeft) {
self._select_submenu(window, cx)
} else {
self._unselect_submenu(window, cx)
@@ -930,8 +930,9 @@ impl PopupMenu {
};
match parent.read(cx).submenu_anchor.0 {
Corner::TopLeft | Corner::BottomLeft => Side::Left,
Corner::TopRight | Corner::BottomRight => Side::Right,
Anchor::TopLeft | Anchor::BottomLeft => Side::Left,
Anchor::TopRight | Anchor::BottomRight => Side::Right,
_ => Side::Left,
}
}
@@ -1041,14 +1042,14 @@ impl PopupMenu {
let bounds = self.bounds;
let max_width = self.max_width();
let (anchor, left) = if max_width + bounds.origin.x > window.bounds().size.width {
(Corner::TopRight, -px(16.))
(Anchor::TopRight, -px(16.))
} else {
(Corner::TopLeft, bounds.size.width - px(8.))
(Anchor::TopLeft, bounds.size.width - px(8.))
};
let is_bottom_pos = bounds.origin.y + bounds.size.height > window.bounds().size.height;
self.submenu_anchor = if is_bottom_pos {
(anchor.other_side_corner_along(gpui::Axis::Vertical), left)
(anchor.other_side_along(gpui::Axis::Vertical), left)
} else {
(anchor, left)
};
@@ -1230,7 +1231,7 @@ impl PopupMenu {
this.child({
let (anchor, left) = self.submenu_anchor;
let is_bottom_pos =
matches!(anchor, Corner::BottomLeft | Corner::BottomRight);
matches!(anchor, Anchor::BottomLeft | Anchor::BottomRight);
anchored()
.anchor(anchor)
.child(