keyboard.yaml auto_labels

This commit is contained in:
galister
2024-12-23 17:16:24 +09:00
parent 4de6116985
commit 1903271d05

View File

@@ -57,7 +57,7 @@ fn set_modifiers(app: &mut AppState, mods: u8) {
pub fn create_keyboard<O>(
app: &AppState,
keymap: Option<XkbKeymap>,
mut keymap: Option<XkbKeymap>,
) -> anyhow::Result<OverlayData<O>>
where
O: Default,
@@ -97,6 +97,10 @@ where
let has_altgr = keymap.as_ref().map_or(false, |k| k.has_altgr());
if !LAYOUT.auto_labels.unwrap_or(true) {
keymap = None;
}
let unit_size = size.x / LAYOUT.row_size;
let h = unit_size - 2. * BUTTON_PADDING;
@@ -388,6 +392,7 @@ pub struct Layout {
exec_commands: HashMap<String, Vec<String>>,
macros: HashMap<String, Vec<String>>,
labels: HashMap<String, Vec<String>>,
auto_labels: Option<bool>,
}
impl Layout {