From 43c71e874d80d5f531db3227d9a5eb0ca2199bea Mon Sep 17 00:00:00 2001 From: unspeaker Date: Thu, 7 Aug 2025 22:34:08 +0300 Subject: [PATCH] fix bindings load --- crates/app/app.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/crates/app/app.rs b/crates/app/app.rs index 5da14306..176514ec 100644 --- a/crates/app/app.rs +++ b/crates/app/app.rs @@ -158,6 +158,9 @@ impl App { pub fn view <'a> (&'a self) -> impl Content + 'a { Fill::xy(Bsp::a(self.view_overlay(), self.view_content())) } + pub fn update_clock (&self) { + ViewCache::update_clock(&self.project.clock.view_cache, self.clock(), self.size.w() > 80) + } } macro_rules!dsl_view(($Struct:ident { $($fn:ident = |$self:ident $(, $arg:ident:$ty:ty)*|$body:expr);* $(;)? })=>{ content!(TuiOut: |self: $Struct| { @@ -351,7 +354,7 @@ impl Config { } fn init_file (&mut self, path: &str, val: &str) -> Usually<()> { if self.dirs.find_config_file(path).is_none() { - std::fs::write(self.dirs.place_config_file("profiles.edn")?, Self::DEFAULT_PROFILES); + std::fs::write(self.dirs.place_config_file(path)?, val); } Ok(()) } @@ -610,16 +613,10 @@ audio!( ); impl App { - - pub fn update_clock (&self) { - ViewCache::update_clock(&self.project.clock.view_cache, self.clock(), self.size.w() > 80) - } - pub fn toggle_dialog (&mut self, mut dialog: Option) -> Option { std::mem::swap(&mut self.dialog, &mut dialog); dialog } - pub fn toggle_editor (&mut self, value: Option) { //FIXME: self.editing.store(value.unwrap_or_else(||!self.is_editing()), Relaxed); let value = value.unwrap_or_else(||!self.editor().is_some()); @@ -658,18 +655,15 @@ impl App { } } } - pub fn browser (&self) -> Option<&Browser> { self.dialog.as_ref().and_then(|dialog|match dialog { Dialog::Browser(_, b) => Some(b), _ => None }) } - pub fn device_pick (&mut self, index: usize) { self.dialog = Some(Dialog::Device(index)); } - pub fn device_add (&mut self, index: usize) -> Usually<()> { match index { 0 => { @@ -698,7 +692,6 @@ impl App { _ => unreachable!(), } } - } ///////////////////////////////////////////////////////////////////////////////////////////////////