Compare commits
3 commits
bd86229852
...
9089df1e67
Author | SHA1 | Date | |
---|---|---|---|
9089df1e67 | |||
97cb14d4df | |||
149f58169f |
2 changed files with 14 additions and 7 deletions
|
@ -306,7 +306,7 @@ impl Button {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn select(self: &Arc<Self>) -> Result<()> {
|
pub fn select(&self) -> Result<()> {
|
||||||
self.selectable.select()
|
self.selectable.select()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue