Compare commits
1 commit
9089df1e67
...
bd86229852
Author | SHA1 | Date | |
---|---|---|---|
bd86229852 |
2 changed files with 7 additions and 14 deletions
|
@ -306,7 +306,7 @@ impl Button {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn select(&self) -> Result<()> {
|
||||
pub fn select(self: &Arc<Self>) -> Result<()> {
|
||||
self.selectable.select()
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ use std::{
|
|||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
enum KeyboardMode {
|
||||
LowerCase,
|
||||
UpperCase,
|
||||
|
@ -380,20 +379,14 @@ impl Visibility for Keyboard {
|
|||
fn set_visibility(&self, visibility: bool) -> Result<()> {
|
||||
let mode = self.mode.read().unwrap();
|
||||
|
||||
let gui = match mode.deref() {
|
||||
KeyboardMode::LowerCase => &self.lower_case,
|
||||
KeyboardMode::UpperCase => &self.upper_case,
|
||||
KeyboardMode::Specials => &self.specials,
|
||||
};
|
||||
|
||||
if visibility {
|
||||
gui.enable()?;
|
||||
self.text_field_gui.enable()?;
|
||||
} else {
|
||||
gui.disable()?;
|
||||
self.text_field_gui.disable()?;
|
||||
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)?,
|
||||
}
|
||||
|
||||
self.text_field_gui.set_visibility(visibility)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue