From e9d1cd5d10bd68eb86aa9b145b7231eb096badf1 Mon Sep 17 00:00:00 2001 From: Captain Mirage Date: Wed, 27 Nov 2024 11:49:59 +0330 Subject: [PATCH 1/2] Error fix sub_window.rs error fix for lines 301 to 304 --- druid/examples/sub_window.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/druid/examples/sub_window.rs b/druid/examples/sub_window.rs index a643adac7..255793969 100644 --- a/druid/examples/sub_window.rs +++ b/druid/examples/sub_window.rs @@ -2,6 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 //! Example of sub windows. + +// dependencies +// druid = "0.8.3" +// druid-shell = "0.8.3" +// piet = "0.7.0" +// instant = "0.1.13" +// tracing = "0.1.40" // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] @@ -19,7 +26,10 @@ use druid::{ use druid_shell::piet::Text; use druid_shell::{Screen, WindowLevel}; use instant::{Duration, Instant}; -use piet_common::{TextLayout, TextLayoutBuilder}; +use druid::piet::{TextLayout, TextLayoutBuilder}; +// not sure why but using the piet package instead of +// piet-common fixes an error in lines 301 to 304 +// OLD - use piet_common::{TextLayout, TextLayoutBuilder}; const VERTICAL_WIDGET_SPACING: f64 = 20.0; const TEXT_BOX_WIDTH: f64 = 200.0; From 5a93f82e441769209164f476bb1c3782b13d09d9 Mon Sep 17 00:00:00 2001 From: Captain Mirage Date: Sun, 5 Jan 2025 21:30:36 +0330 Subject: [PATCH 2/2] cargo fmt update for the file --- druid/examples/sub_window.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/druid/examples/sub_window.rs b/druid/examples/sub_window.rs index 255793969..ff8e7e636 100644 --- a/druid/examples/sub_window.rs +++ b/druid/examples/sub_window.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 //! Example of sub windows. - + // dependencies // druid = "0.8.3" // druid-shell = "0.8.3" @@ -15,6 +15,7 @@ use druid::commands::CLOSE_WINDOW; use druid::lens::Unit; +use druid::piet::{TextLayout, TextLayoutBuilder}; use druid::widget::{ Align, Button, Checkbox, Controller, ControllerHost, EnvScope, Flex, Label, TextBox, }; @@ -26,7 +27,6 @@ use druid::{ use druid_shell::piet::Text; use druid_shell::{Screen, WindowLevel}; use instant::{Duration, Instant}; -use druid::piet::{TextLayout, TextLayoutBuilder}; // not sure why but using the piet package instead of // piet-common fixes an error in lines 301 to 304 // OLD - use piet_common::{TextLayout, TextLayoutBuilder};