add support for vertical padding in styles
This commit is contained in:
@@ -10,7 +10,7 @@ struct PHThemeStyle: Decodable {
|
||||
name: "_default",
|
||||
foreground: .init(color: "#000000", alpha: nil),
|
||||
background: .init(color: "#ffffff", alpha: nil),
|
||||
padding: .init(leading: 12, trailing: 12),
|
||||
padding: .init(top: 0, bottom: 0, leading: 12, trailing: 12),
|
||||
corner: nil
|
||||
)
|
||||
}()
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
struct PHThemeStylePadding: Decodable {
|
||||
let top: Double?
|
||||
let bottom: Double?
|
||||
let leading: Double?
|
||||
let trailing: Double?
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case top
|
||||
case bottom
|
||||
case leading = "left"
|
||||
case trailing = "right"
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ struct TextView: View {
|
||||
}
|
||||
.padding(.trailing, block.style.padding?.trailing ?? 0)
|
||||
.padding(.leading, block.style.padding?.leading ?? 0)
|
||||
.padding(.top, block.style.padding?.top ?? 0)
|
||||
.padding(.bottom, block.style.padding?.bottom ?? 0)
|
||||
}
|
||||
.fixedSize(horizontal: true, vertical: false)
|
||||
.border(block.debug ? .red : .clear)
|
||||
|
||||
Reference in New Issue
Block a user