diff --git a/assets/zh-Hans.lproj/Localizable.strings b/assets/zh-Hans.lproj/Localizable.strings index 04a874f..57202ca 100644 Binary files a/assets/zh-Hans.lproj/Localizable.strings and b/assets/zh-Hans.lproj/Localizable.strings differ diff --git a/src/config/navigationsplit.swift b/src/config/navigationsplit.swift index e4786b3..5f80440 100644 --- a/src/config/navigationsplit.swift +++ b/src/config/navigationsplit.swift @@ -35,17 +35,19 @@ struct ListConfigView: View { buildView(config: config).padding([.leading, .trailing]) } }.padding([.top], 1) + footer( + reset: { + // Reset only current page. + viewModel.selectedConfig?.resetToDefault() + }, + apply: { + // Save all pages. + Fcitx.setConfig("fcitx://\(path)", viewModel.config?.encodeValue()) + }, + close: { + FcitxInputController.controllers[key]?.window?.performClose(_: nil) + }) } - footer( - reset: { - viewModel.config?.resetToDefault() - }, - apply: { - Fcitx.setConfig("fcitx://\(path)", viewModel.config?.encodeValue()) - }, - close: { - FcitxInputController.controllers[key]?.window?.performClose(_: nil) - }) } } diff --git a/src/config/optionviews.swift b/src/config/optionviews.swift index 47b51a5..3e79e4b 100644 --- a/src/config/optionviews.swift +++ b/src/config/optionviews.swift @@ -497,6 +497,14 @@ struct GroupOptionView: OptionView { subLabel .font(.title3) .gridCellColumns(2) + .help(NSLocalizedString("Right click to reset this group.", comment: "")) + .contextMenu { + Button { + child.resetToDefault() + } label: { + Text("Reset to default") + } + } } GridRow { GroupBox { @@ -509,6 +517,14 @@ struct GroupOptionView: OptionView { GridRow { subLabel .frame(minWidth: 100, maxWidth: 300, alignment: .trailing) + .help(NSLocalizedString("Right click to reset this item.", comment: "")) + .contextMenu { + Button { + child.resetToDefault() + } label: { + Text("Reset to default") + } + } AnyView(subView) } } diff --git a/src/config/ui.swift b/src/config/ui.swift index e05c05d..f3e1d33 100644 --- a/src/config/ui.swift +++ b/src/config/ui.swift @@ -26,7 +26,15 @@ func footer(reset: @escaping () -> Void, apply: @escaping () -> Void, close: @es Button { reset() } label: { - Text("Reset to default") + Text("Reset to default").tooltip( + NSLocalizedString( + "Reset current page. To reset a single item/group, right click on its label.", comment: "" + )) + } + Button { + close() + } label: { + Text("Cancel") } Spacer() Button {