From 29367f127d8927b063c1f869646d489df83079be Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 30 Dec 2021 00:52:50 +0100 Subject: Move the border radius from Config to Theme Also, draw activated keys with a round border too. --- srcs/juloo.keyboard2/Keyboard2View.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'srcs/juloo.keyboard2/Keyboard2View.java') diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index 2edb745..10ec678 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -352,10 +352,8 @@ public class Keyboard2View extends View float keyW = _keyWidth * k.width - _config.keyHorizontalInterval; KeyDown keyDown = getKeyDown(k); _tmpRect.set(x, y, x + keyW, y + keyH); - if (keyDown != null) - canvas.drawRect(_tmpRect, _theme.keyDownBgPaint); - else - canvas.drawRoundRect(_tmpRect, _config.keyRound, _config.keyRound, _theme.keyBgPaint); + canvas.drawRoundRect(_tmpRect, _theme.keyBorderRadius, _theme.keyBorderRadius, + (keyDown != null) ? _theme.keyDownBgPaint : _theme.keyBgPaint); if (k.key0 != null) drawLabel(canvas, k.key0, keyW / 2f + x, (keyH + _theme.labelTextSize) / 2f + y, keyDown); float subPadding = _config.keyPadding; -- cgit v1.2.3