abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyboardData.java
diff options
context:
space:
mode:
authorJules Aguillon2025-06-18 00:49:34 +0200
committerGitHub2025-06-18 00:49:34 +0200
commit71d278402644fd16a2f407518346746f16538de6 (patch)
tree8df119b68d7d0f15b38eebec6277f756dcf01457 /srcs/juloo.keyboard2/KeyboardData.java
parentf9b844e98864fc1223687c6836a26e773a80c99f (diff)
downloadunexpected-keyboard-71d278402644fd16a2f407518346746f16538de6.tar.gz
unexpected-keyboard-71d278402644fd16a2f407518346746f16538de6.zip
Add <row scale=""> attribute (#1018)
* Add <row scale=""> attribute Scale the width of the keys in the row to match a value. Useful to remove space on the right of the row without adding a 'width' attribute to each key. * layouts: Use the 'scale=""' attribute in builtin layouts This removes the very specific 'width' values.
Diffstat (limited to 'srcs/juloo.keyboard2/KeyboardData.java')
-rw-r--r--srcs/juloo.keyboard2/KeyboardData.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/KeyboardData.java b/srcs/juloo.keyboard2/KeyboardData.java
index f5cc87e..494b95a 100644
--- a/srcs/juloo.keyboard2/KeyboardData.java
+++ b/srcs/juloo.keyboard2/KeyboardData.java
@@ -336,9 +336,13 @@ public final class KeyboardData
int status;
float h = attribute_float(parser, "height", 1f);
float shift = attribute_float(parser, "shift", 0f);
+ float scale = attribute_float(parser, "scale", 0f);
while (expect_tag(parser, "key"))
keys.add(Key.parse(parser));
- return new Row(keys, h, shift);
+ Row row = new Row(keys, h, shift);
+ if (scale > 0f)
+ row = row.updateWidth(scale);
+ return row;
}
public Row copy()