Compare commits

..

3 commits

Author SHA1 Message Date
9089df1e67 Update Rust crate anyhow to 1.0.85
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 18m22s
2024-05-18 06:08:34 +00:00
97cb14d4df Fix keyboard 2024-05-18 07:54:06 +02:00
149f58169f Remove unnecessary Arc<Self> 2024-05-18 07:23:59 +02:00
2 changed files with 14 additions and 7 deletions

View file

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

View file

@ -8,6 +8,7 @@ use std::{
sync::{Arc, RwLock}, sync::{Arc, RwLock},
}; };
#[derive(Debug)]
enum KeyboardMode { enum KeyboardMode {
LowerCase, LowerCase,
UpperCase, UpperCase,
@ -379,13 +380,19 @@ 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();
match mode.deref() { let gui = match mode.deref() {
KeyboardMode::LowerCase => self.lower_case.set_visibility(visibility)?, KeyboardMode::LowerCase => &self.lower_case,
KeyboardMode::UpperCase => self.upper_case.set_visibility(visibility)?, KeyboardMode::UpperCase => &self.upper_case,
KeyboardMode::Specials => self.specials.set_visibility(visibility)?, KeyboardMode::Specials => &self.specials,
} };
self.text_field_gui.set_visibility(visibility)?; if visibility {
gui.enable()?;
self.text_field_gui.enable()?;
} else {
gui.disable()?;
self.text_field_gui.disable()?;
}
Ok(()) Ok(())
} }