From 71d278402644fd16a2f407518346746f16538de6 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Wed, 18 Jun 2025 00:49:34 +0200 Subject: Add attribute (#1018) * Add 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.--- srcs/juloo.keyboard2/KeyboardData.java | 6 ++++- srcs/layouts/cyrl_jcuken_ru.xml | 24 +++++++++---------- srcs/layouts/cyrl_yqukeng_tj.xml | 24 +++++++++---------- srcs/layouts/cyrl_yxukeng_os.xml | 24 +++++++++---------- srcs/layouts/deva_alt.xml | 32 ++++++++++++------------- srcs/layouts/hebr_1_il.xml | 22 ++++++++--------- srcs/layouts/latn_bepo_fr.xml | 44 +++++++++++++++++----------------- 7 files changed, 90 insertions(+), 86 deletions(-) (limited to 'srcs') 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() diff --git a/srcs/layouts/cyrl_jcuken_ru.xml b/srcs/layouts/cyrl_jcuken_ru.xml index 5b32dc5..ed863d6 100644 --- a/srcs/layouts/cyrl_jcuken_ru.xml +++ b/srcs/layouts/cyrl_jcuken_ru.xml @@ -26,17 +26,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/srcs/layouts/cyrl_yqukeng_tj.xml b/srcs/layouts/cyrl_yqukeng_tj.xml index 313c48f..e0a16b0 100644 --- a/srcs/layouts/cyrl_yqukeng_tj.xml +++ b/srcs/layouts/cyrl_yqukeng_tj.xml @@ -26,17 +26,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/srcs/layouts/cyrl_yxukeng_os.xml b/srcs/layouts/cyrl_yxukeng_os.xml index 5da54e5..749a02e 100644 --- a/srcs/layouts/cyrl_yxukeng_os.xml +++ b/srcs/layouts/cyrl_yxukeng_os.xml @@ -26,17 +26,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/srcs/layouts/deva_alt.xml b/srcs/layouts/deva_alt.xml index d956777..7fa6791 100644 --- a/srcs/layouts/deva_alt.xml +++ b/srcs/layouts/deva_alt.xml @@ -1,22 +1,22 @@ - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/srcs/layouts/hebr_1_il.xml b/srcs/layouts/hebr_1_il.xml index dca827f..aafe842 100644 --- a/srcs/layouts/hebr_1_il.xml +++ b/srcs/layouts/hebr_1_il.xml @@ -14,17 +14,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/srcs/layouts/latn_bepo_fr.xml b/srcs/layouts/latn_bepo_fr.xml index e0e85f3..49566d0 100644 --- a/srcs/layouts/latn_bepo_fr.xml +++ b/srcs/layouts/latn_bepo_fr.xml @@ -1,29 +1,29 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + -- cgit v1.2.3