@@ -19,16 +19,22 @@ struct BasicConfigView: View {
1919 let option = child [ " Option " ] as? String ?? " "
2020 let description = child [ " Description " ] as? String ?? " "
2121 let type = child [ " Type " ] as? String ?? " "
22+ let isGroup = toOptionViewType ( child) == GroupView . self
2223 let label =
2324 type == " External "
2425 ? Text ( description) as any View
25- : Text ( description) . contextMenu {
26- Button {
27- onUpdate ( mergeChild ( value, option, extractValue ( child, reset: true ) ) )
28- } label: {
29- Text ( " Reset to default " )
26+ : Text ( description)
27+ . help (
28+ isGroup
29+ ? NSLocalizedString ( " Right click to reset this group " , comment: " " )
30+ : NSLocalizedString ( " Right click to reset this item " , comment: " " )
31+ ) . contextMenu {
32+ Button {
33+ onUpdate ( mergeChild ( value, option, extractValue ( child, reset: true ) ) )
34+ } label: {
35+ Text ( " Reset to default " )
36+ }
3037 }
31- }
3238 let view = optionView (
3339 data: child,
3440 value: Binding (
@@ -37,11 +43,10 @@ struct BasicConfigView: View {
3743 onUpdate ( mergeChild ( value, option, $0) )
3844 } )
3945 )
40- if toOptionViewType ( child ) == GroupView . self {
46+ if isGroup {
4147 // For group, put it inside a box and let it span two columns.
4248 VStack ( alignment: . leading, spacing: 4 ) {
4349 AnyView ( label) . font ( . title3)
44- . help ( NSLocalizedString ( " Right click to reset this group " , comment: " " ) )
4550 view
4651 }
4752 } else {
@@ -51,7 +56,6 @@ struct BasicConfigView: View {
5156 // Hack: Punctuation map looks better without label.
5257 if type != " List|Entries$PunctuationMapEntryConfig " {
5358 AnyView ( label) . frame ( width: 200 , alignment: . trailing)
54- . help ( NSLocalizedString ( " Right click to reset this item " , comment: " " ) )
5559 }
5660 view. frame ( maxWidth: . infinity, alignment: . leading)
5761 }
0 commit comments