Skip to content

Commit

Permalink
Better spacing defaults for Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Reed Es committed Mar 8, 2022
1 parent 7c87474 commit e96f79e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ Stack configuration is optional.

`TablerStackConfig<Element>.init` parameters:

- `rowPadding: EdgeInsets` - Stack-specific default, varies by platform
- `headerSpacing: CGFloat` - Stack-specific default, varies by platform
- `rowSpacing: CGFloat` - Stack-specific default, varies by platform
- `rowPadding: EdgeInsets` - Stack-specific default; varies by platform
- `headerSpacing: CGFloat` - Stack-specific default; varies by platform
- `rowSpacing: CGFloat` - Stack-specific default of 0
- `filter: Filter?` - with a default of `nil`, indicating no filtering
- `onHover: (Element.ID, Bool) -> Void` - defaults to `{ _,_ in }`
- `tablePadding: EdgeInsets` - per Stack defaults
Expand All @@ -434,12 +434,12 @@ Grid configuration is required, where you supply a `GridItem` array.

- `gridItems: [GridItem]` - required
- `alignment: HorizontalAlignment` - `LazyVGrid` alignment, with a default of `.leading`
- `itemPadding: EdgeInsets` - with a default of `.init()`, indicating no padding
- `headerSpacing: CGFloat` - Grid-specific default, varies by platform
- `rowSpacing: CGFloat` - Grid-specific default, varies by platform
- `itemPadding: EdgeInsets` - Grid-specific defaults, varies by platform
- `headerSpacing: CGFloat` - Grid-specific default; varies by platform
- `rowSpacing: CGFloat` - Grid-specific default of 0
- `filter: Filter?` - with a default of `nil`, indicating no filtering
- `onHover: (Element.ID, Bool) -> Void` - defaults to `{ _,_ in }`
- `tablePadding: EdgeInsets` - Grid-specific default, varies by platform
- `tablePadding: EdgeInsets` - Grid-specific default; varies by platform
- `sortIndicatorForward: AnyView` - per Base defaults
- `sortIndicatorReverse: AnyView` - per Base defaults
- `sortIndicatorNeutral: AnyView` - per Base defaults
Expand Down
10 changes: 5 additions & 5 deletions Sources/Grid/TablerGridConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ import SwiftUI

public enum TablerGridConfigDefaults {
#if os(macOS)
public static let headerSpacing: CGFloat = 8
public static let rowSpacing: CGFloat = 8
public static let headerSpacing: CGFloat = 4
public static let itemPadding = EdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0)
public static let tablePadding = EdgeInsets(top: 14, leading: 16, bottom: 15, trailing: 16)
#elseif os(iOS)
public static let headerSpacing: CGFloat = 23.5
public static let rowSpacing: CGFloat = 23.5
public static let headerSpacing: CGFloat = 12
public static let itemPadding = EdgeInsets(top: 11.5, leading: 0, bottom: 12, trailing: 0)
public static let tablePadding = EdgeInsets(top: 46, leading: 32, bottom: 20, trailing: 32)
#endif

public static let itemPadding: EdgeInsets = .init()
public static let rowSpacing: CGFloat = 0
public static let alignment: HorizontalAlignment = .leading
}

Expand Down

0 comments on commit e96f79e

Please sign in to comment.