1
0
Fork 0

Update Vizia fork

This commit is contained in:
Robbert van der Helm 2022-04-26 14:45:06 +02:00
parent dedbfebb71
commit 482c834450
2 changed files with 8 additions and 9 deletions

8
Cargo.lock generated
View file

@ -3498,7 +3498,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "vizia"
version = "0.1.0"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879"
dependencies = [
"vizia_baseview",
"vizia_core",
@ -3507,7 +3507,7 @@ dependencies = [
[[package]]
name = "vizia_baseview"
version = "0.1.0"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879"
dependencies = [
"baseview 0.1.0 (git+https://github.com/robbert-vdh/baseview.git?branch=feature/resize)",
"femtovg",
@ -3519,7 +3519,7 @@ dependencies = [
[[package]]
name = "vizia_core"
version = "0.1.0"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879"
dependencies = [
"bitflags",
"copypasta",
@ -3544,7 +3544,7 @@ dependencies = [
[[package]]
name = "vizia_derive"
version = "0.1.0"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#163ae29c603c51371a8a98cca3f4434f7bf38d37"
source = "git+https://github.com/robbert-vdh/vizia.git?branch=patched#44d6895c8a551771f7ed88add32bca435d68d879"
dependencies = [
"proc-macro2",
"quote",

View file

@ -5,7 +5,7 @@ use crossbeam::atomic::AtomicCell;
use nih_plug::prelude::{Editor, GuiContext, ParentWindowHandle};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use vizia::{Application, Color, Context, Entity, Model, PropSet, WindowDescription};
use vizia::{Application, Color, Context, Entity, Model, PropSet};
// Re-export for convenience
pub use vizia;
@ -153,11 +153,8 @@ impl Editor for ViziaEditor {
let (unscaled_width, unscaled_height) = vizia_state.inner_logical_size();
let system_scaling_factor = self.scaling_factor.load();
let user_scale_factor = vizia_state.user_scale_factor();
let window_description = WindowDescription::new()
.with_inner_size(unscaled_width, unscaled_height)
.with_scale_factor(user_scale_factor);
let window = Application::new(window_description, move |cx| {
let window = Application::new(move |cx| {
// Set some default styles to match the iced integration
if apply_theming {
// NOTE: vizia's font rendering looks way too dark and thick. Going one font weight
@ -199,6 +196,8 @@ impl Editor for ViziaEditor {
.map(|factor| WindowScalePolicy::ScaleFactor(factor as f64))
.unwrap_or(WindowScalePolicy::SystemScaleFactor),
)
.inner_size((unscaled_width, unscaled_height))
.user_scale_factor(user_scale_factor)
.open_parented(&parent);
self.vizia_state.open.store(true, Ordering::Release);