Compare commits

...

3 commits

Author SHA1 Message Date
9089df1e67 Update Rust crate anyhow to 1.0.85
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 18m22s
2024-05-18 06:08:34 +00:00
97cb14d4df Fix keyboard 2024-05-18 07:54:06 +02:00
149f58169f Remove unnecessary Arc<Self> 2024-05-18 07:23:59 +02:00
3 changed files with 15 additions and 8 deletions

View file

@ -12,7 +12,7 @@ vulkan-rs = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
utilities = { git = "https://gavania.de/hodasemi/utilities.git" } utilities = { git = "https://gavania.de/hodasemi/utilities.git" }
paste = "1.0.15" paste = "1.0.15"
assetpath = { git = "https://gavania.de/hodasemi/vulkan_lib.git" } assetpath = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
anyhow = { version = "1.0.83", features = ["backtrace"] } anyhow = { version = "1.0.85", features = ["backtrace"] }
# optional # optional
audio = { git = "https://gavania.de/hodasemi/audio.git", optional = true } audio = { git = "https://gavania.de/hodasemi/audio.git", optional = true }

View file

@ -306,7 +306,7 @@ impl Button {
} }
} }
pub fn select(self: &Arc<Self>) -> Result<()> { pub fn select(&self) -> Result<()> {
self.selectable.select() self.selectable.select()
} }

View file

@ -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(())
} }