Update Vizia
This commit is contained in:
parent
71c7e00f2b
commit
33d956a96b
|
@ -1,5 +1,12 @@
|
|||
/* Overrides for default VIZIA widgets */
|
||||
|
||||
:root {
|
||||
background-color: #fafafa;
|
||||
color: #0a0a0a;
|
||||
/* VIZIA uses points instead of pixels, this is 20px */
|
||||
font-size: 15;
|
||||
}
|
||||
|
||||
scrollview > vstack {
|
||||
/* Normally the scroll bar overlaps with the content, so we'll add a little offset to prevent that */
|
||||
child-right: 15px;
|
||||
|
|
|
@ -190,16 +190,6 @@ impl Editor for ViziaEditor {
|
|||
// lower seems to compensate for this.
|
||||
assets::register_fonts(cx);
|
||||
cx.set_default_font(assets::NOTO_SANS_LIGHT);
|
||||
|
||||
// TOOD: `:root { background-color: #fafafa; }` in a stylesheet doesn't work
|
||||
cx.style
|
||||
.background_color
|
||||
.insert(Entity::root(), Color::rgb(250, 250, 250));
|
||||
cx.style
|
||||
.font_color
|
||||
.insert(Entity::root(), Color::rgb(10, 10, 10));
|
||||
// VIZIA uses points instead of pixels, this is 20px
|
||||
cx.style.font_size.insert(Entity::root(), 15.0);
|
||||
cx.add_theme(include_str!("../assets/theme.css"));
|
||||
|
||||
// There doesn't seem to be any way to bundle styles with a widget, so we'll always
|
||||
|
|
|
@ -96,8 +96,11 @@ impl PeakMeter {
|
|||
Element::new(cx).class("ticks__tick");
|
||||
}
|
||||
|
||||
let font_size = cx.style.font_size.get(cx.current()).unwrap_or(&15.0)
|
||||
* cx.style.dpi_factor as f32;
|
||||
let font_size = {
|
||||
let current = cx.current();
|
||||
let draw_cx = DrawContext::new(cx);
|
||||
draw_cx.font_size(current) * draw_cx.style.dpi_factor as f32
|
||||
};
|
||||
let label = if first_tick {
|
||||
Label::new(cx, "-inf")
|
||||
.class("ticks__label")
|
||||
|
|
Loading…
Reference in a new issue