Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error fix sub_window.rs example code #2415

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion druid/examples/sub_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@

//! 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"]

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,
};
Expand All @@ -19,7 +27,9 @@ use druid::{
use druid_shell::piet::Text;
use druid_shell::{Screen, WindowLevel};
use instant::{Duration, Instant};
use piet_common::{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;
Expand Down
Loading