commit 4c3a83772ea247a3f61055c6dd681e7f5e9fbcfe
parent 5cd4c2d75eb7123694994e61e3b83a85bcc8a2d6
Author: Joel Klabo <joelklabo@gmail.com>
Date: Thu, 23 Feb 2023 16:38:35 -0800
Update Alignment of Side Menu Labels
Changelog-Fixed: Fix alignment of side menu labels
Closes: #688
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git 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 {