fschutt/azul

azul-desktop = "0.0.5" window10 error

sousmoi opened this issue · 4 comments

[dependencies]
azul-desktop = "0.0.5"

error,

--> C:\Users\wget.cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\azul-desktop-0.0.5\src\wr_translate.rs:672:19
|
672 | contrast: fio.contrast,
| ^^^^^^^^^^^^ expected u8, found u16

error[E0063]: missing field cleartype_level in initializer of webrender::azul_webrender_api::FontInstancePlatformOptions
--> C:\Users\wget.cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\azul-desktop-0.0.5\src\wr_translate.rs:670:5
|
670 | WrFontInstancePlatformOptions {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing cleartype_level

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0063, E0308.
For more information about an error, try rustc --explain E0063.
error: could not compile azul-desktop.

Thanks for reporting. It's probably an issue with 32 / 64 bit systems. Should be relatively easy to fix.

Why close this issue? Is it fixed? If not, just leave it open.

sorry for that , i have try fix it with default value
..fio.contrast:100,cleartype_level:100
, but it not work for me,please help me

there is the error

error[E0405]: cannot find trait Layout in this scope
--> src\main.rs:10:6
|
10 | impl Layout for DataModel {
| ^^^^^^ not found in this scope

error: aborting due to previous error

For more information about this error, try rustc --explain E0405.
error: could not compile azul_app.

///
Here's my sample

Cargo.toml

[dependencies]
azul-desktop = "0.0.5"

main.rs

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
extern crate azul_desktop;

use azul_desktop::{prelude::*, widgets::{label::Label, button::Button}};

struct DataModel {
  counter: usize,
}

impl Layout for DataModel {
    fn layout(&self, _info: LayoutInfo) -> Dom<Self> {
        let label = Label::new(format!("{}", self.counter)).dom();
        let button = Button::with_label("Update counter").dom()
            .with_callback(On::MouseUp, |cb_info: CallbackInfo<Self>| {
                cb_info.state.counter += 1;
                Redraw
            });

        let dom = Dom::div()
            .with_child(label)
            .with_child(button);

        println!("dom:\r\n{}", dom.debug_dump());
        dom
    }
}

fn main() {
    let app = App::new(DataModel { counter: 0 }, AppConfig::default()).unwrap();
    app.run(WindowCreateOptions::new(css::native()));
}

This issue was fixed in #255. The fix is in the /wip branch, but crates.io hasn't been updated yet.