Update Alignment of Side Menu Labels

Changelog-Fixed: Fix alignment of side menu labels
Closes: #688
This commit is contained in:
Joel Klabo
2023-02-23 16:38:35 -08:00
committed by William Casarin
parent 5cd4c2d75e
commit 4c3a83772e

View File

@@ -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 {