chore: update deps
This commit is contained in:
@@ -309,7 +309,7 @@ impl DockItem {
|
||||
|
||||
pub(crate) fn focus_tab_panel(&self, window: &mut Window, cx: &mut App) {
|
||||
if let DockItem::Tabs { view, .. } = self {
|
||||
window.focus(&view.read(cx).focus_handle(cx));
|
||||
window.focus(&view.read(cx).focus_handle(cx), cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,7 +898,7 @@ impl TabPanel {
|
||||
|
||||
fn focus_active_panel(&self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if let Some(active_panel) = self.active_panel(cx) {
|
||||
window.focus(&active_panel.focus_handle(cx));
|
||||
window.focus(&active_panel.focus_handle(cx), cx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -426,8 +426,8 @@ where
|
||||
self.selected_value.as_ref()
|
||||
}
|
||||
|
||||
pub fn focus(&self, window: &mut Window, _: &mut App) {
|
||||
self.focus_handle.focus(window);
|
||||
pub fn focus(&self, window: &mut Window, cx: &mut App) {
|
||||
self.focus_handle.focus(window, cx);
|
||||
}
|
||||
|
||||
fn on_blur(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
@@ -445,7 +445,7 @@ where
|
||||
return;
|
||||
}
|
||||
|
||||
self.list.focus_handle(cx).focus(window);
|
||||
self.list.focus_handle(cx).focus(window, cx);
|
||||
cx.propagate();
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ where
|
||||
self.open = true;
|
||||
}
|
||||
|
||||
self.list.focus_handle(cx).focus(window);
|
||||
self.list.focus_handle(cx).focus(window, cx);
|
||||
cx.propagate();
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ where
|
||||
self.open = true;
|
||||
cx.notify();
|
||||
} else {
|
||||
self.list.focus_handle(cx).focus(window);
|
||||
self.list.focus_handle(cx).focus(window, cx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ where
|
||||
|
||||
self.open = !self.open;
|
||||
if self.open {
|
||||
self.list.focus_handle(cx).focus(window);
|
||||
self.list.focus_handle(cx).focus(window, cx);
|
||||
}
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ pub trait FocusableCycle {
|
||||
.nth(1)
|
||||
.unwrap_or(fallback_handle);
|
||||
|
||||
target_focus_handle.focus(window);
|
||||
target_focus_handle.focus(window, cx);
|
||||
cx.stop_propagation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -859,7 +859,7 @@ impl Element for TextElement {
|
||||
let p = point(input_bounds.origin.x, origin.y + offset_y);
|
||||
|
||||
for line in lines {
|
||||
_ = line.paint(p, line_height, window, cx);
|
||||
_ = line.paint(p, line_height, TextAlign::Left, None, window, cx);
|
||||
offset_y += line_height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,7 +766,7 @@ impl InputState {
|
||||
|
||||
/// Focus the input field.
|
||||
pub fn focus(&self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
self.focus_handle.focus(window);
|
||||
self.focus_handle.focus(window, cx);
|
||||
self.blink_cursor.update(cx, |cursor, cx| {
|
||||
cursor.start(cx);
|
||||
});
|
||||
|
||||
@@ -244,7 +244,7 @@ where
|
||||
}
|
||||
|
||||
pub fn focus(&mut self, window: &mut Window, cx: &mut App) {
|
||||
self.focus_handle(cx).focus(window);
|
||||
self.focus_handle(cx).focus(window, cx);
|
||||
}
|
||||
|
||||
/// Set the selected index of the list, this will also scroll to the selected item.
|
||||
|
||||
@@ -145,7 +145,7 @@ impl AppMenu {
|
||||
})
|
||||
.with_menu_items(items, window, cx)
|
||||
});
|
||||
popup_menu.read(cx).focus_handle(cx).focus(window);
|
||||
popup_menu.read(cx).focus_handle(cx).focus(window, cx);
|
||||
self._subscription =
|
||||
Some(cx.subscribe_in(&popup_menu, window, Self::handle_dismiss));
|
||||
self.popup_menu = Some(popup_menu.clone());
|
||||
@@ -157,7 +157,7 @@ impl AppMenu {
|
||||
|
||||
let focus_handle = popup_menu.read(cx).focus_handle(cx);
|
||||
if !focus_handle.contains_focused(window, cx) {
|
||||
focus_handle.focus(window);
|
||||
focus_handle.focus(window, cx);
|
||||
}
|
||||
|
||||
popup_menu
|
||||
|
||||
@@ -156,7 +156,7 @@ impl Element for ContextMenu {
|
||||
.when_some(menu_view, |this, menu| {
|
||||
// Focus the menu, so that can be handle the action.
|
||||
if !menu.focus_handle(cx).contains_focused(window, cx) {
|
||||
menu.focus_handle(cx).focus(window);
|
||||
menu.focus_handle(cx).focus(window, cx);
|
||||
}
|
||||
|
||||
this.child(div().occlude().child(menu.clone()))
|
||||
|
||||
@@ -659,7 +659,7 @@ impl PopupMenu {
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if let Some(context) = self.action_context.as_ref() {
|
||||
context.focus(window);
|
||||
context.focus(window, cx);
|
||||
}
|
||||
|
||||
window.dispatch_action(action.boxed_clone(), cx);
|
||||
@@ -759,7 +759,7 @@ impl PopupMenu {
|
||||
// Focus the submenu, so that can be handle the action.
|
||||
active_submenu.update(cx, |view, cx| {
|
||||
view.set_selected_index(0, cx);
|
||||
view.focus_handle.focus(window);
|
||||
view.focus_handle.focus(window, cx);
|
||||
});
|
||||
cx.notify();
|
||||
return true;
|
||||
@@ -790,7 +790,7 @@ impl PopupMenu {
|
||||
|
||||
self.selected_index = None;
|
||||
parent.update(cx, |view, cx| {
|
||||
view.focus_handle.focus(window);
|
||||
view.focus_handle.focus(window, cx);
|
||||
cx.notify();
|
||||
});
|
||||
}
|
||||
@@ -819,7 +819,7 @@ impl PopupMenu {
|
||||
|
||||
// Focus back to the previous focused handle.
|
||||
if let Some(action_context) = self.action_context.as_ref() {
|
||||
window.focus(action_context);
|
||||
window.focus(action_context, cx);
|
||||
}
|
||||
|
||||
let Some(parent_menu) = self.parent_menu.clone() else {
|
||||
|
||||
@@ -445,7 +445,7 @@ impl<M: ManagedView> Element for Popover<M> {
|
||||
if let Some(previous_focus_handle) =
|
||||
previous_focus_handle.as_ref()
|
||||
{
|
||||
window.focus(previous_focus_handle);
|
||||
window.focus(previous_focus_handle, cx);
|
||||
}
|
||||
}
|
||||
*old_content_view1.borrow_mut() = None;
|
||||
@@ -455,7 +455,7 @@ impl<M: ManagedView> Element for Popover<M> {
|
||||
)
|
||||
.detach();
|
||||
|
||||
window.focus(&new_content_view.focus_handle(cx));
|
||||
window.focus(&new_content_view.focus_handle(cx), cx);
|
||||
*old_content_view.borrow_mut() = Some(new_content_view);
|
||||
window.refresh();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ impl ContextModal for Window {
|
||||
}
|
||||
|
||||
let focus_handle = cx.focus_handle();
|
||||
focus_handle.focus(window);
|
||||
focus_handle.focus(window, cx);
|
||||
|
||||
root.active_modals.push(ActiveModal {
|
||||
focus_handle,
|
||||
@@ -81,7 +81,7 @@ impl ContextModal for Window {
|
||||
|
||||
if let Some(top_modal) = root.active_modals.last() {
|
||||
// Focus the next modal.
|
||||
top_modal.focus_handle.focus(window);
|
||||
top_modal.focus_handle.focus(window, cx);
|
||||
} else {
|
||||
// Restore focus if there are no more modals.
|
||||
root.focus_back(window, cx);
|
||||
@@ -188,9 +188,9 @@ impl Root {
|
||||
.read(cx)
|
||||
}
|
||||
|
||||
fn focus_back(&mut self, window: &mut Window, _: &mut App) {
|
||||
fn focus_back(&mut self, window: &mut Window, cx: &mut App) {
|
||||
if let Some(handle) = self.previous_focus_handle.clone() {
|
||||
window.focus(&handle);
|
||||
window.focus(&handle, cx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user