1
0
Fork 0

Update vizia

Now setting a font size on the `*` selector works.
This commit is contained in:
Robbert van der Helm 2022-03-18 12:28:26 +01:00
parent 87d9136b6f
commit ed3a17bf33
2 changed files with 11 additions and 13 deletions

12
Cargo.lock generated
View file

@ -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",

View file

@ -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<Box<dyn Editor>> {
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