Skip to content

Commit 4c16abb

Browse files
authored
fix: 🐛 [JIRA:IOSSDKBUG-451] Switch border alignment (SAP#894)
1 parent 472b6d8 commit 4c16abb

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

Sources/FioriSwiftUICore/_FioriStyles/SwitchViewStyle.fiori.swift

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
1-
import FioriThemeManager
2-
31
// Generated using Sourcery 2.1.7 — https://github.com/krzysztofzablocki/Sourcery
42
// DO NOT EDIT
3+
import FioriThemeManager
54
import Foundation
65
import SwiftUI
76

8-
/**
9-
This file provides default fiori style for the component.
10-
11-
1. Uncomment fhe following code.
12-
2. Implement layout and style in corresponding places.
13-
3. Delete `.generated` from file name.
14-
4. Move this file to `_FioriStyles` folder under `FioriSwiftUICore`.
15-
*/
16-
177
// Base Layout style
188
public struct SwitchViewBaseStyle: SwitchViewStyle {
199
public func makeBody(_ configuration: SwitchViewConfiguration) -> some View {
20-
// Add default layout here
2110
HStack {
2211
configuration.title
2312
Spacer()
@@ -31,7 +20,6 @@ extension SwitchViewFioriStyle {
3120
struct ContentFioriStyle: SwitchViewStyle {
3221
func makeBody(_ configuration: SwitchViewConfiguration) -> some View {
3322
SwitchView(configuration)
34-
// Add default style for its content
3523
.padding(EdgeInsets(top: 9, leading: 20, bottom: 9, trailing: 20))
3624
}
3725
}
@@ -42,7 +30,6 @@ extension SwitchViewFioriStyle {
4230

4331
func makeBody(_ configuration: TitleConfiguration) -> some View {
4432
Title(configuration)
45-
// Add default style for Title
4633
.foregroundStyle(Color.preferredColor(self.isEnabled ? .primaryLabel : .quaternaryLabel))
4734
.font(.fiori(forTextStyle: .subheadline, weight: .semibold))
4835
}
@@ -54,9 +41,9 @@ extension SwitchViewFioriStyle {
5441

5542
func makeBody(_ configuration: SwitchConfiguration) -> some View {
5643
Switch(configuration)
57-
// Add default style for Switch
5844
.tint(Color.preferredColor(.tintColor))
59-
.frame(width: 50, height: 30, alignment: .trailing)
45+
.frame(width: 51, height: 31, alignment: .trailing)
46+
.offset(x: -2)
6047
.overlay(
6148
RoundedRectangle(cornerRadius: 16)
6249
.stroke(Color.preferredColor(configuration.isOn ? .separatorOpaque : .separator), lineWidth: 0.5)

0 commit comments

Comments
 (0)