Skip to content

Commit

Permalink
Fix horizontal padding issue for sidebar for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
eonist committed Oct 26, 2024
1 parent 39378c4 commit 0734a4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct ListButtonStyle: ButtonStyle {
HStack(spacing: 0) {
configuration.label // text instance
.foregroundStyle(textColor)
.padding(.horizontal)
// .padding(.horizontal)
.font(.system(size: 24, weight: .regular))
Spacer()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extension MainList {
rowViews
}
.padding(.vertical, 12) // Add top and bottom padding for the list etc
.padding(.horizontal) // Adds horizontal padding
}
/**
* List content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ extension SideBarList {
}
.scrollContentBackground(.hidden) // remove list bg
.environment(\.defaultMinListRowHeight, .zero) // ⚠️️ key to resetting topSpacer in the Listcontainer
#if os(iOS) // these seem to have no effect for macOS
.contentMargins(.vertical, .zero) // ⚠️️ key to removeing top margin, we cant use .contentMargins(.horizontal, .zero) as it will remove the rounded backgrounds for the section
.contentMargins(.horizontal, .zero) // Sets the horizontal content margins to zero, removing any default horizontal spacing.
#endif
.padding(.vertical, 12) // Adds vertical padding of 12 points to the list, enhancing visual separation between elements.
}
/**
Expand Down

0 comments on commit 0734a4a

Please sign in to comment.