From bbc622683961a04a2e3fd41d043ad54855c6c131 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 28 Jan 2024 19:38:29 +0100 Subject: Redefined the key margin options in percent Define the key margin options relative to the baseline dimensions of keys. This removes the doubling of the horizontal margin in landscape mode. --- srcs/juloo.keyboard2/Config.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'srcs/juloo.keyboard2/Config.java') diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index b24210e..d41e6fc 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -47,8 +47,8 @@ public final class Config public float margin_bottom; public float keyHeight; public float horizontal_margin; - public float keyVerticalInterval; - public float keyHorizontalInterval; + public float key_vertical_margin; + public float key_horizontal_margin; public int labelBrightness; // 0 - 255 public int keyboardOpacity; // 0 - 255 public int keyOpacity; // 0 - 255 @@ -105,8 +105,6 @@ public final class Config // The height of the keyboard is relative to the height of the screen. // This is the height of the keyboard if it have 4 rows. int keyboardHeightPercent; - // Scale some dimensions depending on orientation - float horizontalIntervalScale = 1.f; float characterSizeScale = 1.f; String show_numpad_s = _prefs.getString("show_numpad", "never"); show_numpad = "always".equals(show_numpad_s); @@ -115,7 +113,6 @@ public final class Config if ("landscape".equals(show_numpad_s)) show_numpad = true; keyboardHeightPercent = _prefs.getInt("keyboard_height_landscape", 50); - horizontalIntervalScale = 2.f; characterSizeScale = 1.25f; } else @@ -139,16 +136,16 @@ public final class Config longPressTimeout = _prefs.getInt("longpress_timeout", 600); longPressInterval = _prefs.getInt("longpress_interval", 65); margin_bottom = get_dip_pref_oriented(dm, "margin_bottom", 7, 3); - keyVerticalInterval = get_dip_pref(dm, "key_vertical_space", 2); - keyHorizontalInterval = get_dip_pref(dm, "key_horizontal_space", 2) * horizontalIntervalScale; + key_vertical_margin = get_dip_pref(dm, "key_vertical_margin", 1.5f) / 100; + key_horizontal_margin = get_dip_pref(dm, "key_horizontal_margin", 2) / 100; // Label brightness is used as the alpha channel labelBrightness = _prefs.getInt("label_brightness", 100) * 255 / 100; // Keyboard opacity keyboardOpacity = _prefs.getInt("keyboard_opacity", 100) * 255 / 100; keyOpacity = _prefs.getInt("key_opacity", 100) * 255 / 100; keyActivatedOpacity = _prefs.getInt("key_activated_opacity", 100) * 255 / 100; - // Do not substract keyVerticalInterval from keyHeight because this is done - // during rendered. + // Do not substract key_vertical_margin from keyHeight because this is done + // during rendering. keyHeight = dm.heightPixels * keyboardHeightPercent / 100 / 4; horizontal_margin = get_dip_pref_oriented(dm, "horizontal_margin", 3, 28); -- cgit v1.2.3