From 59217d3561b26fe21bfb8c3a958f85b54f02e4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mik=C3=A1=20Kruschel?= <20423069+mikakruschel@users.noreply.github.com> Date: Tue, 23 Mar 2021 15:59:58 +0100 Subject: [PATCH 1/2] Improved tappable area of buttons --- Sources/KeyboardToolbar/KeyboardToolbar.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/KeyboardToolbar/KeyboardToolbar.swift b/Sources/KeyboardToolbar/KeyboardToolbar.swift index 8e690c9..3a0417b 100644 --- a/Sources/KeyboardToolbar/KeyboardToolbar.swift +++ b/Sources/KeyboardToolbar/KeyboardToolbar.swift @@ -38,13 +38,15 @@ internal struct KeyboardToolbar: View { (item.image ?? Image(systemName: "placeholdertext.fill")) .resizable() .aspectRatio(contentMode: .fit) - .frame(width: style.itemSize, height: style.itemSize) .foregroundColor(item.color) + .frame(width: style.itemSize, height: style.height) + .frame(minWidth: max(style.itemSize, style.height)) } else { Text(item.text ?? "") .font(.system(size: style.itemSize)) - .frame(minWidth: style.itemSize) .foregroundColor(item.color) + .frame(height: style.height) + .frame(minWidth: max(style.itemSize, style.height)) } }) .frame(height: style.height) From afaf0c623c1a8c8bb4410cc289efa02becaab6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mik=C3=A1=20Kruschel?= <20423069+mikakruschel@users.noreply.github.com> Date: Tue, 23 Mar 2021 16:20:26 +0100 Subject: [PATCH 2/2] Adjusted image and text sizes --- Sources/KeyboardToolbar/KeyboardToolbar.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/KeyboardToolbar/KeyboardToolbar.swift b/Sources/KeyboardToolbar/KeyboardToolbar.swift index 3a0417b..a258525 100644 --- a/Sources/KeyboardToolbar/KeyboardToolbar.swift +++ b/Sources/KeyboardToolbar/KeyboardToolbar.swift @@ -39,17 +39,18 @@ internal struct KeyboardToolbar: View { .resizable() .aspectRatio(contentMode: .fit) .foregroundColor(item.color) - .frame(width: style.itemSize, height: style.height) + .frame(height: style.itemSize) .frame(minWidth: max(style.itemSize, style.height)) + .frame(height: style.height) } else { Text(item.text ?? "") .font(.system(size: style.itemSize)) .foregroundColor(item.color) - .frame(height: style.height) + .frame(height: style.itemSize) .frame(minWidth: max(style.itemSize, style.height)) + .frame(height: style.height) } }) - .frame(height: style.height) .contentShape(Rectangle()) } }