Skip to content

Commit

Permalink
keyboard.yaml auto_labels
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Dec 23, 2024
1 parent 4de6116 commit 1903271
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/overlays/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1903271

Please sign in to comment.