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()
|
self.selectable.select()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue