From f1ecb061f015b76b09b55ee1e145bac325f650bf Mon Sep 17 00:00:00 2001 From: Valentin Perignon Date: Fri, 25 Oct 2024 13:53:12 +0200 Subject: [PATCH] fix: Add vertical padding to buttons --- .../Components/Buttons/Modifiers/IKButtonModifiers.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/InfomaniakCoreSwiftUI/Components/Buttons/Modifiers/IKButtonModifiers.swift b/Sources/InfomaniakCoreSwiftUI/Components/Buttons/Modifiers/IKButtonModifiers.swift index 4c8df39..4198275 100644 --- a/Sources/InfomaniakCoreSwiftUI/Components/Buttons/Modifiers/IKButtonModifiers.swift +++ b/Sources/InfomaniakCoreSwiftUI/Components/Buttons/Modifiers/IKButtonModifiers.swift @@ -78,9 +78,15 @@ struct IKButtonLayout: ViewModifier { return IKButtonHeight.convert(controlSize: controlSize) } + private var verticalPadding: CGFloat { + guard !isInlined else { return 0 } + return controlSize == .large ? IKPadding.medium : IKPadding.small + } + func body(content: Content) -> some View { content .padding(.horizontal, isInlined ? 0 : IKPadding.large) + .padding(.vertical, verticalPadding) .frame(minHeight: minHeight) } }