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