Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow toggler to be disabled #169

Open
wants to merge 180 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
27174aa
feat: accessibility with some widget impls
wash2 May 2, 2023
1bc1604
feat: sctk shell
wash2 May 8, 2023
97d5dc8
chore: default line height, text size, and shaping for cosmic
mmstick May 30, 2023
33e6bee
runtime: Handle widget operations in `program::State` helper (#46)
Drakulix Jun 13, 2023
9d9da78
fix: reset button state if the cursor leaves
wash2 Jul 10, 2023
9497cdb
Introduce internal `overlay::Nested` for `UserInterface`
tarkah Feb 18, 2023
ebe3374
Use layout with children for nesting
tarkah Feb 19, 2023
a82a398
Use nested for lazy widgets
tarkah Feb 20, 2023
701038b
Provide access to font from each crate
tarkah Jun 23, 2023
40206bd
Added offscreen rendering support for wgpu & tiny-skia exposed with t…
bungoboingo Mar 25, 2023
eed4f5c
Move `Screenshot` inside `window` module
hecrj Jun 27, 2023
9d9d078
fix: quad rendering including border only inside of the bounds
wash2 May 10, 2023
aa65b61
Make vertical scroll properties optional
May 27, 2023
60360cb
feat(winit): client-side resize drag support
mmstick Aug 18, 2023
c69703f
feat(winit): client-side resize drag support
mmstick Aug 18, 2023
3e70ccd
feat(renderer): define default icon color
mmstick Aug 30, 2023
a3fcdc0
fix(button): inherit icon color if set to none
mmstick Aug 31, 2023
d87f092
fix(widget): container inherited wrong icon color from renderer
mmstick Sep 7, 2023
5db1da9
feat(mouse-area): added on_drag method
mmstick Sep 12, 2023
b66eeab
feat: gradient backgground for the slider rail
wash2 Sep 26, 2023
31abe65
fix: slider gradient angle
wash2 Sep 29, 2023
0db19f0
feat: allow setting the width and height of a rule
wash2 Sep 29, 2023
f4d3ea9
refactor: restore default style of slider
wash2 Sep 29, 2023
136f1d9
cleanup: clippy fixes and formatting
wash2 Sep 26, 2023
f0d510f
feat: Add side mouse button events
edfloreshz Oct 22, 2023
cfe214e
feat: add border radius to image rendering
mmstick Nov 3, 2023
e2a3b83
fix(wgpu): handle border_radius property with image raster
mmstick Nov 3, 2023
3db6904
iced_core: feature for serde serialization of KeyCode
jackpot51 Nov 3, 2023
fa679b3
Hack to remove image blur
jackpot51 Nov 13, 2023
5109b61
chore: update softbuffer
wash2 Nov 15, 2023
3c95946
Update mod.rs
wiiznokes Nov 17, 2023
fa62d43
refactor
danieleades Nov 19, 2023
6c34f07
chore: cleanup iced_widget
wash2 Nov 28, 2023
5668408
cleanup git workflows
wash2 Nov 28, 2023
b004b75
cleanup: clippy
wash2 Nov 28, 2023
df3452c
fix: editor and sctk_todos examples
wash2 Nov 28, 2023
7d710e9
reexport limits
wash2 Nov 28, 2023
da1c08d
refactor: udpate gradient angles for slider
wash2 Nov 30, 2023
f08ff47
fix: tooltip children and diff
wash2 Nov 30, 2023
9bbb559
fix: add back the window id to the frames subscription
wash2 Nov 30, 2023
66daa61
fix: CI tests
wash2 Nov 30, 2023
024cb16
chore: remove artifacts job
wash2 Nov 30, 2023
e4a0590
fix: ambiguous palette import
wash2 Nov 30, 2023
f64f6a0
fix: dnd widget layout
wash2 Dec 1, 2023
3d80378
chore: use advanced text shaping for pick list
wash2 Dec 4, 2023
941a5a9
fix: clip mask checks
wash2 Dec 4, 2023
50646ba
fix: set web-sys to =0.3.64
wash2 Dec 4, 2023
73238f1
fix: translate the wayland event position for content inside a scroll…
wash2 Dec 4, 2023
0d673be
fix(example): sctk_drag id
wash2 Dec 6, 2023
9c962a3
cleanup: formatting and clippy
wash2 Dec 7, 2023
37978aa
chore: fix sctk multi-window dependency
wash2 Dec 11, 2023
200cc09
dnd_listener: Fix behavior when there are multiple listeners (#87)
ids1024 Dec 11, 2023
2611d7b
fix: broadcast surface events
wash2 Dec 13, 2023
c155a26
Fixes for last commit
jackpot51 Dec 19, 2023
1a75a1b
Add function to fill a Raw
jackpot51 Dec 19, 2023
d3d89a8
Fix docs error
jackpot51 Jan 12, 2024
590b8ed
Update to cosmic-text refactor
jackpot51 Dec 19, 2023
645a2a9
typo: add rev to glyphon
wash2 Jan 29, 2024
2598830
chore: remove default features
wash2 Jan 29, 2024
7d2564e
fix: core/serde
wash2 Jan 29, 2024
4ffbc79
fix: downgrade resvg
wash2 Jan 29, 2024
aa6ef2b
fix: typo
wash2 Feb 2, 2024
9597f09
chore: use updated softbuffer
wash2 Feb 2, 2024
0c5cf64
feat(wgpu): use alpha modes for compositing if available
wash2 Feb 2, 2024
7ad4d85
fix: distinguish between the key character and the utf8 of a key event
wash2 Feb 2, 2024
9499727
chore: update cosmic-text and glyphon
wash2 Feb 2, 2024
a83d381
fix(winit): pass text with modifiers in event
wash2 Feb 5, 2024
575de00
Update wgpu to a commit that fixes use on Nvidia drivers
ids1024 Feb 6, 2024
dab797f
chore: unpin cosmic-text
wash2 Feb 7, 2024
ef2f139
chore: use pop-os fork of winit
wash2 Feb 7, 2024
273f234
sctk: Add `Subsurface` widget (#79)
ids1024 Feb 8, 2024
68b3e49
Disable broken rustdoc links
jackpot51 Feb 8, 2024
484ac7b
chore: update accesskit
wash2 Feb 8, 2024
8b7b0bf
Remove unnecessary redraw request
jackpot51 Feb 9, 2024
ba4731f
Add `show_window_menu` action
ids1024 Jan 13, 2024
268e210
sctk: add command to set maximize state
jackpot51 Feb 12, 2024
831fa81
fix(sctk): send close event instead of close requested when a window …
wash2 Feb 13, 2024
53a8cc1
fix: autosize surface layout
wash2 Feb 14, 2024
d2dc827
feat(slider): add breakpoints
mmstick Feb 21, 2024
b1a684e
sctk/subsurface: Avoid unnecessary subsurface commits if unchanged
ids1024 Feb 14, 2024
e83c288
sctk/subsurface: Cache `wl_buffer`s
ids1024 Feb 20, 2024
bf5e6b5
examples/sctk_subsurface_gst: Cache `BufferSource` in `BufferRef` qdata
ids1024 Feb 20, 2024
3231920
Handle frame callbacks for subsurfaces, and `commit` parent surface
ids1024 Feb 20, 2024
7b7760f
sctk_subsurface_gst: NV12 surface suppport; disabled
ids1024 Feb 26, 2024
bf032f8
sctk: Add `subsurface_ids` mapping subsurface to parent and offset
ids1024 Feb 27, 2024
b2c581f
sctk_subsurface: Use two surfaces, handle button presses
ids1024 Feb 14, 2024
982174a
sctk: Map subsurface pointer events to parent surface, with offset
ids1024 Feb 27, 2024
e1d1689
fix(multi_window): enable drag resize
jackpot51 Mar 4, 2024
91d912d
fix(sctk): broadcast events after update
wash2 Feb 23, 2024
d06486a
refactor(sctk): optional clipboard
wash2 Mar 5, 2024
c2d5d60
fix(sctk): clipboard dummy impl typo
wash2 Mar 5, 2024
c17007d
fix: clipboard cleanup
wash2 Mar 5, 2024
8cbd24e
fix(sctk): destroy drag icon and send event after cancel action
wash2 Mar 7, 2024
9f8dc93
Use `TypeId` to identify `subscription::Map`
hecrj Feb 4, 2024
9bcfc84
fix(winit): add static lifetimes to application update
mmstick Mar 8, 2024
e7d10f4
fix(winit): add static lifetimes to multi-window application update
mmstick Mar 8, 2024
39426ea
fix(tiny_skia): disable shadows due to rendering glitch
mmstick Mar 13, 2024
6f92812
sctk: Fix handling of layer surface `pointer_interactivity` (#115)
ids1024 Mar 14, 2024
454b953
feat: custom mime types for Clipboard
wash2 Mar 14, 2024
7e85bd8
cleanup docs
wash2 Mar 14, 2024
2bd599c
feat: add actions and commands for new clipboard methods
wash2 Mar 14, 2024
f4bafb8
clippy
wash2 Mar 14, 2024
c76eae7
chore: use tag
wash2 Mar 14, 2024
0260e6c
chore: reexport mime from window_clipboard
wash2 Mar 15, 2024
1d9bb7f
fix: ambiguous import
mmstick Mar 15, 2024
c57f715
feat: winit dnd
wash2 Mar 29, 2024
232c229
fix: doc
wash2 Mar 29, 2024
bc2d154
fix: color format & multi-window
wash2 Mar 30, 2024
a441d81
feat: update advertised drag destinations after rebuilding an interface
wash2 Apr 1, 2024
015a325
fix: docs
wash2 Apr 1, 2024
5b9f77b
fix: pass correct state and layout for container widgets
wash2 Apr 1, 2024
46ef2e2
refactor: remove Sync bound for Message
wash2 Apr 1, 2024
745d846
sctk: Fix handling of DnD with subsurfaces (#122)
ids1024 Apr 3, 2024
f944754
fixes for dnd
wash2 Apr 4, 2024
52187b6
chore: update tag
wash2 Apr 4, 2024
d549c5d
Call unlock on session lock
jackpot51 Apr 5, 2024
a77c6c1
Clean up after lock surfaces are destroyed
jackpot51 Apr 5, 2024
5680ad0
fix(container): id and set_id should use content
wash2 Apr 5, 2024
da63537
fix(scrollable): pass child layout when calculating drag destinations
wash2 Apr 5, 2024
f689948
fix(winit multi-window): handle exit_on_close request
wash2 Apr 5, 2024
ab89ac1
fix: translate offer positions in scrollable
wash2 Apr 9, 2024
1add6cc
chore: update tag
wash2 Apr 9, 2024
f149055
Add read_primary/write_primary
snaggen Apr 10, 2024
b7e7021
fix(tiny-skia): non-simple border scaling
wash2 Apr 11, 2024
c87978d
Update window_clipboard to pop-dnd-4
jackpot51 Apr 13, 2024
3fe3a61
slider & toggler roundness
wash2 Apr 15, 2024
feda333
Send `DataSource` events to all surfaces
ids1024 Apr 22, 2024
900bad5
sctk: Use empty input region for subsurfaces
ids1024 Apr 24, 2024
4c756fe
fix(scrollable): filter scroll events in the wrong direction
wash2 Apr 24, 2024
46b4374
fix(tiny_skia): damage
wash2 Apr 25, 2024
38e9fd6
feat(mouseare): mouse enter and exit
leb-kuchen Apr 13, 2024
364c90c
fix(sctk): nested popup parent
wash2 Apr 23, 2024
deae3d4
sctk: Add support for drag-and-drop surface offsets
ids1024 Apr 25, 2024
08fc97c
Adjust to line ending needing to be specified as part of cosmic_text:…
jackpot51 Apr 30, 2024
1869fe3
fix: clean up dnd surfaces when a window is removed
wash2 May 1, 2024
927a852
fix: update widnow-clipboard tag
wash2 May 1, 2024
317458e
sctk: Add touch support
ids1024 Apr 26, 2024
d756c9d
sctk: Support `start_drag` with drags started from touch events
ids1024 Apr 26, 2024
81a483b
iced_wgpu: Query wayland for the device to use, if possible
Drakulix May 14, 2024
7c58b8e
fix(image): guess the image format before decoding
wash2 May 15, 2024
84d788c
fix: emit Event::Resized to fix nav bar in cosmic-settings
mmstick May 30, 2024
09116a8
fix: better handling of state tree
wash2 May 29, 2024
2dcae59
fix: avoid with_borrow_mut
wash2 May 30, 2024
dc1fea8
fix(core): replace debug_assert in diff
wash2 May 31, 2024
34973a5
fix: update read and write methods so they don't recurse
wash2 May 31, 2024
ce62217
fix: refactor dnd impl to support responsive widget
wash2 May 31, 2024
9ce8c6b
cargo fmt
wash2 May 31, 2024
323f80f
wgpu: fix nvidia gpu powering up in hybrid setups
Drakulix May 28, 2024
ef247e2
wgpu: Fix querying adapter, even if we already have one
Drakulix Jun 3, 2024
c47171d
wgpu: Fix wayland device id conversion
Drakulix Jun 3, 2024
f942212
Adapt to new cosmic-text
jackpot51 Jun 10, 2024
12415d8
fix: unset VK_LOADER_DRIVERS_DISABLE after enumeration
mmstick Jun 11, 2024
7be016e
Adapt to cosmic-text undefined width change
jackpot51 Jun 12, 2024
5409352
Update for cosmic-text undefined buffer size
jackpot51 Jun 12, 2024
31709bb
sctk: Update `sctk`, `wayland-protocols`
ids1024 Jun 7, 2024
3f39d5c
sctk: Add alpha setting to `Subsurface` widget
ids1024 Jun 8, 2024
3b70fe3
sctk: Unmap subsurfaces instead of immediately destroying them
ids1024 Jun 8, 2024
9a366dd
Update `window_clipboard`
ids1024 Jun 12, 2024
296b322
iced_wgpu: don't query Wayland on macos
bjorn-ove Jun 13, 2024
b2921d5
fix: only try to connect to clipboard if on linux
wash2 Jun 19, 2024
d0ba498
fix: enable the tokio feature for accesskit_unix
wash2 Jun 20, 2024
e707391
refactor(sctk): convert window actions
wash2 Jun 27, 2024
4c609e7
fix: settings.decorations enables SSD
wash2 Jun 28, 2024
6f83a8d
fix(core): state order and handling of new trees
wash2 Jul 5, 2024
85b077d
Make text wrap configurable
jackpot51 Jul 9, 2024
5ebfaaf
feat(sctk): support ShowWindowMenu
mmstick Jul 9, 2024
26a8598
improv(sctk): per-surface cursor position tracking
mmstick Jul 10, 2024
dd2e93a
sctk: Fixes for cursor icon
ids1024 Jul 11, 2024
fd3d7c7
feat(sctk): support for overflow widget
wash2 Jul 16, 2024
49d9bf7
wayland: Don't crash if libwayland isn't available
Drakulix Jul 16, 2024
3a9c6c3
refactor: Extract ids_from_dev from wayland specific code
Drakulix Jul 16, 2024
e6a8a07
compositor: Add code to extract adapter from x11
Drakulix Jul 16, 2024
cb315f6
x11: Workaround nvidia driver lacking DRI
Drakulix Jul 16, 2024
fa817c7
feat(mouse area): add double click
leb-kuchen Jul 22, 2024
e31e29e
fix: apply scale to lock surface
wash2 Aug 2, 2024
018051e
Fix quad fill radius calculation
peterkrull Aug 5, 2024
44407b8
Add drag destinations for pane grid
jasonrhansen Aug 4, 2024
23397f6
Adapt to new cosmic-text
jackpot51 Sep 6, 2024
d3a8b01
feat: allow toggler to be disabled
acolombier Sep 7, 2024
1e48a5c
Unrelated build error
acolombier Sep 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,3 @@ jobs:
run: cargo update
- name: Audit vulnerabilities
run: cargo audit

artifacts:
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
- name: Install cargo-outdated
run: cargo install cargo-outdated
- uses: actions/checkout@master
- name: Delete `web-sys` dependency from `integration` example
run: sed -i '$d' examples/integration/Cargo.toml
- name: Find outdated dependencies
run: cargo outdated --workspace --exit-code 1 --ignore raw-window-handle
2 changes: 1 addition & 1 deletion .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Generate documentation
run: |
RUSTDOCFLAGS="--cfg docsrs" \
cargo doc --no-deps --all-features \
cargo doc --no-deps --features "winit" \
-p iced_core \
-p iced_highlighter \
-p iced_style \
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ name: Lint
on: [push, pull_request]
jobs:
all:
runs-on: macOS-latest
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
components: clippy

- uses: actions/checkout@master
- name: Install dependencies
run: |
export DEBIAN_FRONTED=noninteractive
sudo apt-get -qq update
sudo apt-get install -y libxkbcommon-dev libwayland-dev
- name: Check lints
run: cargo lint
run: |
cargo clippy --no-default-features --features "winit" --all-targets
cargo clippy --no-default-features --features "wayland wgpu svg canvas qr_code lazy debug tokio palette web-colors a11y"
36 changes: 33 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,38 @@ jobs:
run: |
export DEBIAN_FRONTED=noninteractive
sudo apt-get -qq update
sudo apt-get install -y libxkbcommon-dev libgtk-3-dev
sudo apt-get install -y libxkbcommon-dev libwayland-dev
- name: Run tests
run: |
cargo test --verbose --workspace
cargo test --verbose --workspace --all-features
cargo test --verbose --features "winit wgpu svg canvas qr_code lazy debug tokio palette web-colors a11y"
cargo test -p iced_accessibility
cargo test -p iced_core
cargo test -p iced_futures
cargo test -p iced_graphics
cargo test -p iced_renderer
cargo test -p iced_runtime
cargo test -p iced_tiny_skia
cargo test -p iced_widget
cargo test -p iced_wgpu
- name: test wayland
if: matrix.os == 'ubuntu-latest'
run: |
cargo test --verbose --features "wayland wgpu svg canvas qr_code lazy debug tokio palette web-colors a11y"
cargo test -p iced_sctk
web:
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
targets: wasm32-unknown-unknown
- uses: actions/checkout@master
- name: Run checks
run: cargo check --package iced --target wasm32-unknown-unknown --no-default-features --features "winit"
- name: Check compilation of `tour` example
run: cargo build --package tour --target wasm32-unknown-unknown
- name: Check compilation of `todos` example
run: cargo build --package todos --target wasm32-unknown-unknown
- name: Check compilation of `integration` example
run: cargo build --package integration --target wasm32-unknown-unknown
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Many thanks to...
- @akshayr-mecha
- @dtzxporter

Many thanks to...
- @edfloreshz
- @jackpot51
- @wash2

## [0.10.0] - 2023-07-28
### Added
- Text shaping, font fallback, and `iced_wgpu` overhaul. [#1697](https://github.com/iced-rs/iced/pull/1697)
Expand Down
93 changes: 66 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ all-features = true
maintenance = { status = "actively-developed" }

[features]
default = ["wgpu"]
# Enable the `wgpu` GPU-accelerated renderer backend
wgpu = ["iced_renderer/wgpu", "iced_widget/wgpu"]
# Enables the `Image` widget
Expand All @@ -32,7 +31,7 @@ qr_code = ["iced_widget/qr_code"]
# Enables lazy widgets
lazy = ["iced_widget/lazy"]
# Enables a debug view in native platforms (press F12)
debug = ["iced_winit/debug"]
debug = ["iced_winit?/debug", "iced_sctk?/debug"]
# Enables `tokio` as the `executor::Default` on native platforms
tokio = ["iced_futures/tokio"]
# Enables `async-std` as the `executor::Default` on native platforms
Expand All @@ -41,18 +40,35 @@ async-std = ["iced_futures/async-std"]
smol = ["iced_futures/smol"]
# Enables advanced color conversion via `palette`
palette = ["iced_core/palette"]
# Enables querying system information
system = ["iced_winit/system"]
# Enables broken "sRGB linear" blending to reproduce color management of the Web
web-colors = ["iced_renderer/web-colors"]
# Enables the WebGL backend, replacing WebGPU
webgl = ["iced_renderer/webgl"]
# Enables the syntax `highlighter` module
highlighter = ["iced_highlighter"]
# Enables experimental multi-window support.
multi-window = ["iced_winit/multi-window"]
multi-window = ["iced_winit?/multi-window"]
# Enables the advanced module
advanced = []
# Enables the `accesskit` accessibility library
a11y = [
"iced_accessibility",
"iced_core/a11y",
"iced_widget/a11y",
"iced_winit?/a11y",
"iced_sctk?/a11y",
]
# Enables the winit shell. Conflicts with `wayland` and `glutin`.
winit = ["iced_winit", "iced_accessibility?/accesskit_winit"]
# Enables the sctk shell. Conflicts with `winit` and `glutin`.
wayland = [
"iced_sctk",
"iced_widget/wayland",
"iced_accessibility?/accesskit_unix",
"iced_core/wayland",
]
# Enables clipboard for iced_sctk
wayland-clipboard = ["iced_sctk?/clipboard"]

[dependencies]
iced_core.workspace = true
Expand All @@ -61,40 +77,50 @@ iced_renderer.workspace = true
iced_widget.workspace = true
iced_winit.features = ["application"]
iced_winit.workspace = true

iced_winit.optional = true
iced_sctk.workspace = true
iced_sctk.optional = true
iced_highlighter.workspace = true
iced_highlighter.optional = true

iced_accessibility.workspace = true
iced_accessibility.optional = true
thiserror.workspace = true
window_clipboard.workspace = true
mime.workspace = true
dnd.workspace = true

image.workspace = true
image.optional = true

[profile.release-opt]
inherits = "release"
codegen-units = 1
debug = false
lto = true
incremental = false
opt-level = 3
overflow-checks = false
strip = "debuginfo"

[workspace]
members = [
"core",
"futures",
"graphics",
"highlighter",
"renderer",
"runtime",
"renderer",
"style",
"tiny_skia",
"wgpu",
"widget",
"winit",
"examples/*",
"accessibility",
"sctk",
]
exclude = ["examples/integration"]


[profile.release-opt]
inherits = "release"
codegen-units = 1
debug = false
lto = true
incremental = false
opt-level = 3
overflow-checks = false
strip = "debuginfo"

[workspace.package]
version = "0.12.0"
Expand All @@ -118,15 +144,17 @@ iced_style = { version = "0.12", path = "style" }
iced_tiny_skia = { version = "0.12", path = "tiny_skia" }
iced_wgpu = { version = "0.12", path = "wgpu" }
iced_widget = { version = "0.12", path = "widget" }
iced_winit = { version = "0.12", path = "winit" }
iced_winit = { version = "0.12", path = "winit", features = ["application"] }
iced_sctk = { version = "0.1", path = "sctk" }
iced_accessibility = { version = "0.1", path = "accessibility" }

async-std = "1.0"
bitflags = "1.0"
bitflags = "2.5"
bytemuck = { version = "1.0", features = ["derive"] }
cosmic-text = "0.10"
cosmic-text = { git = "https://github.com/pop-os/cosmic-text.git" }
futures = "0.3"
glam = "0.24"
glyphon = "0.5"
glyphon = { git = "https://github.com/pop-os/glyphon.git", tag = "v0.5.0" }
guillotiere = "0.6"
half = "2.2"
image = "0.24"
Expand All @@ -141,11 +169,12 @@ ouroboros = "0.17"
palette = "0.7"
qrcode = { version = "0.12", default-features = false }
raw-window-handle = "0.6"
resvg = "0.36"
resvg = "0.37"
rustc-hash = "1.0"
sctk = { package = "smithay-client-toolkit", version = "0.19.1" }
smol = "1.0"
smol_str = "0.2"
softbuffer = "0.4"
softbuffer = { git = "https://github.com/pop-os/softbuffer", tag = "cosmic-4.0" }
syntect = "5.1"
sysinfo = "0.28"
thiserror = "1.0"
Expand All @@ -156,9 +185,19 @@ xxhash-rust = { version = "0.8", features = ["xxh3"] }
unicode-segmentation = "1.0"
wasm-bindgen-futures = "0.4"
wasm-timer = "0.2"
wayland-protocols = { version = "0.32.1", features = ["staging"] }
web-sys = "0.3"
web-time = "0.2"
wgpu = "0.19"
# wgpu = "0.19"
# Newer wgpu commit that fixes Vulkan backend on Nvidia
wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "20fda69" }
winapi = "0.3"
window_clipboard = "0.4"
winit = { git = "https://github.com/iced-rs/winit.git", rev = "b91e39ece2c0d378c3b80da7f3ab50e17bb798a5" }
window_clipboard = { git = "https://github.com/pop-os/window_clipboard.git", tag = "pop-dnd-8" }
dnd = { git = "https://github.com/pop-os/window_clipboard.git", tag = "pop-dnd-8" }
mime = { git = "https://github.com/pop-os/window_clipboard.git", tag = "pop-dnd-8" }
# window_clipboard = { path = "../../window_clipboard" }
# dnd = { path = "../../window_clipboard/dnd" }
# mime = { path = "../../window_clipboard/mime" }
winit = { git = "https://github.com/pop-os/winit.git", branch = "winit-0.29" }


23 changes: 23 additions & 0 deletions accessibility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "iced_accessibility"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
# TODO Ashley re-export more platform adapters

[dependencies]
accesskit = { git = "https://github.com/wash2/accesskit.git", branch = "winit-0.29" }
accesskit_unix = { git = "https://github.com/wash2/accesskit.git", branch = "winit-0.29", optional = true, default-features = false, features = [
"tokio",
] }
accesskit_windows = { git = "https://github.com/wash2/accesskit.git", branch = "winit-0.29", optional = true }
accesskit_macos = { git = "https://github.com/wash2/accesskit.git", branch = "winit-0.29", optional = true }
accesskit_winit = { git = "https://github.com/wash2/accesskit.git", branch = "winit-0.29", optional = true }
# accesskit = { path = "../../../accesskit/common/", version = "0.12.2" }
# accesskit_unix = { path = "../../../accesskit/platforms/unix/", version = "0.7.1", optional = true, default-features = false, features = [
# "tokio",
# ] }
# accesskit_windows = { path = "../../../accesskit/platforms/windows/", version = "0.16.0", optional = true }
# accesskit_macos = { path = "../../../accesskit/platforms/macos/", version = "0.11.0", optional = true }
# accesskit_winit = { path = "../../../accesskit/platforms/winit/", version = "0.18.1", optional = true }
80 changes: 80 additions & 0 deletions accessibility/src/a11y_tree.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
use crate::{A11yId, A11yNode, IdEq};

#[derive(Debug, Clone, Default)]
/// Accessible tree of nodes
pub struct A11yTree {
/// The root of the current widget, children of the parent widget or the Window if there is no parent widget
root: Vec<A11yNode>,
/// The children of a widget and its children
children: Vec<A11yNode>,
}

impl A11yTree {
/// Create a new A11yTree
/// XXX if you use this method, you will need to manually add the children of the root nodes
pub fn new(root: Vec<A11yNode>, children: Vec<A11yNode>) -> Self {
Self { root, children }
}

pub fn leaf<T: Into<A11yId>>(node: accesskit::NodeBuilder, id: T) -> Self {
Self {
root: vec![A11yNode::new(node, id)],
children: vec![],
}
}

/// Helper for creating an A11y tree with a single root node and some children
pub fn node_with_child_tree(mut root: A11yNode, child_tree: Self) -> Self {
root.add_children(
child_tree.root.iter().map(|n| n.id()).cloned().collect(),
);
Self {
root: vec![root],
children: child_tree
.children
.into_iter()
.chain(child_tree.root)
.collect(),
}
}

/// Joins multiple trees into a single tree
pub fn join<T: Iterator<Item = Self>>(trees: T) -> Self {
trees.fold(Self::default(), |mut acc, A11yTree { root, children }| {
acc.root.extend(root);
acc.children.extend(children);
acc
})
}

pub fn root(&self) -> &Vec<A11yNode> {
&self.root
}

pub fn children(&self) -> &Vec<A11yNode> {
&self.children
}

pub fn root_mut(&mut self) -> &mut Vec<A11yNode> {
&mut self.root
}

pub fn children_mut(&mut self) -> &mut Vec<A11yNode> {
&mut self.children
}

pub fn contains(&self, id: &A11yId) -> bool {
self.root.iter().any(|n| IdEq::eq(n.id(), id))
|| self.children.iter().any(|n| IdEq::eq(n.id(), id))
}
}

impl From<A11yTree> for Vec<(accesskit::NodeId, accesskit::Node)> {
fn from(tree: A11yTree) -> Vec<(accesskit::NodeId, accesskit::Node)> {
tree.root
.into_iter()
.map(|node| node.into())
.chain(tree.children.into_iter().map(|node| node.into()))
.collect()
}
}
Loading