diff --git a/Cargo.lock b/Cargo.lock index 8704bbff..2df37f9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -742,9 +742,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote", "syn", @@ -3605,7 +3605,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vizia" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#23e42ad14b98c4bb8420e5138cd7794e3d842b8b" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#d8c36fcc91516492d5d43e43b77f2a64738d4d28" dependencies = [ "vizia_baseview", "vizia_core", @@ -3614,7 +3614,7 @@ dependencies = [ [[package]] name = "vizia_baseview" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#23e42ad14b98c4bb8420e5138cd7794e3d842b8b" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#d8c36fcc91516492d5d43e43b77f2a64738d4d28" dependencies = [ "baseview", "femtovg", @@ -3626,7 +3626,7 @@ dependencies = [ [[package]] name = "vizia_core" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#23e42ad14b98c4bb8420e5138cd7794e3d842b8b" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#d8c36fcc91516492d5d43e43b77f2a64738d4d28" dependencies = [ "bitflags", "copypasta", @@ -3649,7 +3649,7 @@ dependencies = [ [[package]] name = "vizia_derive" version = "0.1.0" -source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#23e42ad14b98c4bb8420e5138cd7794e3d842b8b" +source = "git+https://github.com/robbert-vdh/vizia.git?branch=feature/baseview-modifiers#d8c36fcc91516492d5d43e43b77f2a64738d4d28" dependencies = [ "proc-macro2", "quote", diff --git a/plugins/examples/gain-gui-vizia/src/editor.rs b/plugins/examples/gain-gui-vizia/src/editor.rs index feb924e9..6592c995 100644 --- a/plugins/examples/gain-gui-vizia/src/editor.rs +++ b/plugins/examples/gain-gui-vizia/src/editor.rs @@ -11,6 +11,10 @@ use crate::GainParams; const POINT_SCALE: f32 = 0.75; const STYLE: &str = r#" +* { + /* VIZIA uses points instead of pixels */ + font-size: 15; /* 20px */ +} "#; // Makes sense to also define this here, makes it a bit easier to keep track of @@ -25,13 +29,7 @@ pub(crate) fn create( ) -> Option> { create_vizia_editor(editor_state, |cx, setter| { // TOOD: `:root { background-color: #fafafa; }` in a stylesheet doesn't work - cx.style - .background_color - .insert(Entity::root(), Color::rgb(250, 250, 250)); - // VIZIA uses points instead of pixels - cx.style - .font_size - .insert(Entity::root(), 20.0 * POINT_SCALE); + Entity::root().set_background_color(cx, Color::rgb(250, 250, 250)); cx.add_theme(STYLE); // NOTE: vizia's font rendering looks way too dark and thick. Going one font weight lower