fix merge conflicr
This commit is contained in:
commit
be94f614a7
15 changed files with 323 additions and 281 deletions
|
@ -4,7 +4,7 @@ use crate::{
|
|||
elements::ElementBox,
|
||||
executor::{self, Task},
|
||||
keymap::{self, Binding, Keystroke},
|
||||
platform::{self, Platform, PromptLevel, WindowOptions},
|
||||
platform::{self, KeyDownEvent, Platform, PromptLevel, WindowOptions},
|
||||
presenter::Presenter,
|
||||
util::post_inc,
|
||||
AssetCache, AssetSource, ClipboardItem, FontCache, MouseRegionId, PathPromptOptions,
|
||||
|
@ -379,11 +379,11 @@ impl TestAppContext {
|
|||
|
||||
if !cx.dispatch_keystroke(window_id, dispatch_path, &keystroke) {
|
||||
presenter.borrow_mut().dispatch_event(
|
||||
Event::KeyDown {
|
||||
Event::KeyDown(KeyDownEvent {
|
||||
keystroke,
|
||||
input,
|
||||
is_held,
|
||||
},
|
||||
}),
|
||||
cx,
|
||||
);
|
||||
}
|
||||
|
@ -1843,7 +1843,7 @@ impl MutableAppContext {
|
|||
window.on_event(Box::new(move |event| {
|
||||
app.update(|cx| {
|
||||
if let Some(presenter) = presenter.upgrade() {
|
||||
if let Event::KeyDown { keystroke, .. } = &event {
|
||||
if let Event::KeyDown(KeyDownEvent { keystroke, .. }) = &event {
|
||||
if cx.dispatch_keystroke(
|
||||
window_id,
|
||||
presenter.borrow().dispatch_path(cx.as_ref()),
|
||||
|
@ -5400,7 +5400,7 @@ impl RefCounts {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{actions, elements::*, impl_actions};
|
||||
use crate::{actions, elements::*, impl_actions, MouseButton, MouseEvent};
|
||||
use serde::Deserialize;
|
||||
use smol::future::poll_once;
|
||||
use std::{
|
||||
|
@ -5753,14 +5753,15 @@ mod tests {
|
|||
let presenter = cx.presenters_and_platform_windows[&window_id].0.clone();
|
||||
// Ensure window's root element is in a valid lifecycle state.
|
||||
presenter.borrow_mut().dispatch_event(
|
||||
Event::LeftMouseDown {
|
||||
Event::MouseDown(MouseEvent {
|
||||
position: Default::default(),
|
||||
button: MouseButton::Left,
|
||||
ctrl: false,
|
||||
alt: false,
|
||||
shift: false,
|
||||
cmd: false,
|
||||
click_count: 1,
|
||||
},
|
||||
}),
|
||||
cx,
|
||||
);
|
||||
assert_eq!(mouse_down_count.load(SeqCst), 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue