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

Rebase 2024-11-04 onto 50340b4 #186

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f4d0387
Dismiss `large-enum-variant` lint
hecrj Oct 22, 2024
415fd4f
Use BTreeMap for Ord iteration of panes
tarkah Oct 4, 2024
9ac3318
Retain widget state against incoming panes
tarkah Oct 4, 2024
5ebd8ac
Keep `Pane` associated to state / layout after swap
tarkah Oct 4, 2024
659669d
Remove duplicated `maximized` state in `pane_grid`
hecrj Oct 24, 2024
089e629
Fix `responsive` diffing when `Tree` is emptied by ancestors
hecrj Oct 24, 2024
55504ff
Rename `state::Widget` to `pane_grid::Memory`
hecrj Oct 24, 2024
d08bc6e
Add `relabel` helper to `pane_grid::State`
hecrj Oct 24, 2024
17b35df
Merge pull request #2628 from tarkah/fix/pane-grid-continuity
hecrj Oct 24, 2024
6ed88f7
Prevent unintended keyboard input during focus.
kosayoda Oct 24, 2024
d660fad
Merge pull request #2649 from kosayoda/window-focus-fix
hecrj Oct 25, 2024
f3733a8
Use float total_cmp instead of partial_cmp to get a total order.
Oct 26, 2024
50340b4
Merge pull request #2651 from rhogenson/total-cmp
hecrj Oct 28, 2024
c75a4cf
Use crates.io release for `winit`
hecrj Nov 10, 2022
35ac38e
feat: pop-os megasquash
wash2 May 2, 2023
50ef09a
Make iced_wgpu build on redox
jackpot51 Oct 9, 2024
98b74cd
add reserved Id
wash2 Oct 16, 2024
441025d
cleanup
wash2 Oct 16, 2024
e6d66f6
fix: derive serde traits
wash2 Oct 16, 2024
0e5f000
cargo fmt
wash2 Oct 17, 2024
e464f66
clippy
wash2 Oct 18, 2024
bfe5051
fix: scrollable direction
wash2 Oct 18, 2024
7453ec2
Fix doc links
jackpot51 Oct 18, 2024
c0eaafb
fix: docs
wash2 Oct 21, 2024
1e1d8e9
refactor: disable wayland in winit shell by default
wash2 Oct 21, 2024
bbef04a
fix: log warning instead of panicing for current_monitor
wash2 Oct 21, 2024
aa65669
fix: filter out events with no window id, if the window id is needed
wash2 Oct 21, 2024
13765e2
fix(sctk): reduce event spam for redraw requests
wash2 Oct 22, 2024
fa5b864
Implement fill_raw
jackpot51 Oct 22, 2024
2243951
fix: slider rendering
wash2 Oct 22, 2024
4d61c1c
refactor: apply requested size for surface after creation
wash2 Oct 23, 2024
aff405f
fix: reverse sctk scroll direction
wash2 Oct 24, 2024
610a315
improv: expose set_blur
edfloreshz Oct 30, 2024
703133f
fix: use enable and disable methods
edfloreshz Oct 30, 2024
8aa549d
fix: documentation
edfloreshz Oct 30, 2024
e72dbf1
fix: scrollbar width
git-f0x Nov 4, 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@v2
# - 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
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ jobs:
- uses: hecrj/setup-rust-action@v2
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 libgtk-3-dev
sudo apt-get install -y libxkbcommon-dev libgtk-3-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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ Many thanks to...
- @wiiznokes
- @woelfman
- @Zaubentrucker
- @ryanabx
- @edfloreshz

## [0.12.1] - 2024-02-22
### Added
Expand Down Expand Up @@ -413,6 +415,10 @@ Many thanks to...
- @william-shere
- @wyatt-herkamp

Many thanks to...
- @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
91 changes: 70 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ all-features = true
maintenance = { status = "actively-developed" }

[features]
default = ["wgpu", "tiny-skia", "fira-sans", "auto-detect-theme"]
default = ["tiny-skia"]
# Enable the `wgpu` GPU-accelerated renderer backend
wgpu = ["iced_renderer/wgpu", "iced_widget/wgpu"]
# Enable the `tiny-skia` software renderer backend
Expand All @@ -42,11 +42,11 @@ markdown = ["iced_widget/markdown"]
# Enables lazy widgets
lazy = ["iced_widget/lazy"]
# Enables a debug view in native platforms (press F12)
debug = ["iced_winit/debug"]
debug = ["iced_winit?/debug"]
# Enables `tokio` as the `executor::Default` on native platforms
tokio = ["iced_futures/tokio"]
tokio = ["iced_futures/tokio", "iced_accessibility?/tokio"]
# Enables `async-std` as the `executor::Default` on native platforms
async-std = ["iced_futures/async-std"]
async-std = ["iced_futures/async-std", "iced_accessibility?/async-io"]
# Enables `smol` as the `executor::Default` on native platforms
smol = ["iced_futures/smol"]
# Enables querying system information
Expand All @@ -58,28 +58,45 @@ webgl = ["iced_renderer/webgl"]
# Enables the syntax `highlighter` module
highlighter = ["iced_highlighter", "iced_widget/highlighter"]
# Enables experimental multi-window support.
multi-window = ["iced_winit/multi-window"]
multi-window = ["iced_winit?/multi-window"]
# Enables the advanced module
advanced = ["iced_core/advanced", "iced_widget/advanced"]
# Enables embedding Fira Sans as the default font on Wasm builds
fira-sans = ["iced_renderer/fira-sans"]


# Enables auto-detecting light/dark mode for the built-in theme
auto-detect-theme = ["iced_core/auto-detect-theme"]
# Enables strict assertions for debugging purposes at the expense of performance
strict-assertions = ["iced_renderer/strict-assertions"]
# Enables the `accesskit` accessibility library
a11y = [
"iced_accessibility",
"iced_core/a11y",
"iced_widget/a11y",
"iced_winit?/a11y",
]
# Enables the winit shell. Conflicts with `wayland` and `glutin`.
winit = ["iced_winit", "iced_accessibility?/accesskit_winit"]


# Enables the sctk shell.
wayland = ["iced_widget/wayland", "iced_core/wayland", "iced_winit/wayland"]
[dependencies]
iced_core.workspace = true
iced_futures.workspace = true
iced_renderer.workspace = true
iced_widget.workspace = true
iced_winit.features = ["program"]
iced_winit.workspace = true

iced_winit.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
Expand Down Expand Up @@ -116,7 +133,9 @@ members = [
"widget",
"winit",
"examples/*",
"accessibility",
]
exclude = ["examples/integration"]

[workspace.package]
version = "0.14.0-dev"
Expand All @@ -141,16 +160,27 @@ iced_tiny_skia = { version = "0.14.0-dev", path = "tiny_skia" }
iced_wgpu = { version = "0.14.0-dev", path = "wgpu" }
iced_widget = { version = "0.14.0-dev", path = "widget" }
iced_winit = { version = "0.14.0-dev", path = "winit" }
iced_accessibility = { version = "0.1", path = "accessibility" }

async-std = "1.0"
bitflags = "2.0"
# bitflags = "2.0"
bitflags = "2.5"
bytemuck = { version = "1.0", features = ["derive"] }
bytes = "1.6"
cosmic-text = "0.12"

cosmic-text = { git = "https://github.com/pop-os/cosmic-text.git" }
# cosmic-text = "0.10"


dark-light = "1.0"
futures = "0.3"
glam = "0.25"
glyphon = { git = "https://github.com/hecrj/glyphon.git", rev = "0d7ba1bba4dd71eb88d2cface5ce649db2413cb7" }
glyphon = { package = "iced_glyphon", git = "https://github.com/pop-os/glyphon.git", tag = "iced-0.14-dev" }
# glyphon = { package = "iced_glyphon", path = "../../../glyphon" }
resvg = "0.42"


web-sys = "0.3.69"
guillotiere = "0.6"
half = "2.2"
image = { version = "0.24", default-features = false }
Expand All @@ -166,12 +196,12 @@ palette = "0.7"
pulldown-cmark = "0.11"
qrcode = { version = "0.13", default-features = false }
raw-window-handle = "0.6"
resvg = "0.42"
rustc-hash = "2.0"
sctk = { package = "smithay-client-toolkit", version = "0.19.1" }
smol = "1.0"
smol_str = "0.2"
softbuffer = "0.4"
syntect = "5.1"
softbuffer = { git = "https://github.com/pop-os/softbuffer", tag = "cosmic-4.0" }
syntect = "5.2"
sysinfo = "0.30"
thiserror = "1.0"
tiny-skia = "0.11"
Expand All @@ -181,18 +211,33 @@ unicode-segmentation = "1.0"
url = "2.5"
wasm-bindgen-futures = "0.4"
wasm-timer = "0.2"
web-sys = "0.3.69"
web-time = "1.1"
wgpu = "22.0"
wayland-protocols = { version = "0.32.1", features = ["staging"] }
# web-time = "1.1"


# wgpu = "0.19"
# Newer wgpu commit that fixes Vulkan backend on Nvidia
winapi = "0.3"
window_clipboard = "0.4.1"
winit = { git = "https://github.com/iced-rs/winit.git", rev = "254d6b3420ce4e674f516f7a2bd440665e05484d" }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what happened here, none of the commits from iced/master should have my name as the committer...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically c75a4cf if that didn't show up with my comment

# window_clipboard = "0.4.1"

window_clipboard = { git = "https://github.com/pop-os/window_clipboard.git", tag = "pop-0.13" }
dnd = { git = "https://github.com/pop-os/window_clipboard.git", tag = "pop-0.13" }
mime = { git = "https://github.com/pop-os/window_clipboard.git", tag = "pop-0.13" }
winit = { git = "https://github.com/pop-os/winit.git", tag = "iced-xdg-surface-0.13" }
# winit = { path = "../../winit" }
# winit = { git = "https://github.com/iced-rs/winit.git", rev = "254d6b3420ce4e674f516f7a2bd440665e05484d" }
# winit = { git = "https://github.com/rust-windowing/winit.git", rev = "241b7a80bba96c91fa3901729cd5dec66abb9be4" }
# winit = { path = "../../../winit" }


[workspace.lints.rust]
rust_2018_idioms = { level = "forbid", priority = -1 }
missing_debug_implementations = "deny"
missing_docs = "deny"
unsafe_code = "deny"
# rust_2018_idioms = { level = "forbid", priority = -1 }
# missing_debug_implementations = "deny"
# missing_docs = "deny"
# unsafe_code = "deny"
# TODO(POP): We have some unsafe code that needs to be fixed
unused_results = "deny"

[workspace.lints.clippy]
Expand All @@ -212,3 +257,7 @@ useless_conversion = "deny"

[workspace.lints.rustdoc]
broken_intra_doc_links = "forbid"

# [patch."https://github.com/rust-windowing/winit.git"]
# winit = { git = "https://github.com/rust-windowing/winit.git", rev = "241b7a80bba96c91fa3901729cd5dec66abb9be4" }
# winit = { path = "../../../winit" }
24 changes: 24 additions & 0 deletions accessibility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[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
[features]
async-io = ["accesskit_winit?/async-io"]
tokio = ["accesskit_winit?/tokio"]

[dependencies]
accesskit = { git = "https://github.com/wash2/accesskit", tag = "iced-xdg-surface-0.13" }
accesskit_windows = { git = "https://github.com/wash2/accesskit", tag = "iced-xdg-surface-0.13", optional = true }
accesskit_macos = { git = "https://github.com/wash2/accesskit", tag = "iced-xdg-surface-0.13", optional = true }
accesskit_winit = { git = "https://github.com/wash2/accesskit", tag = "iced-xdg-surface-0.13", optional = true, default-features = false, features = [
"rwh_06",
] }
# accesskit = { path = "../../../../accesskit/common" }
# accesskit_windows = { path = "../../../../accesskit/platforms/windows", optional = true }
# accesskit_macos = { path = "../../../../accesskit/platforms/macos", optional = true }
# accesskit_winit = { path = "../../../../accesskit/platforms/winit", optional = true, default-features = false, features = [
# "rwh_06",
# ] }
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