Add ScrollHint

This commit is contained in:
Hariharan Mudaliar 2025-12-21 11:11:31 +05:30
commit 047964f7c6
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
2 changed files with 26 additions and 3 deletions

View file

@ -16209,6 +16209,10 @@
}
}
},
"Scroll" : {
"comment" : "A hint text that appears when scrolling horizontally in the control palette.",
"isCommentAutoGenerated" : true
},
"Search clipboard..." : {
"localizations" : {
"fr" : {

View file

@ -80,13 +80,17 @@ struct MusicSlotConfigurationView: View {
private var palette: some View {
VStack(alignment: .leading, spacing: 6) {
HStack(spacing: 8) {
Text("Control Palette")
.font(.headline)
Spacer()
ScrollHintIndicator()
}
Text("Drag a control onto a slot or tap to place it in the first empty slot.")
.font(.caption)
.foregroundStyle(.secondary)
ScrollView(.horizontal, showsIndicators: true) {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 12) {
ForEach(pickerOptions, id: \.self) { control in
paletteItem(for: control)
@ -97,6 +101,21 @@ struct MusicSlotConfigurationView: View {
}
}
private struct ScrollHintIndicator: View {
var body: some View {
HStack(spacing: 2) {
Image(systemName: "chevron.left")
Text("Scroll")
Image(systemName: "chevron.right")
}
.font(.caption2.weight(.medium))
.foregroundStyle(.secondary)
.padding(.horizontal, 8)
.padding(.vertical, 4)
.background(Color.primary.opacity(0.08), in: Capsule())
}
}
private var resetButton: some View {
HStack {
Spacer()