Skip to content

Commit 8beef06

Browse files
committed
snowcap: use iced_touch instead of iced::widget for button & mouse_area
1 parent 49ae072 commit 8beef06

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

Cargo.lock

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

snowcap/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ iced_renderer = "0.14.0"
1919
iced_runtime = "0.14.0"
2020
iced_tiny_skia = "0.14.0"
2121
iced_wgpu = "0.14.0"
22+
23+
iced_touch = { git = "https://git.sr.ht/~phantomas/iced_touch", rev = "2eebdf33" }
24+
2225
smithay-client-toolkit = "0.20.0"
2326
# iced = { path = "../../../git/iced", default-features = false, features = ["wgpu", "tokio", "tiny-skia", "image"] }
2427
# iced_wgpu = { path = "../../../git/iced/wgpu" }

snowcap/src/api/widget/v1.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use anyhow::Context;
22
use iced::widget::{
3-
Column, Container, Row, Scrollable, button, image::FilterMethod, scrollable::Scrollbar,
3+
Column, Container, Row, Scrollable, image::FilterMethod, scrollable::Scrollbar,
44
};
5+
use iced_touch::widget::{button, mouse_area};
6+
57
use snowcap_api_defs::snowcap::widget::{
68
self,
79
v1::{
@@ -534,7 +536,7 @@ pub fn widget_def_to_fn(def: WidgetDef) -> Option<ViewFn> {
534536
let child_widget_fn = child.and_then(|def| widget_def_to_fn(*def));
535537

536538
let f: ViewFn = Box::new(move || {
537-
let mut button = iced::widget::Button::new(
539+
let mut button = button::Button::new(
538540
child_widget_fn
539541
.as_ref()
540542
.map(|child| child())
@@ -738,7 +740,7 @@ pub fn widget_def_to_fn(def: WidgetDef) -> Option<ViewFn> {
738740
let child_widget_fn = child.and_then(|def| widget_def_to_fn(*def));
739741

740742
let f: ViewFn = Box::new(move || {
741-
let mut mouse_area = iced::widget::MouseArea::new(
743+
let mut mouse_area = mouse_area::MouseArea::new(
742744
child_widget_fn
743745
.as_ref()
744746
.map(|child| child())

0 commit comments

Comments
 (0)