Skip to content

Commit d123465

Browse files
committed
Update edge insets
1 parent b6528c6 commit d123465

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// EdgeInsets+init.swift
3+
// Ice
4+
//
5+
6+
import SwiftUI
7+
8+
extension EdgeInsets {
9+
init(all: CGFloat) {
10+
self.init(top: all, leading: all, bottom: all, trailing: all)
11+
}
12+
}

Ice/MenuBar/Appearance/MenuBarAppearanceEditor/MenuBarAppearanceEditor.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ struct MenuBarAppearanceEditor: View {
1717
let location: Location
1818

1919
private var mainFormPadding: EdgeInsets {
20-
switch location {
21-
case .settings:
22-
EdgeInsets(top: 20, leading: 20, bottom: 20, trailing: 20)
23-
case .popover:
24-
EdgeInsets(top: 0, leading: 20, bottom: 20, trailing: 20)
20+
with(EdgeInsets(all: 20)) { insets in
21+
switch location {
22+
case .settings: break
23+
case .popover: insets.top = 0
24+
}
2525
}
2626
}
2727

0 commit comments

Comments
 (0)