Compare commits

..

1 commit

Author SHA1 Message Date
bd86229852 Update Rust crate anyhow to 1.0.85
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 18m26s
2024-05-18 00:08:53 +00:00
2 changed files with 7 additions and 14 deletions

View file

@ -306,7 +306,7 @@ impl Button {
} }
} }
pub fn select(&self) -> Result<()> { pub fn select(self: &Arc<Self>) -> Result<()> {
self.selectable.select() self.selectable.select()
} }

View file

@ -8,7 +8,6 @@ use std::{
sync::{Arc, RwLock}, sync::{Arc, RwLock},
}; };
#[derive(Debug)]
enum KeyboardMode { enum KeyboardMode {
LowerCase, LowerCase,
UpperCase, UpperCase,
@ -380,20 +379,14 @@ impl Visibility for Keyboard {
fn set_visibility(&self, visibility: bool) -> Result<()> { fn set_visibility(&self, visibility: bool) -> Result<()> {
let mode = self.mode.read().unwrap(); let mode = self.mode.read().unwrap();
let gui = match mode.deref() { match mode.deref() {
KeyboardMode::LowerCase => &self.lower_case, KeyboardMode::LowerCase => self.lower_case.set_visibility(visibility)?,
KeyboardMode::UpperCase => &self.upper_case, KeyboardMode::UpperCase => self.upper_case.set_visibility(visibility)?,
KeyboardMode::Specials => &self.specials, KeyboardMode::Specials => self.specials.set_visibility(visibility)?,
};
if visibility {
gui.enable()?;
self.text_field_gui.enable()?;
} else {
gui.disable()?;
self.text_field_gui.disable()?;
} }
self.text_field_gui.set_visibility(visibility)?;
Ok(()) Ok(())
} }
} }