Fix keyboard
This commit is contained in:
parent
149f58169f
commit
97cb14d4df
1 changed files with 13 additions and 6 deletions
|
@ -8,6 +8,7 @@ use std::{
|
|||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
enum KeyboardMode {
|
||||
LowerCase,
|
||||
UpperCase,
|
||||
|
@ -379,13 +380,19 @@ impl Visibility for Keyboard {
|
|||
fn set_visibility(&self, visibility: bool) -> Result<()> {
|
||||
let mode = self.mode.read().unwrap();
|
||||
|
||||
match mode.deref() {
|
||||
KeyboardMode::LowerCase => self.lower_case.set_visibility(visibility)?,
|
||||
KeyboardMode::UpperCase => self.upper_case.set_visibility(visibility)?,
|
||||
KeyboardMode::Specials => self.specials.set_visibility(visibility)?,
|
||||
}
|
||||
let gui = match mode.deref() {
|
||||
KeyboardMode::LowerCase => &self.lower_case,
|
||||
KeyboardMode::UpperCase => &self.upper_case,
|
||||
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(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue