From 4c3a83772ea247a3f61055c6dd681e7f5e9fbcfe Mon Sep 17 00:00:00 2001 From: Joel Klabo Date: Thu, 23 Feb 2023 16:38:35 -0800 Subject: [PATCH] Update Alignment of Side Menu Labels Changelog-Fixed: Fix alignment of side menu labels Closes: #688 --- damus/Views/SideMenuView.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/damus/Views/SideMenuView.swift b/damus/Views/SideMenuView.swift index f1fea5d4..add412d6 100644 --- a/damus/Views/SideMenuView.swift +++ b/damus/Views/SideMenuView.swift @@ -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 {