Refine settings sidebar selection
This commit is contained in:
1 parent
a40d6da2ba
commit
eb3a576a6d
2 files changed
+8
-18
No files matched your search
@@ -17,8 +17,8 @@
|
||||
TRMD00000000000000100007 /* GhosttyKit in Frameworks */ = {isa = PBXBuildFile; productRef = TRMD00000000000000100016 /* GhosttyKit */; };
|
||||
TRMD00000000000000100008 /* MarkdownView in Frameworks */ = {isa = PBXBuildFile; productRef = TRMD00000000000000100017 /* MarkdownView */; };
|
||||
TRMD00000000000000100009 /* ListViewKit in Frameworks */ = {isa = PBXBuildFile; productRef = TRMD00000000000000100018 /* ListViewKit */; };
|
||||
TRMD00000000000000100010 /* ScrubberKit in Frameworks */ = {isa = PBXBuildFile; productRef = TRMD00000000000000100019 /* ScrubberKit */; };
|
||||
TRMD0000000000000010000B /* GlyphixTextFx in Frameworks */ = {isa = PBXBuildFile; productRef = TRMD0000000000000010001A /* GlyphixTextFx */; };
|
||||
TRMD00000000000000100010 /* ScrubberKit in Frameworks */ = {isa = PBXBuildFile; productRef = TRMD00000000000000100019 /* ScrubberKit */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
||||
@@ -234,6 +234,7 @@ private struct SettingsSidebar: View {
|
||||
.font(.caption2.weight(.semibold))
|
||||
.foregroundStyle(.tertiary)
|
||||
.tracking(0.7)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(.horizontal, Metrics.Space.m)
|
||||
case .section(let section, _):
|
||||
sectionRow(section)
|
||||
@@ -253,24 +254,13 @@ private struct SettingsSidebar: View {
|
||||
}
|
||||
|
||||
private func sectionRow(_ section: SettingsSection) -> some View {
|
||||
Button { select(section) } label: {
|
||||
HStack(spacing: Metrics.Space.s) {
|
||||
Image(systemName: section.symbol)
|
||||
.frame(width: Metrics.Sidebar.rowIcon)
|
||||
.accessibilityHidden(true)
|
||||
Text(section.title)
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(.horizontal, Metrics.Space.m)
|
||||
.padding(.vertical, Metrics.Space.s)
|
||||
.background(
|
||||
Highlight.fill(isSelected: selection == section),
|
||||
in: .rect(cornerRadius: Metrics.Radius.medium)
|
||||
)
|
||||
.contentShape(.rect)
|
||||
SidebarNavigatorRow(
|
||||
title: section.title,
|
||||
symbol: section.symbol,
|
||||
isSelected: selection == section
|
||||
) {
|
||||
select(section)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityAddTraits(selection == section ? .isSelected : [])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user