Compare commits
3 commits
bd86229852
...
9089df1e67
Author | SHA1 | Date | |
---|---|---|---|
9089df1e67 | |||
97cb14d4df | |||
149f58169f |
3 changed files with 15 additions and 8 deletions
|
@ -12,7 +12,7 @@ vulkan-rs = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
|
|||
utilities = { git = "https://gavania.de/hodasemi/utilities.git" }
|
||||
paste = "1.0.15"
|
||||
assetpath = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
|
||||
anyhow = { version = "1.0.83", features = ["backtrace"] }
|
||||
anyhow = { version = "1.0.85", features = ["backtrace"] }
|
||||
|
||||
# optional
|
||||
audio = { git = "https://gavania.de/hodasemi/audio.git", optional = true }
|
||||
|
|
|
@ -306,7 +306,7 @@ impl Button {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn select(self: &Arc<Self>) -> Result<()> {
|
||||
pub fn select(&self) -> Result<()> {
|
||||
self.selectable.select()
|
||||
}
|
||||
|
||||
|
|
|
@ -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