Merge remote-tracking branch 'upstream/master' into yoda-wayland-only
# Conflicts: # Cargo.lock # Cargo.toml # wgpu/Cargo.toml # wgpu/src/window/compositor.rs
This commit is contained in:
commit
d24bcd0272
36 changed files with 475 additions and 209 deletions
|
|
@ -19,6 +19,7 @@ crisp = []
|
|||
basic-shaping = []
|
||||
advanced-shaping = []
|
||||
a11y = ["iced_accessibility"]
|
||||
wayland = ["cctk"]
|
||||
|
||||
[dependencies]
|
||||
palette = "0.7"
|
||||
|
|
@ -43,8 +44,6 @@ window_clipboard.workspace = true
|
|||
dnd.workspace = true
|
||||
mime.workspace = true
|
||||
|
||||
cctk.workspace = true
|
||||
cctk.optional = true
|
||||
# /TODO(POP)
|
||||
[dependencies.iced_accessibility]
|
||||
version = "0.1.0"
|
||||
|
|
@ -56,3 +55,10 @@ raw-window-handle.workspace = true
|
|||
|
||||
[dev-dependencies]
|
||||
approx = "0.5"
|
||||
|
||||
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_vendor = "apple"))))'.dependencies]
|
||||
cctk.workspace = true
|
||||
cctk.optional = true
|
||||
|
||||
[build-dependencies]
|
||||
build_helpers = { path = "../build_helpers" }
|
||||
|
|
|
|||
3
core/build.rs
Normal file
3
core/build.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
build_helpers::cfg_aliases_setup();
|
||||
}
|
||||
|
|
@ -7,7 +7,8 @@ use crate::keyboard;
|
|||
use crate::mouse;
|
||||
use crate::touch;
|
||||
use crate::window;
|
||||
#[cfg(all(feature = "cctk", target_os = "linux"))]
|
||||
|
||||
#[cfg(wayland_platform)]
|
||||
/// A platform specific event for wayland
|
||||
pub mod wayland;
|
||||
/// A user interface event.
|
||||
|
|
@ -49,7 +50,7 @@ pub enum Event {
|
|||
/// A platform specific event
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum PlatformSpecific {
|
||||
#[cfg(all(feature = "cctk", target_os = "linux"))]
|
||||
#[cfg(wayland_platform)]
|
||||
/// A Wayland specific event
|
||||
Wayland(wayland::Event),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,11 +446,22 @@ where
|
|||
| Event::Touch(touch::Event::FingerPressed { .. })
|
||||
) {
|
||||
if cursor.position_over(bounds).is_none() {
|
||||
let was_visible = state.focused
|
||||
|| state.keyboard_focused
|
||||
|| state
|
||||
.selection
|
||||
.as_ref()
|
||||
.is_some_and(|sel| sel.anchor != sel.end);
|
||||
|
||||
state.focused = false;
|
||||
state.keyboard_focused = false;
|
||||
if let Some(sel) = &mut state.selection {
|
||||
sel.clear();
|
||||
}
|
||||
|
||||
if was_visible {
|
||||
shell.request_redraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -511,6 +522,7 @@ where
|
|||
state.focused = true;
|
||||
state.keyboard_focused = false;
|
||||
shell.capture_event();
|
||||
shell.request_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -520,6 +532,7 @@ where
|
|||
state.focused = true;
|
||||
state.keyboard_focused = false;
|
||||
shell.capture_event();
|
||||
shell.request_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -544,7 +557,15 @@ where
|
|||
position.y - anchor.y,
|
||||
);
|
||||
|
||||
sel.end = hit_to_grapheme(paragraph, relative, content);
|
||||
let end = hit_to_grapheme(paragraph, relative, content);
|
||||
|
||||
// Only the drag reaching a new grapheme changes what
|
||||
// is drawn; plain motion inside one does not.
|
||||
if end != sel.end {
|
||||
sel.end = end;
|
||||
shell.request_redraw();
|
||||
}
|
||||
|
||||
shell.capture_event();
|
||||
}
|
||||
}
|
||||
|
|
@ -587,6 +608,7 @@ where
|
|||
sel.anchor = 0;
|
||||
sel.end = grapheme_count;
|
||||
shell.capture_event();
|
||||
shell.request_redraw();
|
||||
return;
|
||||
}
|
||||
_ => {}
|
||||
|
|
@ -613,6 +635,7 @@ where
|
|||
sel.end = pos;
|
||||
}
|
||||
shell.capture_event();
|
||||
shell.request_redraw();
|
||||
}
|
||||
keyboard::Key::Named(keyboard::key::Named::ArrowRight) => {
|
||||
let by_word = is_jump_modifier(*modifiers);
|
||||
|
|
@ -633,6 +656,7 @@ where
|
|||
sel.end = pos;
|
||||
}
|
||||
shell.capture_event();
|
||||
shell.request_redraw();
|
||||
}
|
||||
keyboard::Key::Named(keyboard::key::Named::Home) => {
|
||||
if modifiers.shift() {
|
||||
|
|
@ -642,6 +666,7 @@ where
|
|||
sel.end = 0;
|
||||
}
|
||||
shell.capture_event();
|
||||
shell.request_redraw();
|
||||
}
|
||||
keyboard::Key::Named(keyboard::key::Named::End) => {
|
||||
if modifiers.shift() {
|
||||
|
|
@ -651,6 +676,7 @@ where
|
|||
sel.end = grapheme_count;
|
||||
}
|
||||
shell.capture_event();
|
||||
shell.request_redraw();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue