Skip to content

Commit 52061d5

Browse files
committed
chore: update to iced0.14
1 parent 221878a commit 52061d5

File tree

10 files changed

+134
-157
lines changed

10 files changed

+134
-157
lines changed

Cargo.lock

Lines changed: 87 additions & 125 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,16 @@ rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [
7070
] }
7171
rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"] }
7272

73-
iced = { git = "https://github.com/iced-rs/iced.git", default-features = false }
74-
iced_runtime = { git = "https://github.com/iced-rs/iced.git" }
75-
#iced_style = "0.13"
76-
iced_core = { git = "https://github.com/iced-rs/iced.git" }
77-
iced_program = { git = "https://github.com/iced-rs/iced.git" }
78-
iced_renderer = { git = "https://github.com/iced-rs/iced.git" }
79-
iced_futures = { git = "https://github.com/iced-rs/iced.git" }
80-
iced_graphics = { git = "https://github.com/iced-rs/iced.git" }
81-
iced_debug = { git = "https://github.com/iced-rs/iced.git" }
82-
iced_devtools = { git = "https://github.com/iced-rs/iced.git" }
83-
iced_widget = { git = "https://github.com/iced-rs/iced.git" }
73+
iced = "0.14"
74+
iced_runtime = "0.14"
75+
iced_core = "0.14"
76+
iced_program = "0.14"
77+
iced_renderer = "0.14"
78+
iced_futures = "0.14"
79+
iced_graphics = "0.14"
80+
iced_debug = "0.14"
81+
iced_devtools = "0.14"
82+
iced_widget = "0.14"
8483
window_clipboard = "0.4.1"
8584

8685
bitflags = "2.9.0"

iced_layershell/src/build_pattern/daemon.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ impl<P: Program> Daemon<P> {
682682
} else {
683683
None
684684
},
685+
..Default::default()
685686
};
686687
use layershellev::StartMode;
687688
assert!(

iced_layershell/src/conversion.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub fn window_event(
8989
text,
9090
modified_key,
9191
physical_key,
92+
repeat: false,
9293
},
9394
ElementState::Released => keyboard::Event::KeyReleased {
9495
key,
@@ -170,8 +171,8 @@ pub(crate) fn mouse_interaction(interaction: mouse::Interaction) -> String {
170171
match interaction {
171172
Interaction::None => Shape::Default.name().to_owned(),
172173
Interaction::Idle => Shape::Wait.name().to_owned(),
174+
Interaction::Wait => Shape::Wait.name().to_owned(),
173175
Interaction::Pointer => Shape::Pointer.name().to_owned(),
174-
Interaction::Working => Shape::Pointer.name().to_owned(),
175176
Interaction::Grab => Shape::Grab.name().to_owned(),
176177
Interaction::Text => Shape::Text.name().to_owned(),
177178
Interaction::ZoomIn => Shape::ZoomIn.name().to_owned(),
@@ -187,6 +188,7 @@ pub(crate) fn mouse_interaction(interaction: mouse::Interaction) -> String {
187188
Interaction::ZoomOut => Shape::ZoomOut.name().to_owned(),
188189
Interaction::ResizingDiagonallyUp => Shape::NwseResize.name().to_owned(),
189190
Interaction::ResizingDiagonallyDown => Shape::NwseResize.name().to_owned(),
191+
_ => Shape::Default.name().to_owned(),
190192
}
191193
}
192194

iced_layershell/src/ime_preedit.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub struct Preedit<Renderer>
88
where
99
Renderer: text::Renderer,
1010
{
11-
position: Point,
11+
cursor: Rectangle,
1212
content: Renderer::Paragraph,
1313
spans: Vec<text::Span<'static, (), Renderer::Font>>,
1414
}
@@ -28,20 +28,20 @@ where
2828
{
2929
pub fn new() -> Self {
3030
Self {
31-
position: Point::ORIGIN,
31+
cursor: Rectangle::default(),
3232
spans: Vec::new(),
3333
content: Renderer::Paragraph::default(),
3434
}
3535
}
3636

3737
pub fn update(
3838
&mut self,
39-
position: Point,
39+
cursor: Rectangle,
4040
preedit: &input_method::Preedit,
4141
background: Color,
4242
renderer: &Renderer,
4343
) {
44-
self.position = position;
44+
self.cursor = cursor;
4545

4646
let spans = match &preedit.selection {
4747
Some(selection) => {
@@ -94,7 +94,7 @@ where
9494
}
9595

9696
let mut bounds = Rectangle::new(
97-
self.position - Vector::new(0.0, self.content.min_height()),
97+
self.cursor.position() - Vector::new(0.0, self.content.min_height()),
9898
self.content.min_bounds(),
9999
);
100100

iced_layershell/src/multi_window.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,14 @@ where
320320

321321
async fn create_compositor(mut self, window: Arc<WindowWrapper>) -> Self {
322322
let shell = Shell::new(self.proxy.clone());
323-
let mut new_compositor = C::new(self.compositor_settings, window.clone(), shell)
324-
.await
325-
.expect("Cannot create compositer");
323+
let mut new_compositor = C::new(
324+
self.compositor_settings,
325+
window.clone(),
326+
window.clone(),
327+
shell,
328+
)
329+
.await
330+
.expect("Cannot create compositer");
326331
for font in self.fonts.clone() {
327332
new_compositor.load_font(font);
328333
}
@@ -971,9 +976,9 @@ where
971976
}
972977
}
973978
iced_core::InputMethod::Enabled {
974-
position,
975979
purpose,
976980
preedit: _,
981+
cursor,
977982
} => {
978983
if ime_flags.contains(ImeState::Allowed) {
979984
ev.set_ime_allowed(true);
@@ -982,7 +987,7 @@ where
982987
if ime_flags.contains(ImeState::Update) {
983988
ev.set_ime_purpose(conversion::ime_purpose(purpose));
984989
ev.set_ime_cursor_area(
985-
layershellev::dpi::LogicalPosition::new(position.x, position.y),
990+
layershellev::dpi::LogicalPosition::new(cursor.x, cursor.y),
986991
layershellev::dpi::LogicalSize {
987992
width: 10,
988993
height: 10,

iced_layershell/src/multi_window/window_manager.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ where
2828
pub state: State<P>,
2929
pub mouse_interaction: mouse::Interaction,
3030
preedit: Option<Preedit<P::Renderer>>,
31-
ime_state: Option<(iced_core::Point, input_method::Purpose)>,
31+
ime_state: Option<(iced_core::Rectangle, input_method::Purpose)>,
3232
}
3333

3434
pub struct WindowManager<P: Program, C: Compositor>
@@ -166,18 +166,18 @@ where
166166
match input_method {
167167
InputMethod::Disabled => self.disable_ime(),
168168
InputMethod::Enabled {
169-
position,
170169
purpose,
171170
preedit,
171+
cursor,
172172
} => {
173173
let mut flags = ImeState::empty();
174174
if self.ime_state.is_none() {
175175
flags.insert(ImeState::Allowed);
176176
}
177-
if self.ime_state != Some((position, purpose)) {
177+
if self.ime_state != Some((cursor, purpose)) {
178178
flags.insert(ImeState::Update);
179179
}
180-
self.update_ime(position, purpose);
180+
self.update_ime(cursor, purpose);
181181

182182
if let Some(preedit) = preedit {
183183
if preedit.content.is_empty() {
@@ -186,7 +186,7 @@ where
186186
let mut overlay = self.preedit.take().unwrap_or_else(Preedit::new);
187187

188188
overlay.update(
189-
position,
189+
cursor,
190190
&preedit,
191191
self.state.background_color(),
192192
&self.renderer,
@@ -216,7 +216,7 @@ where
216216
}
217217
}
218218

219-
fn update_ime(&mut self, position: iced_core::Point, purpose: input_method::Purpose) {
219+
fn update_ime(&mut self, position: iced_core::Rectangle, purpose: input_method::Purpose) {
220220
if self.ime_state != Some((position, purpose)) {
221221
self.ime_state = Some((position, purpose));
222222
}

iced_sessionlock/src/build_pattern.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ mod pattern {
617617
} else {
618618
None
619619
},
620+
..Default::default()
620621
};
621622
crate::multi_window::run(program, settings, renderer_settings)
622623
}

iced_sessionlock/src/conversion.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ pub fn window_event(
128128
text,
129129
modified_key,
130130
physical_key,
131+
repeat: false,
131132
},
132133
ElementState::Released => keyboard::Event::KeyReleased {
133134
physical_key,
@@ -153,8 +154,8 @@ pub(crate) fn mouse_interaction(interaction: mouse::Interaction) -> String {
153154
match interaction {
154155
Interaction::None => Shape::Default.name().to_owned(),
155156
Interaction::Idle => Shape::Wait.name().to_owned(),
157+
Interaction::Wait => Shape::Wait.name().to_owned(),
156158
Interaction::Pointer => Shape::Pointer.name().to_owned(),
157-
Interaction::Working => Shape::Pointer.name().to_owned(),
158159
Interaction::Grab => Shape::Grab.name().to_owned(),
159160
Interaction::Text => Shape::Text.name().to_owned(),
160161
Interaction::ZoomIn => Shape::ZoomIn.name().to_owned(),
@@ -170,6 +171,7 @@ pub(crate) fn mouse_interaction(interaction: mouse::Interaction) -> String {
170171
Interaction::ZoomOut => Shape::ZoomOut.name().to_owned(),
171172
Interaction::ResizingDiagonallyUp => Shape::NwseResize.name().to_owned(),
172173
Interaction::ResizingDiagonallyDown => Shape::NwseResize.name().to_owned(),
174+
_ => Shape::Default.name().to_owned()
173175
}
174176
}
175177

iced_sessionlock/src/multi_window.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,14 @@ where
262262

263263
async fn create_compositor(mut self, window: Arc<WindowWrapper>) -> Self {
264264
let shell = Shell::new(self.proxy.clone());
265-
let mut new_compositor = C::new(self.compositor_settings, window.clone(), shell)
266-
.await
267-
.expect("Cannot create compositer");
265+
let mut new_compositor = C::new(
266+
self.compositor_settings,
267+
window.clone(),
268+
window.clone(),
269+
shell,
270+
)
271+
.await
272+
.expect("Cannot create compositer");
268273
for font in self.fonts.clone() {
269274
new_compositor.load_font(font);
270275
}

0 commit comments

Comments
 (0)