Update Alignment of Side Menu Labels
Changelog-Fixed: Fix alignment of side menu labels Closes: #688
This commit is contained in:
committed by
William Casarin
parent
5cd4c2d75e
commit
4c3a83772e
@@ -108,6 +108,7 @@ struct SideMenuView: View {
|
||||
navLabel(title: NSLocalizedString("Settings", comment: "Sidebar menu label for accessing the app settings"), systemImage: "gear")
|
||||
}
|
||||
}
|
||||
.labelStyle(SideMenuLabelStyle())
|
||||
.padding([.top, .bottom], verticalSpacing)
|
||||
}
|
||||
}
|
||||
@@ -175,6 +176,17 @@ struct SideMenuView: View {
|
||||
.foregroundColor(textColor())
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
struct SideMenuLabelStyle: LabelStyle {
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
HStack(alignment: .center, spacing: 8) {
|
||||
configuration.icon
|
||||
.frame(width: 24, height: 24)
|
||||
.aspectRatio(contentMode: .fit)
|
||||
configuration.title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Previews_SideMenuView_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user