Skip to content

Commit

Permalink
fix: CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Nov 30, 2023
1 parent 9af6bbb commit 6e2044e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/svg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ publish = false

[dependencies]
iced.workspace = true
iced.features = ["svg"]
iced.features = ["svg", "winit"]
3 changes: 1 addition & 2 deletions examples/todos/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use iced::alignment::{self, Alignment};
use iced::font::{self, Font};
use iced::keyboard::{self, KeyCode, Modifiers};
use iced::subscription;
use iced::keyboard;
use iced::theme::{self, Theme};
use iced::widget::{
self, button, checkbox, column, container, keyed_column, row, scrollable,
Expand Down
24 changes: 11 additions & 13 deletions sctk/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use iced_futures::{
renderer::Style,
time::Instant,
widget::{
operation::{self, focusable::focus, OperationWrapper},
operation::{self, OperationWrapper},
tree, Operation, Tree,
},
Widget,
Expand All @@ -48,7 +48,7 @@ use std::{
use wayland_backend::client::ObjectId;
use wayland_protocols::wp::viewporter::client::wp_viewport::WpViewport;

use iced_graphics::{compositor, renderer, Compositor, Viewport};
use iced_graphics::{compositor, Compositor, Viewport};
use iced_runtime::{
clipboard,
command::{
Expand Down Expand Up @@ -822,7 +822,7 @@ where
// Dnd Surfaces are only drawn once

let id = wl_surface.id();
let (native_id, e, node) = match dnd_icon {
let (native_id, _e, node) = match dnd_icon {
DndIcon::Custom(id) => {
let mut e = application.view(id);
let state = e.as_widget().state();
Expand Down Expand Up @@ -1428,12 +1428,14 @@ where
});
}
Action::Focus => {
commands.push(Command::widget(focus(
iced_runtime::core::id::Id::from(u128::from(
request.target.0,
)
as u64),
)));
commands.push(Command::widget(
operation::focusable::focus(
iced_runtime::core::id::Id::from(u128::from(
request.target.0,
)
as u64),
),
));
}
Action::Blur => todo!(),
Action::Collapse => todo!(),
Expand Down Expand Up @@ -1666,10 +1668,6 @@ where
self.frame = frame;
}

pub(crate) fn frame(&self) -> Option<&WlSurface> {
self.frame.as_ref()
}

pub(crate) fn first(&self) -> bool {
self.first
}
Expand Down
4 changes: 2 additions & 2 deletions sctk/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use sctk::{
use xkeysym::{key, RawKeysym};

lazy_static::lazy_static! {
pub static ref key_conversion: HashMap<u32, KeyCode> = [
pub static ref KEY_CONVERSION: HashMap<u32, KeyCode> = [
(key::_1, KeyCode::Key1), (key::_2, KeyCode::Key2), (key::_3, KeyCode::Key3), (key::_4, KeyCode::Key4), (key::_5, KeyCode::Key5), (key::_6, KeyCode::Key6), (key::_7, KeyCode::Key7), (key::_8, KeyCode::Key8), (key::_9, KeyCode::Key9), (key::_0, KeyCode::Key0),
// Letters.
(key::A, KeyCode::A), (key::a, KeyCode::A), (key::B, KeyCode::B), (key::b, KeyCode::B), (key::C, KeyCode::C), (key::c, KeyCode::C), (key::D, KeyCode::D), (key::d, KeyCode::D), (key::E, KeyCode::E), (key::e, KeyCode::E), (key::F, KeyCode::F), (key::f, KeyCode::F), (key::G, KeyCode::G), (key::g, KeyCode::G), (key::H, KeyCode::H), (key::h, KeyCode::H), (key::I, KeyCode::I), (key::i, KeyCode::I), (key::J, KeyCode::J), (key::j, KeyCode::J), (key::K, KeyCode::K), (key::k, KeyCode::K), (key::L, KeyCode::L), (key::l, KeyCode::L), (key::M, KeyCode::M), (key::m, KeyCode::M), (key::N, KeyCode::N), (key::n, KeyCode::N), (key::O, KeyCode::O), (key::o, KeyCode::O), (key::P, KeyCode::P), (key::p, KeyCode::P), (key::Q, KeyCode::Q), (key::q, KeyCode::Q), (key::R, KeyCode::R), (key::r, KeyCode::R), (key::S, KeyCode::S), (key::s, KeyCode::S), (key::T, KeyCode::T), (key::t, KeyCode::T), (key::U, KeyCode::U), (key::u, KeyCode::U), (key::V, KeyCode::V), (key::v, KeyCode::V), (key::W, KeyCode::W), (key::w, KeyCode::W), (key::X, KeyCode::X), (key::x, KeyCode::X), (key::Y, KeyCode::Y), (key::y, KeyCode::Y), (key::Z, KeyCode::Z), (key::z, KeyCode::Z),
Expand Down Expand Up @@ -156,7 +156,7 @@ pub fn modifiers_to_native(mods: Modifiers) -> keyboard::Modifiers {
}

pub fn keysym_to_vkey(keysym: RawKeysym) -> Option<KeyCode> {
key_conversion.get(&keysym).cloned()
KEY_CONVERSION.get(&keysym).cloned()
}

pub(crate) fn cursor_icon(cursor: Interaction) -> CursorIcon {
Expand Down
4 changes: 2 additions & 2 deletions sctk/src/event_loop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ where
surface: &WlSurface,
app_id: Option<String>,
surface_title: Option<String>,
role: iced_accessibility::accesskit::Role,
_role: iced_accessibility::accesskit::Role,
) -> adapter::IcedSctkAdapter {
use iced_accessibility::{
accesskit::{
Node, NodeBuilder, NodeClassSet, NodeId, Role, Tree, TreeUpdate,
NodeBuilder, NodeClassSet, NodeId, Role, Tree, TreeUpdate,
},
accesskit_unix::Adapter,
window_node_id,
Expand Down
4 changes: 2 additions & 2 deletions src/wayland/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::runtime::window::Id;
use crate::{Command, Element, Executor, Settings, Subscription};
use crate::{Command, Element, Executor, Settings as Settings_, Subscription};

/// wayland sandbox
pub mod sandbox;
Expand Down Expand Up @@ -119,7 +119,7 @@ pub trait Application: Sized {
/// [`Error`] during startup.
///
/// [`Error`]: crate::Error
fn run(settings: Settings<Self::Flags>) -> crate::Result
fn run(settings: Settings_<Self::Flags>) -> crate::Result
where
Self: 'static,
{
Expand Down
2 changes: 0 additions & 2 deletions widget/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ pub mod qr_code;
pub use qr_code::QRCode;

#[cfg(feature = "wayland")]
#[doc(no_inline)]
pub mod dnd_listener;
#[cfg(feature = "wayland")]
#[doc(no_inline)]
pub mod dnd_source;

type Renderer<Theme = style::Theme> = renderer::Renderer<Theme>;

0 comments on commit 6e2044e

Please sign in to comment.