Repo // Preferences -> SSPreferences.
This commit is contained in:
parent
88b0726448
commit
77f071eef5
|
@ -2,21 +2,21 @@
|
|||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Preferences",
|
||||
name: "SSPreferences",
|
||||
platforms: [
|
||||
.macOS(.v10_11)
|
||||
],
|
||||
products: [
|
||||
.library(
|
||||
name: "Preferences",
|
||||
name: "SSPreferences",
|
||||
targets: [
|
||||
"Preferences"
|
||||
"SSPreferences"
|
||||
]
|
||||
)
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "Preferences"
|
||||
name: "SSPreferences"
|
||||
)
|
||||
]
|
||||
)
|
|
@ -7,3 +7,5 @@
|
|||
```
|
||||
|
||||
See its original repository for details: https://github.com/sindresorhus/Preferences/
|
||||
|
||||
Note: In vChewing IME, this module is renamed to SSPreferences due to potential namespace conflicts with InputMethodKit's own method of implementing system preferences pane.
|
|
@ -5,7 +5,7 @@
|
|||
import SwiftUI
|
||||
|
||||
@available(macOS 10.15, *)
|
||||
extension Preferences {
|
||||
extension SSPreferences {
|
||||
/**
|
||||
Function builder for `Preferences` components used in order to restrict types of child views to be of type `Section`.
|
||||
*/
|
|
@ -15,7 +15,7 @@ public protocol PreferencePaneConvertible {
|
|||
}
|
||||
|
||||
@available(macOS 10.15, *)
|
||||
extension Preferences {
|
||||
extension SSPreferences {
|
||||
/**
|
||||
Create a SwiftUI-based preference pane.
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
import Cocoa
|
||||
|
||||
extension Preferences {
|
||||
extension SSPreferences {
|
||||
public struct PaneIdentifier: Hashable, RawRepresentable, Codable {
|
||||
public let rawValue: String
|
||||
|
||||
|
@ -15,7 +15,7 @@ extension Preferences {
|
|||
}
|
||||
|
||||
public protocol PreferencePane: NSViewController {
|
||||
var preferencePaneIdentifier: Preferences.PaneIdentifier { get }
|
||||
var preferencePaneIdentifier: SSPreferences.PaneIdentifier { get }
|
||||
var preferencePaneTitle: String { get }
|
||||
var toolbarItemIcon: NSImage { get }
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ extension PreferencePane {
|
|||
public var toolbarItemIcon: NSImage { .empty }
|
||||
}
|
||||
|
||||
extension Preferences.PaneIdentifier {
|
||||
extension SSPreferences.PaneIdentifier {
|
||||
public init(_ rawValue: String) {
|
||||
self.init(rawValue: rawValue)
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
import Cocoa
|
||||
|
||||
extension Preferences {
|
||||
extension SSPreferences {
|
||||
public enum Style {
|
||||
case toolbarItems
|
||||
case segmentedControl
|
|
@ -9,11 +9,11 @@ protocol PreferencesStyleController: AnyObject {
|
|||
var isKeepingWindowCentered: Bool { get }
|
||||
|
||||
func toolbarItemIdentifiers() -> [NSToolbarItem.Identifier]
|
||||
func toolbarItem(preferenceIdentifier: Preferences.PaneIdentifier) -> NSToolbarItem?
|
||||
func toolbarItem(preferenceIdentifier: SSPreferences.PaneIdentifier) -> NSToolbarItem?
|
||||
func selectTab(index: Int)
|
||||
}
|
||||
|
||||
protocol PreferencesStyleControllerDelegate: AnyObject {
|
||||
func activateTab(preferenceIdentifier: Preferences.PaneIdentifier, animated: Bool)
|
||||
func activateTab(preferenceIdentifier: SSPreferences.PaneIdentifier, animated: Bool)
|
||||
func activateTab(index: Int, animated: Bool)
|
||||
}
|
|
@ -7,7 +7,7 @@ import Cocoa
|
|||
final class PreferencesTabViewController: NSViewController, PreferencesStyleControllerDelegate {
|
||||
private var activeTab: Int?
|
||||
private var preferencePanes = [PreferencePane]()
|
||||
private var style: Preferences.Style?
|
||||
private var style: SSPreferences.Style?
|
||||
internal var preferencePanesCount: Int { preferencePanes.count }
|
||||
private var preferencesStyleController: PreferencesStyleController!
|
||||
private var isKeepingWindowCentered: Bool { preferencesStyleController.isKeepingWindowCentered }
|
||||
|
@ -37,7 +37,7 @@ final class PreferencesTabViewController: NSViewController, PreferencesStyleCont
|
|||
view.translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
|
||||
func configure(preferencePanes: [PreferencePane], style: Preferences.Style) {
|
||||
func configure(preferencePanes: [PreferencePane], style: SSPreferences.Style) {
|
||||
self.preferencePanes = preferencePanes
|
||||
self.style = style
|
||||
children = preferencePanes
|
||||
|
@ -68,7 +68,7 @@ final class PreferencesTabViewController: NSViewController, PreferencesStyleCont
|
|||
activateTab(preferenceIdentifier: preferencePane.preferencePaneIdentifier, animated: animated)
|
||||
}
|
||||
|
||||
func activateTab(preferenceIdentifier: Preferences.PaneIdentifier, animated: Bool) {
|
||||
func activateTab(preferenceIdentifier: SSPreferences.PaneIdentifier, animated: Bool) {
|
||||
guard let index = (preferencePanes.firstIndex { $0.preferencePaneIdentifier == preferenceIdentifier }) else {
|
||||
return activateTab(index: 0, animated: animated)
|
||||
}
|
||||
|
@ -245,6 +245,6 @@ extension PreferencesTabViewController: NSToolbarDelegate {
|
|||
}
|
||||
|
||||
return preferencesStyleController.toolbarItem(
|
||||
preferenceIdentifier: Preferences.PaneIdentifier(fromToolbarItemIdentifier: itemIdentifier))
|
||||
preferenceIdentifier: SSPreferences.PaneIdentifier(fromToolbarItemIdentifier: itemIdentifier))
|
||||
}
|
||||
}
|
|
@ -32,7 +32,7 @@ public final class PreferencesWindowController: NSWindowController {
|
|||
|
||||
public init(
|
||||
preferencePanes: [PreferencePane],
|
||||
style: Preferences.Style = .toolbarItems,
|
||||
style: SSPreferences.Style = .toolbarItems,
|
||||
animated: Bool = true,
|
||||
hidesToolbarForSingleItem: Bool = true
|
||||
) {
|
||||
|
@ -83,7 +83,7 @@ public final class PreferencesWindowController: NSWindowController {
|
|||
/**
|
||||
Show the preferences window and brings it to front.
|
||||
|
||||
If you pass a `Preferences.PaneIdentifier`, the window will activate the corresponding tab.
|
||||
If you pass a `SSPreferences.PaneIdentifier`, the window will activate the corresponding tab.
|
||||
|
||||
- Parameter preferencePane: Identifier of the preference pane to display, or `nil` to show the tab that was open when the user last closed the window.
|
||||
|
||||
|
@ -92,7 +92,7 @@ public final class PreferencesWindowController: NSWindowController {
|
|||
- See `close()` to close the window again.
|
||||
- See `showWindow(_:)` to show the window without the convenience of activating the app.
|
||||
*/
|
||||
public func show(preferencePane preferenceIdentifier: Preferences.PaneIdentifier? = nil) {
|
||||
public func show(preferencePane preferenceIdentifier: SSPreferences.PaneIdentifier? = nil) {
|
||||
if let preferenceIdentifier = preferenceIdentifier {
|
||||
tabViewController.activateTab(preferenceIdentifier: preferenceIdentifier, animated: false)
|
||||
} else {
|
||||
|
@ -156,7 +156,7 @@ extension PreferencesWindowController {
|
|||
*/
|
||||
public convenience init(
|
||||
panes: [PreferencePaneConvertible],
|
||||
style: Preferences.Style = .toolbarItems,
|
||||
style: SSPreferences.Style = .toolbarItems,
|
||||
animated: Bool = true,
|
||||
hidesToolbarForSingleItem: Bool = true
|
||||
) {
|
|
@ -3,4 +3,4 @@
|
|||
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
|
||||
|
||||
/// The namespace for this package.
|
||||
public enum Preferences {}
|
||||
public enum SSPreferences {}
|
|
@ -5,7 +5,7 @@
|
|||
import SwiftUI
|
||||
|
||||
@available(macOS 10.15, *)
|
||||
extension Preferences {
|
||||
extension SSPreferences {
|
||||
/**
|
||||
Represents a section with right-aligned title and optional bottom divider.
|
||||
*/
|
|
@ -109,7 +109,7 @@ final class SegmentedControlStyleViewController: NSViewController, PreferencesSt
|
|||
]
|
||||
}
|
||||
|
||||
func toolbarItem(preferenceIdentifier: Preferences.PaneIdentifier) -> NSToolbarItem? {
|
||||
func toolbarItem(preferenceIdentifier: SSPreferences.PaneIdentifier) -> NSToolbarItem? {
|
||||
let toolbarItemIdentifier = preferenceIdentifier.toolbarItemIdentifier
|
||||
precondition(toolbarItemIdentifier == .toolbarSegmentedControlItem)
|
||||
|
|
@ -35,7 +35,7 @@ final class ToolbarItemStyleViewController: NSObject, PreferencesStyleController
|
|||
return toolbarItemIdentifiers
|
||||
}
|
||||
|
||||
func toolbarItem(preferenceIdentifier: Preferences.PaneIdentifier) -> NSToolbarItem? {
|
||||
func toolbarItem(preferenceIdentifier: SSPreferences.PaneIdentifier) -> NSToolbarItem? {
|
||||
guard let preference = (preferencePanes.first { $0.preferencePaneIdentifier == preferenceIdentifier }) else {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ final class ToolbarItemStyleViewController: NSObject, PreferencesStyleController
|
|||
|
||||
@IBAction private func toolbarItemSelected(_ toolbarItem: NSToolbarItem) {
|
||||
delegate?.activateTab(
|
||||
preferenceIdentifier: Preferences.PaneIdentifier(fromToolbarItemIdentifier: toolbarItem.itemIdentifier),
|
||||
preferenceIdentifier: SSPreferences.PaneIdentifier(fromToolbarItemIdentifier: toolbarItem.itemIdentifier),
|
||||
animated: true
|
||||
)
|
||||
}
|
|
@ -154,12 +154,12 @@ extension SessionCtl {
|
|||
/// **REASON**: IMKCandidates has bug that it does not respect font attributes attached to the
|
||||
/// results generated from `candidiates() -> [Any]!` function. IMKCandidates is plagued with
|
||||
/// bugs which are not dealt in the recent decade, regardless Radar complaints from input method developers.
|
||||
/// 1) Make sure the usage of ".languageIdentifier" is disabled in the Dev Zone of the vChewing Preferences.
|
||||
/// 1) Make sure the usage of ".languageIdentifier" is disabled in the Dev Zone of the vChewing SSPreferences.
|
||||
/// 2) Run "make update" in the project folder to download the latest git-submodule of dictionary file.
|
||||
/// 3) Compile the target "vChewingInstaller", run it. It will install the input method into
|
||||
/// "~/Library/Input Methods/" folder. Remember to ENABLE BOTH "vChewing-CHS"
|
||||
/// and "vChewing-CHT" input sources in System Preferences / Settings.
|
||||
/// 4) Type Zhuyin "ej3" (ㄍㄨˇ) (or "gu3" in Pinyin if you enabled Pinyin typing in vChewing preferences.)
|
||||
/// 4) Type Zhuyin "ej3" (ㄍㄨˇ) (or "gu3" in Pinyin if you enabled Pinyin typing in vChewing SSPreferences.)
|
||||
/// using both "vChewing-CHS" and "vChewing-CHT", and check the candidate window by pressing SPACE key.
|
||||
/// 5) Do NOT enable either KangXi conversion mode nor JIS conversion mode. They are disabled by default.
|
||||
/// 6) Expecting the glyph differences of the candidate "骨" between PingFang SC and PingFang TC when rendering
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// requirements defined in MIT License.
|
||||
|
||||
import NotifierUI
|
||||
import Preferences
|
||||
import SSPreferences
|
||||
import UpdateSputnik
|
||||
|
||||
extension Bool {
|
||||
|
@ -199,7 +199,7 @@ extension SessionCtl {
|
|||
CtlPrefWindow.show()
|
||||
} else {
|
||||
NSApp.setActivationPolicy(.accessory)
|
||||
CtlPrefUI.shared.controller.show(preferencePane: Preferences.PaneIdentifier(rawValue: "General"))
|
||||
CtlPrefUI.shared.controller.show(preferencePane: SSPreferences.PaneIdentifier(rawValue: "General"))
|
||||
CtlPrefUI.shared.controller.window?.level = .statusBar
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// marks, or product names of Contributor, except as required to fulfill notice
|
||||
// requirements defined in MIT License.
|
||||
|
||||
import Preferences
|
||||
import SSPreferences
|
||||
import SwiftUI
|
||||
|
||||
extension NSImage {
|
||||
|
@ -70,36 +70,36 @@ extension NSImage {
|
|||
class CtlPrefUI {
|
||||
var controller = PreferencesWindowController(
|
||||
panes: [
|
||||
Preferences.Pane(
|
||||
identifier: Preferences.PaneIdentifier(rawValue: "General"),
|
||||
SSPreferences.Pane(
|
||||
identifier: SSPreferences.PaneIdentifier(rawValue: "General"),
|
||||
title: NSLocalizedString("General", comment: ""),
|
||||
toolbarIcon: .tabImageGeneral
|
||||
) {
|
||||
VwrPrefPaneGeneral()
|
||||
},
|
||||
Preferences.Pane(
|
||||
identifier: Preferences.PaneIdentifier(rawValue: "Experience"),
|
||||
SSPreferences.Pane(
|
||||
identifier: SSPreferences.PaneIdentifier(rawValue: "Experience"),
|
||||
title: NSLocalizedString("Experience", comment: ""),
|
||||
toolbarIcon: .tabImageExperience
|
||||
) {
|
||||
VwrPrefPaneExperience()
|
||||
},
|
||||
Preferences.Pane(
|
||||
identifier: Preferences.PaneIdentifier(rawValue: "Dictionary"),
|
||||
SSPreferences.Pane(
|
||||
identifier: SSPreferences.PaneIdentifier(rawValue: "Dictionary"),
|
||||
title: NSLocalizedString("Dictionary", comment: ""),
|
||||
toolbarIcon: .tabImageDictionary
|
||||
) {
|
||||
VwrPrefPaneDictionary()
|
||||
},
|
||||
Preferences.Pane(
|
||||
identifier: Preferences.PaneIdentifier(rawValue: "Keyboard"),
|
||||
SSPreferences.Pane(
|
||||
identifier: SSPreferences.PaneIdentifier(rawValue: "Keyboard"),
|
||||
title: NSLocalizedString("Keyboard", comment: ""),
|
||||
toolbarIcon: .tabImageKeyboard
|
||||
) {
|
||||
VwrPrefPaneKeyboard()
|
||||
},
|
||||
Preferences.Pane(
|
||||
identifier: Preferences.PaneIdentifier(rawValue: "DevZone"),
|
||||
SSPreferences.Pane(
|
||||
identifier: SSPreferences.PaneIdentifier(rawValue: "DevZone"),
|
||||
title: NSLocalizedString("DevZone", comment: ""),
|
||||
toolbarIcon: .tabImageDevZone
|
||||
) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// marks, or product names of Contributor, except as required to fulfill notice
|
||||
// requirements defined in MIT License.
|
||||
|
||||
import Preferences
|
||||
import SSPreferences
|
||||
import Shared
|
||||
import SwiftUI
|
||||
|
||||
|
@ -42,8 +42,8 @@ struct VwrPrefPaneDevZone: View {
|
|||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Preferences.Container(contentWidth: contentWidth) {
|
||||
Preferences.Section(title: "", bottomDivider: true) {
|
||||
SSPreferences.Container(contentWidth: contentWidth) {
|
||||
SSPreferences.Section(title: "", bottomDivider: true) {
|
||||
Text(
|
||||
LocalizedStringKey(
|
||||
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected.")
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// requirements defined in MIT License.
|
||||
|
||||
import BookmarkManager
|
||||
import Preferences
|
||||
import SSPreferences
|
||||
import Shared
|
||||
import SwiftUI
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// marks, or product names of Contributor, except as required to fulfill notice
|
||||
// requirements defined in MIT License.
|
||||
|
||||
import Preferences
|
||||
import SSPreferences
|
||||
import Shared
|
||||
import SwiftUI
|
||||
|
||||
|
@ -89,8 +89,8 @@ struct VwrPrefPaneExperience: View {
|
|||
.preferenceDescription()
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}.frame(maxWidth: contentWidth)
|
||||
Preferences.Container(contentWidth: contentWidth) {
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Cursor Selection:")) }) {
|
||||
SSPreferences.Container(contentWidth: contentWidth) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Cursor Selection:")) }) {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selCursorPosition.onChange {
|
||||
|
@ -111,7 +111,7 @@ struct VwrPrefPaneExperience: View {
|
|||
}
|
||||
).controlSize(.small)
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Shift+BackSpace:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Shift+BackSpace:")) }) {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selSpecifyShiftBackSpaceKeyBehavior.onChange {
|
||||
|
@ -127,7 +127,7 @@ struct VwrPrefPaneExperience: View {
|
|||
Text(LocalizedStringKey("Disassembling process does not work with non-phonetic reading keys."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(title: "(Shift+)Tab:") {
|
||||
SSPreferences.Section(title: "(Shift+)Tab:") {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selKeyBehaviorShiftTab.onChange {
|
||||
|
@ -143,7 +143,7 @@ struct VwrPrefPaneExperience: View {
|
|||
Text(LocalizedStringKey("Choose the behavior of (Shift+)Tab key in the candidate window."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("(Shift+)Space:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("(Shift+)Space:")) }) {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selKeyBehaviorShiftSpace.onChange {
|
||||
|
@ -158,7 +158,7 @@ struct VwrPrefPaneExperience: View {
|
|||
Text(LocalizedStringKey("Choose the behavior of (Shift+)Space key with candidates."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Shift+Letter:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Shift+Letter:")) }) {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selUpperCaseLetterKeyBehavior.onChange {
|
||||
|
@ -174,7 +174,7 @@ struct VwrPrefPaneExperience: View {
|
|||
Text(LocalizedStringKey("Choose the behavior of Shift+Letter key with letter inputs."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Intonation Key:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Intonation Key:")) }) {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selSpecifyIntonationKeyBehavior.onChange {
|
||||
|
@ -190,7 +190,7 @@ struct VwrPrefPaneExperience: View {
|
|||
Text(LocalizedStringKey("Specify the behavior of intonation key when syllable composer is empty."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(title: "Shift:") {
|
||||
SSPreferences.Section(title: "Shift:") {
|
||||
Toggle(
|
||||
LocalizedStringKey("Completely disable using Shift key to toggle alphanumerical mode"),
|
||||
isOn: $selDisableShiftTogglingAlphanumericalMode.onChange {
|
||||
|
@ -204,7 +204,7 @@ struct VwrPrefPaneExperience: View {
|
|||
}
|
||||
).disabled(PrefMgr.shared.disableShiftTogglingAlphanumericalMode == true)
|
||||
}
|
||||
Preferences.Section(title: "Caps Lock:") {
|
||||
SSPreferences.Section(title: "Caps Lock:") {
|
||||
Toggle(
|
||||
LocalizedStringKey("Show notifications when toggling Caps Lock"),
|
||||
isOn: $selShowNotificationsWhenTogglingCapsLock.onChange {
|
||||
|
@ -212,7 +212,7 @@ struct VwrPrefPaneExperience: View {
|
|||
}
|
||||
).disabled(!macOSMontereyOrLaterDetected)
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Misc Settings:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Misc Settings:")) }) {
|
||||
Toggle(
|
||||
LocalizedStringKey("Enable Space key for calling candidate window"),
|
||||
isOn: $selKeyBehaviorSpaceForCallingCandidate.onChange {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// marks, or product names of Contributor, except as required to fulfill notice
|
||||
// requirements defined in MIT License.
|
||||
|
||||
import Preferences
|
||||
import SSPreferences
|
||||
import Shared
|
||||
import SwiftUI
|
||||
|
||||
|
@ -53,8 +53,8 @@ struct VwrPrefPaneGeneral: View {
|
|||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Preferences.Container(contentWidth: contentWidth) {
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Candidate Size:")) }) {
|
||||
SSPreferences.Container(contentWidth: contentWidth) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Candidate Size:")) }) {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selCandidateUIFontSize.onChange {
|
||||
|
@ -82,7 +82,7 @@ struct VwrPrefPaneGeneral: View {
|
|||
Text(LocalizedStringKey("Choose candidate font size for better visual clarity."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("UI Language:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("UI Language:")) }) {
|
||||
Picker(
|
||||
LocalizedStringKey("Follow OS settings"),
|
||||
selection: $selUILanguage.onChange {
|
||||
|
@ -114,7 +114,7 @@ struct VwrPrefPaneGeneral: View {
|
|||
Text(LocalizedStringKey("Change user interface language (will reboot the IME)."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Candidate Layout:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Candidate Layout:")) }) {
|
||||
Picker(
|
||||
"",
|
||||
selection: $selEnableHorizontalCandidateLayout.onChange {
|
||||
|
@ -130,7 +130,7 @@ struct VwrPrefPaneGeneral: View {
|
|||
Text(LocalizedStringKey("Choose your preferred layout of the candidate window."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Output Settings:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Output Settings:")) }) {
|
||||
Toggle(
|
||||
LocalizedStringKey("Auto-convert traditional Chinese glyphs to KangXi characters"),
|
||||
isOn: $selEnableKanjiConvToKangXi.onChange {
|
||||
|
@ -165,7 +165,7 @@ struct VwrPrefPaneGeneral: View {
|
|||
}
|
||||
)
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Misc Settings:")).controlSize(.small) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Misc Settings:")).controlSize(.small) }) {
|
||||
Toggle(
|
||||
LocalizedStringKey("Check for updates automatically"),
|
||||
isOn: $selEnableAutoUpdateCheck.onChange {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// requirements defined in MIT License.
|
||||
|
||||
import IMKUtils
|
||||
import Preferences
|
||||
import SSPreferences
|
||||
import Shared
|
||||
import SwiftUI
|
||||
|
||||
|
@ -50,8 +50,8 @@ struct VwrPrefPaneKeyboard: View {
|
|||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Preferences.Container(contentWidth: contentWidth) {
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Selection Keys:")) }) {
|
||||
SSPreferences.Container(contentWidth: contentWidth) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Selection Keys:")) }) {
|
||||
ComboBox(
|
||||
items: CandidateKey.suggestions,
|
||||
text: $selSelectionKeys.onChange {
|
||||
|
@ -94,7 +94,7 @@ struct VwrPrefPaneKeyboard: View {
|
|||
.preferenceDescription()
|
||||
}
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Quick Setup:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Quick Setup:")) }) {
|
||||
HStack {
|
||||
Button {
|
||||
PrefMgr.shared.keyboardParser = 0
|
||||
|
@ -122,7 +122,7 @@ struct VwrPrefPaneKeyboard: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Phonetic Parser:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Phonetic Parser:")) }) {
|
||||
HStack {
|
||||
Picker(
|
||||
"",
|
||||
|
@ -168,7 +168,7 @@ struct VwrPrefPaneKeyboard: View {
|
|||
)
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Basic Keyboard Layout:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Basic Keyboard Layout:")) }) {
|
||||
HStack {
|
||||
Picker(
|
||||
"",
|
||||
|
@ -197,7 +197,7 @@ struct VwrPrefPaneKeyboard: View {
|
|||
)
|
||||
.preferenceDescription()
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Alphanumerical Layout:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Alphanumerical Layout:")) }) {
|
||||
HStack {
|
||||
Picker(
|
||||
"",
|
||||
|
@ -225,7 +225,7 @@ struct VwrPrefPaneKeyboard: View {
|
|||
Spacer().frame(width: 30)
|
||||
}
|
||||
}
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Keyboard Shortcuts:")) }) {
|
||||
SSPreferences.Section(label: { Text(LocalizedStringKey("Keyboard Shortcuts:")) }) {
|
||||
HStack(alignment: .top, spacing: NSFont.systemFontSize) {
|
||||
VStack(alignment: .leading) {
|
||||
Toggle(
|
||||
|
|
|
@ -195,7 +195,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
<div> </div>
|
||||
<div>These shortcuts are for toggling certain function modes. You can disable these shortcuts in vChewing Preferences.</div>
|
||||
<div>These shortcuts are for toggling certain function modes. You can disable these shortcuts in vChewing SSPreferences.</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -436,7 +436,7 @@
|
|||
<div>Disassembly the previous reading (i.e. the reading at the rear of the cursor) and remove its intonation. Will remove the previous reading if it is not able to be disassembled.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>Requiring that ICB is not empty and the IME is not in marking state. Its behavior can be specified in vChewing Preferences.</div>
|
||||
<div>Requiring that ICB is not empty and the IME is not in marking state. Its behavior can be specified in vChewing SSPreferences.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -447,7 +447,7 @@
|
|||
<div>Attempt to disassembly the previous reading (i.e. the reading at the rear of the cursor), remove its intonation, and override its intonation with the intonation key pressed. Will insert standalone intonation mark if previous reading doesn't exist or is not able to be disassembled.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>Requiring that ICB is not empty and the IME is not in marking state. Its behavior can be specified in vChewing Preferences.</div>
|
||||
<div>Requiring that ICB is not empty and the IME is not in marking state. Its behavior can be specified in vChewing SSPreferences.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -458,7 +458,7 @@
|
|||
<div>Dump the current ICB to W3C Ruby HTML format. The pronunciations are written in textbook format.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>Requiring that ICB is not empty and the IME is not in marking state. One can specify whether it dumps Hanyu-Pinyin or Phonabets in vChewing Preferences.</div>
|
||||
<div>Requiring that ICB is not empty and the IME is not in marking state. One can specify whether it dumps Hanyu-Pinyin or Phonabets in vChewing SSPreferences.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -538,7 +538,7 @@
|
|||
<div>Call candidate window.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>As above but can be disabled in vChewing Preferences.</div>
|
||||
<div>As above but can be disabled in vChewing SSPreferences.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -550,7 +550,7 @@
|
|||
<div>Quit the marking state if in the marking state.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>Its behavior (when not in marking state) can be disabled in vChewing Preferences. If so, it will only clear the unfinished pronunciation in the PCB.</div>
|
||||
<div>Its behavior (when not in marking state) can be disabled in vChewing SSPreferences. If so, it will only clear the unfinished pronunciation in the PCB.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -562,7 +562,7 @@
|
|||
<div>Toggle alphanumerical input mode.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>Can be disabled in vChewing Preferences.</div>
|
||||
<div>Can be disabled in vChewing SSPreferences.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -610,7 +610,7 @@
|
|||
<div>⇧␣</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>Rotate pages or candidates clockwise, according to its settings in vChewing Preferences.</div>
|
||||
<div>Rotate pages or candidates clockwise, according to its settings in vChewing SSPreferences.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>It rotates candidates when there is only one page.</div>
|
||||
|
@ -713,7 +713,7 @@
|
|||
<div>⇧␣</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>Rotate pages or candidates clockwise, according to its settings in vChewing Preferences.</div>
|
||||
<div>Rotate pages or candidates clockwise, according to its settings in vChewing SSPreferences.</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>No exceptions happen even if there's only one page.</div>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
5B40113928D7050D00A9D4CB /* Shared in Frameworks */ = {isa = PBXBuildFile; productRef = 5B40113828D7050D00A9D4CB /* Shared */; };
|
||||
5B40113C28D71C0100A9D4CB /* Uninstaller in Frameworks */ = {isa = PBXBuildFile; productRef = 5B40113B28D71C0100A9D4CB /* Uninstaller */; };
|
||||
5B5A603028E81CC50001AE8D /* SwiftUIBackports in Frameworks */ = {isa = PBXBuildFile; productRef = 5B5A602F28E81CC50001AE8D /* SwiftUIBackports */; };
|
||||
5B5C8ED828FC0EA9002C93A5 /* SSPreferences in Frameworks */ = {isa = PBXBuildFile; productRef = 5B5C8ED728FC0EA9002C93A5 /* SSPreferences */; };
|
||||
5B62A33D27AE7CC100A19448 /* CtlAboutWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B62A33C27AE7CC100A19448 /* CtlAboutWindow.swift */; };
|
||||
5B660A8628F64A8800E5E4F6 /* SymbolMenuDefaultData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B660A8528F64A8800E5E4F6 /* SymbolMenuDefaultData.swift */; };
|
||||
5B6C141228A9D4B30098ADF8 /* SessionCtl_HandleEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6C141128A9D4B30098ADF8 /* SessionCtl_HandleEvent.swift */; };
|
||||
|
@ -80,7 +81,6 @@
|
|||
5BDB7A3D28D4824A001AC277 /* Hotenka in Frameworks */ = {isa = PBXBuildFile; productRef = 5BDB7A3C28D4824A001AC277 /* Hotenka */; };
|
||||
5BDB7A3F28D4824A001AC277 /* LineReader in Frameworks */ = {isa = PBXBuildFile; productRef = 5BDB7A3E28D4824A001AC277 /* LineReader */; };
|
||||
5BDB7A4128D4824A001AC277 /* Megrez in Frameworks */ = {isa = PBXBuildFile; productRef = 5BDB7A4028D4824A001AC277 /* Megrez */; };
|
||||
5BDB7A4328D4824A001AC277 /* Preferences in Frameworks */ = {isa = PBXBuildFile; productRef = 5BDB7A4228D4824A001AC277 /* Preferences */; };
|
||||
5BDB7A4528D4824A001AC277 /* ShiftKeyUpChecker in Frameworks */ = {isa = PBXBuildFile; productRef = 5BDB7A4428D4824A001AC277 /* ShiftKeyUpChecker */; };
|
||||
5BDB7A4728D4824A001AC277 /* Tekkon in Frameworks */ = {isa = PBXBuildFile; productRef = 5BDB7A4628D4824A001AC277 /* Tekkon */; };
|
||||
5BDCBB2E27B4E67A00D0CC59 /* vChewingPhraseEditor.app in Resources */ = {isa = PBXBuildFile; fileRef = 5BD05BB827B2A429004C4F1D /* vChewingPhraseEditor.app */; };
|
||||
|
@ -211,6 +211,7 @@
|
|||
5B3133BE280B229700A4A505 /* InputHandler_States.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = InputHandler_States.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
|
||||
5B40113A28D71B8700A9D4CB /* vChewing_Uninstaller */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = vChewing_Uninstaller; path = Packages/vChewing_Uninstaller; sourceTree = "<group>"; };
|
||||
5B5A602E28E81CB00001AE8D /* ShapsBenkau_SwiftUIBackports */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = ShapsBenkau_SwiftUIBackports; path = Packages/ShapsBenkau_SwiftUIBackports; sourceTree = "<group>"; };
|
||||
5B5C8ED628FC0E8E002C93A5 /* Sindresorhus_SSPreferences */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Sindresorhus_SSPreferences; path = Packages/Sindresorhus_SSPreferences; sourceTree = "<group>"; };
|
||||
5B62A33C27AE7CC100A19448 /* CtlAboutWindow.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = CtlAboutWindow.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
|
||||
5B65B919284D0185007C558B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
5B660A8528F64A8800E5E4F6 /* SymbolMenuDefaultData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SymbolMenuDefaultData.swift; sourceTree = "<group>"; };
|
||||
|
@ -267,7 +268,6 @@
|
|||
5BD05C6327B2BBEF004C4F1D /* Content.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = Content.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
|
||||
5BD05C6427B2BBEF004C4F1D /* WindowController.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = WindowController.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
|
||||
5BD05C6527B2BBEF004C4F1D /* ViewController.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = ViewController.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
|
||||
5BDB7A2F28D47587001AC277 /* Sindresorhus_Preferences */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Sindresorhus_Preferences; path = Packages/Sindresorhus_Preferences; sourceTree = "<group>"; };
|
||||
5BDB7A3028D47587001AC277 /* Jad_BookmarkManager */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Jad_BookmarkManager; path = Packages/Jad_BookmarkManager; sourceTree = "<group>"; };
|
||||
5BDB7A3128D47587001AC277 /* DanielGalasko_FolderMonitor */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = DanielGalasko_FolderMonitor; path = Packages/DanielGalasko_FolderMonitor; sourceTree = "<group>"; };
|
||||
5BDB7A3228D47587001AC277 /* vChewing_Hotenka */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = vChewing_Hotenka; path = Packages/vChewing_Hotenka; sourceTree = "<group>"; };
|
||||
|
@ -354,7 +354,6 @@
|
|||
5BDB7A4128D4824A001AC277 /* Megrez in Frameworks */,
|
||||
5BFC63C928D49754004A77B7 /* IMKUtils in Frameworks */,
|
||||
5BDB7A4728D4824A001AC277 /* Tekkon in Frameworks */,
|
||||
5BDB7A4328D4824A001AC277 /* Preferences in Frameworks */,
|
||||
5BDB7A3D28D4824A001AC277 /* Hotenka in Frameworks */,
|
||||
5BDB7A3F28D4824A001AC277 /* LineReader in Frameworks */,
|
||||
5B963C9D28D5BFB800DCEE88 /* CocoaExtension in Frameworks */,
|
||||
|
@ -362,6 +361,7 @@
|
|||
5BFC63CF28D4ACA3004A77B7 /* LangModelAssembly in Frameworks */,
|
||||
5BC5E02128DDEFE00094E427 /* TooltipUI in Frameworks */,
|
||||
5BDB7A3928D4824A001AC277 /* BookmarkManager in Frameworks */,
|
||||
5B5C8ED828FC0EA9002C93A5 /* SSPreferences in Frameworks */,
|
||||
5B5A603028E81CC50001AE8D /* SwiftUIBackports in Frameworks */,
|
||||
5B963CA328D5C23600DCEE88 /* SwiftExtension in Frameworks */,
|
||||
5B40113928D7050D00A9D4CB /* Shared in Frameworks */,
|
||||
|
@ -577,7 +577,7 @@
|
|||
5BDB7A3428D47587001AC277 /* Qwertyyb_ShiftKeyUpChecker */,
|
||||
5BDB7A3528D47587001AC277 /* RMJay_LineReader */,
|
||||
5B5A602E28E81CB00001AE8D /* ShapsBenkau_SwiftUIBackports */,
|
||||
5BDB7A2F28D47587001AC277 /* Sindresorhus_Preferences */,
|
||||
5B5C8ED628FC0E8E002C93A5 /* Sindresorhus_SSPreferences */,
|
||||
5BA8C30128DEFE4F004C5CC4 /* vChewing_CandidateWindow */,
|
||||
5B963C9B28D5BE4100DCEE88 /* vChewing_CocoaExtension */,
|
||||
5BDB7A3228D47587001AC277 /* vChewing_Hotenka */,
|
||||
|
@ -779,7 +779,6 @@
|
|||
5BDB7A3C28D4824A001AC277 /* Hotenka */,
|
||||
5BDB7A3E28D4824A001AC277 /* LineReader */,
|
||||
5BDB7A4028D4824A001AC277 /* Megrez */,
|
||||
5BDB7A4228D4824A001AC277 /* Preferences */,
|
||||
5BDB7A4428D4824A001AC277 /* ShiftKeyUpChecker */,
|
||||
5BDB7A4628D4824A001AC277 /* Tekkon */,
|
||||
5BFC63C528D48806004A77B7 /* NSAttributedTextView */,
|
||||
|
@ -796,6 +795,7 @@
|
|||
5BC5E02328DE07860094E427 /* PopupCompositionBuffer */,
|
||||
5BA8C30228DF0360004C5CC4 /* CandidateWindow */,
|
||||
5B5A602F28E81CC50001AE8D /* SwiftUIBackports */,
|
||||
5B5C8ED728FC0EA9002C93A5 /* SSPreferences */,
|
||||
);
|
||||
productName = vChewing;
|
||||
productReference = 6A0D4EA215FC0D2D00ABF4B3 /* vChewing.app */;
|
||||
|
@ -1794,6 +1794,10 @@
|
|||
isa = XCSwiftPackageProductDependency;
|
||||
productName = SwiftUIBackports;
|
||||
};
|
||||
5B5C8ED728FC0EA9002C93A5 /* SSPreferences */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
productName = SSPreferences;
|
||||
};
|
||||
5B963C9C28D5BFB800DCEE88 /* CocoaExtension */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
productName = CocoaExtension;
|
||||
|
@ -1842,10 +1846,6 @@
|
|||
isa = XCSwiftPackageProductDependency;
|
||||
productName = Megrez;
|
||||
};
|
||||
5BDB7A4228D4824A001AC277 /* Preferences */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
productName = Preferences;
|
||||
};
|
||||
5BDB7A4428D4824A001AC277 /* ShiftKeyUpChecker */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
productName = ShiftKeyUpChecker;
|
||||
|
|
Loading…
Reference in New Issue