Skip to content

Commit

Permalink
Merge pull request #65 from maaku/update-deps
Browse files Browse the repository at this point in the history
Update dependencies to latest upstream (notably winit -> 0.30, wgpu -> 0.20, accesskit -> 0.16)
  • Loading branch information
wtholliday authored Jul 14, 2024
2 parents 692ae13 + 206a304 commit 708a3d0
Show file tree
Hide file tree
Showing 9 changed files with 355 additions and 428 deletions.
11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ default = [ "winit" ]

[dependencies]
euclid = "0.22.7"
wgpu = "0.18.0"
wgpu = "0.20.0"
futures = "0.3"
vger = "0.2.8"
accesskit = "0.11.0"
vger = "0.3"
accesskit = "0.16.0"
lazy_static = "1.4.0"
winit = { version = "0.28.1", optional = true }
winit = { version = "0.30", optional = true }
log = "0.4"

# Seems we can't publish to crates.io with this dependency.
Expand All @@ -35,6 +35,5 @@ log = "0.4"
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2.76"
web-sys = { version = "^0.3.61", features = ["Location"] }
log = "0.4"
console_log = "0.1.2"
console_log = "1"
console_error_panic_hook = "0.1.6"
7 changes: 2 additions & 5 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ pub(crate) type StateMap = HashMap<ViewId, StateHolder>;

pub(crate) type EnvMap = HashMap<TypeId, Box<dyn Any>>;

pub struct RenderInfo<'a> {
pub struct RenderInfo<'a, 'window> {
pub device: &'a wgpu::Device,
pub surface: &'a wgpu::Surface,
pub surface: &'a wgpu::Surface<'window>,
pub config: &'a wgpu::SurfaceConfiguration,
pub queue: &'a wgpu::Queue,
}
Expand Down Expand Up @@ -113,8 +113,6 @@ pub struct Context {
/// Render the dirty rectangle for debugging?
render_dirty: bool,

pub(crate) access_node_classes: accesskit::NodeClassSet,

/// Lock the cursor in position. Useful for dragging knobs.
pub(crate) grab_cursor: bool,

Expand Down Expand Up @@ -152,7 +150,6 @@ impl Context {
window_size: Size2D::default(),
root_offset: LocalOffset::zero(),
render_dirty: false,
access_node_classes: accesskit::NodeClassSet::default(),
grab_cursor: false,
prev_grab_cursor: false,
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub use vger;
use vger::color::*;
pub use vger::{LineMetrics, PaintIndex, Vger};

#[cfg(feature = "winit")]
#[cfg(all(feature = "winit", not(target_arch = "wasm32")))]
#[macro_use]
extern crate lazy_static;

Expand Down
2 changes: 1 addition & 1 deletion src/viewid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl ViewId {
/// Returns the corresponding AccessKit ID. We're assuming
/// the underlying u64 isn't zero.
pub fn access_id(&self) -> accesskit::NodeId {
accesskit::NodeId(std::num::NonZeroU128::new(self.id as u128).unwrap())
accesskit::NodeId(self.id)
}

pub fn is_default(self) -> bool {
Expand Down
5 changes: 1 addition & 4 deletions src/views/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,7 @@ where
.collect();

builder.set_children(children);
nodes.push((
cx.view_id(path).access_id(),
builder.build(&mut cx.access_node_classes),
));
nodes.push((cx.view_id(path).access_id(), builder.build()));
Some(cx.view_id(path).access_id())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ where
Some(cid) => vec![cid],
None => vec![],
});
nodes.push((aid, builder.build(&mut cx.access_node_classes)));
nodes.push((aid, builder.build()));
Some(aid)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl<VT: ViewTuple + 'static, D: StackDirection + 'static> View for Stack<VT, D>
});
builder.set_children(children);
let aid = cx.view_id(path).access_id();
nodes.push((aid, builder.build(&mut cx.access_node_classes)));
nodes.push((aid, builder.build()));
Some(aid)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/views/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ impl View for Text {
nodes: &mut Vec<(accesskit::NodeId, accesskit::Node)>,
) -> Option<accesskit::NodeId> {
let aid = cx.view_id(path).access_id();
let mut builder = accesskit::NodeBuilder::new(accesskit::Role::LabelText);
let mut builder = accesskit::NodeBuilder::new(accesskit::Role::Label);
builder.set_name(self.text.clone());
nodes.push((aid, builder.build(&mut cx.access_node_classes)));
nodes.push((aid, builder.build()));
Some(aid)
}
}
Expand Down Expand Up @@ -109,9 +109,9 @@ where
nodes: &mut Vec<(accesskit::NodeId, accesskit::Node)>,
) -> Option<accesskit::NodeId> {
let aid = cx.view_id(path).access_id();
let mut builder = accesskit::NodeBuilder::new(accesskit::Role::LabelText);
let mut builder = accesskit::NodeBuilder::new(accesskit::Role::Label);
builder.set_name(format!("{}", self));
nodes.push((aid, builder.build(&mut cx.access_node_classes)));
nodes.push((aid, builder.build()));
Some(aid)
}
}
Expand Down
Loading

0 comments on commit 708a3d0

Please sign in to comment.