Feat: UI / UX fixes

This commit is contained in:
2026-02-26 21:17:53 +01:00
parent f618f47811
commit 6b56655661
20 changed files with 268 additions and 169 deletions

View File

@@ -175,7 +175,7 @@ impl App {
match model::share::export(pattern_data) {
Ok(encoded) => {
let len = encoded.len();
if let Some(clip) = &mut self.clipboard {
if let Ok(mut clip) = arboard::Clipboard::new() {
let _ = clip.set_text(encoded);
}
if len > 2000 {
@@ -201,7 +201,7 @@ impl App {
match model::share::export_bank(bank_data) {
Ok(encoded) => {
let len = encoded.len();
if let Some(clip) = &mut self.clipboard {
if let Ok(mut clip) = arboard::Clipboard::new() {
let _ = clip.set_text(encoded);
}
if len > 2000 {
@@ -223,7 +223,7 @@ impl App {
}
pub fn import_bank(&mut self, bank: usize) {
let text = match self.clipboard.as_mut().and_then(|c| c.get_text().ok()) {
let text = match arboard::Clipboard::new().ok().and_then(|mut c| c.get_text().ok()) {
Some(t) => t,
None => {
self.ui.flash("Clipboard empty", 150, FlashKind::Error);
@@ -250,7 +250,7 @@ impl App {
}
pub fn import_pattern(&mut self, bank: usize, pattern: usize) {
let text = match self.clipboard.as_mut().and_then(|c| c.get_text().ok()) {
let text = match arboard::Clipboard::new().ok().and_then(|mut c| c.get_text().ok()) {
Some(t) => t,
None => {
self.ui
@@ -305,7 +305,7 @@ impl App {
&indices,
);
let count = copied.steps.len();
if let Some(clip) = &mut self.clipboard {
if let Ok(mut clip) = arboard::Clipboard::new() {
let text: String = copied.steps.iter().map(|s| s.script.as_str()).collect::<Vec<_>>().join("\n");
let _ = clip.set_text(text);
}