PrefUI // Icon update & Add DangerZone page.

This commit is contained in:
ShikiSuen 2022-08-12 08:55:37 +08:00
parent 6fcf4356ea
commit 50593ff1f0
31 changed files with 182 additions and 0 deletions

View File

@ -122,6 +122,7 @@
"Cursor Selection:" = "Cursor Selection:"; "Cursor Selection:" = "Cursor Selection:";
"Dachen (Microsoft Standard / Wang / 01, etc.)" = "Dachen (Microsoft Standard / Wang / 01, etc.)"; "Dachen (Microsoft Standard / Wang / 01, etc.)" = "Dachen (Microsoft Standard / Wang / 01, etc.)";
"Dachen 26 (libChewing)" = "Dachen 26 (libChewing)"; "Dachen 26 (libChewing)" = "Dachen 26 (libChewing)";
"DangerZone" = "DangerZone";
"Debug Mode" = "Debug Mode"; "Debug Mode" = "Debug Mode";
"Dictionary" = "Dictionary"; "Dictionary" = "Dictionary";
"Directly commit lowercased letters" = "Directly commit lowercased letters"; "Directly commit lowercased letters" = "Directly commit lowercased letters";
@ -173,4 +174,5 @@
"Universal Pinyin with Numeral Intonation" = "Universal Pinyin with Numeral Intonation"; "Universal Pinyin with Numeral Intonation" = "Universal Pinyin with Numeral Intonation";
"Use ESC key to clear the entire input buffer" = "Use ESC key to clear the entire input buffer"; "Use ESC key to clear the entire input buffer" = "Use ESC key to clear the entire input buffer";
"Vertical" = "Vertical"; "Vertical" = "Vertical";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "Warning: This page is for testing future features. \nFeatures listed here may not work as expected.";
"Yale Pinyin with Numeral Intonation" = "Yale Pinyin with Numeral Intonation"; "Yale Pinyin with Numeral Intonation" = "Yale Pinyin with Numeral Intonation";

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "DangerZone.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "DangerZone@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "Dictionary.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Dictionary@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "Experiences.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Experiences@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "General.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "General@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "Keyboard.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Keyboard@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -122,6 +122,7 @@
"Cursor Selection:" = "Cursor Selection:"; "Cursor Selection:" = "Cursor Selection:";
"Dachen (Microsoft Standard / Wang / 01, etc.)" = "Dachen (Microsoft Standard / Wang / 01, etc.)"; "Dachen (Microsoft Standard / Wang / 01, etc.)" = "Dachen (Microsoft Standard / Wang / 01, etc.)";
"Dachen 26 (libChewing)" = "Dachen 26 (libChewing)"; "Dachen 26 (libChewing)" = "Dachen 26 (libChewing)";
"DangerZone" = "DangerZone";
"Debug Mode" = "Debug Mode"; "Debug Mode" = "Debug Mode";
"Dictionary" = "Dictionary"; "Dictionary" = "Dictionary";
"Directly commit lowercased letters" = "Directly commit lowercased letters"; "Directly commit lowercased letters" = "Directly commit lowercased letters";
@ -173,4 +174,5 @@
"Universal Pinyin with Numeral Intonation" = "Universal Pinyin with Numeral Intonation"; "Universal Pinyin with Numeral Intonation" = "Universal Pinyin with Numeral Intonation";
"Use ESC key to clear the entire input buffer" = "Use ESC key to clear the entire input buffer"; "Use ESC key to clear the entire input buffer" = "Use ESC key to clear the entire input buffer";
"Vertical" = "Vertical"; "Vertical" = "Vertical";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "Warning: This page is for testing future features. \nFeatures listed here may not work as expected.";
"Yale Pinyin with Numeral Intonation" = "Yale Pinyin with Numeral Intonation"; "Yale Pinyin with Numeral Intonation" = "Yale Pinyin with Numeral Intonation";

View File

@ -122,6 +122,7 @@
"Cursor Selection:" = "カーソル候補呼出:"; "Cursor Selection:" = "カーソル候補呼出:";
"Dachen (Microsoft Standard / Wang / 01, etc.)" = "大千配列 (Microsoft 標準・王安・零壹など)"; "Dachen (Microsoft Standard / Wang / 01, etc.)" = "大千配列 (Microsoft 標準・王安・零壹など)";
"Dachen 26 (libChewing)" = "酷音大千 26 キー配列"; "Dachen 26 (libChewing)" = "酷音大千 26 キー配列";
"DangerZone" = "開発道場";
"Debug Mode" = "欠陥辿着モード"; "Debug Mode" = "欠陥辿着モード";
"Dictionary" = "辞書設定"; "Dictionary" = "辞書設定";
"Directly commit lowercased letters" = "ローマ字(小文字)を直接出力"; "Directly commit lowercased letters" = "ローマ字(小文字)を直接出力";
@ -173,4 +174,5 @@
"Universal Pinyin with Numeral Intonation" = "汎用弁音 (ローマ字+数字音調)"; "Universal Pinyin with Numeral Intonation" = "汎用弁音 (ローマ字+数字音調)";
"Use ESC key to clear the entire input buffer" = "ESC キーで入力緩衝列を消す"; "Use ESC key to clear the entire input buffer" = "ESC キーで入力緩衝列を消す";
"Vertical" = "縦型陳列"; "Vertical" = "縦型陳列";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "警告:これからの新機能テストのために作ったページですから、\nここで陳列されている諸機能は予想通り動けるだと思わないでください。";
"Yale Pinyin with Numeral Intonation" = "イェール弁音 (ローマ字+数字音調)"; "Yale Pinyin with Numeral Intonation" = "イェール弁音 (ローマ字+数字音調)";

View File

@ -122,6 +122,7 @@
"Cursor Selection:" = "选字游标:"; "Cursor Selection:" = "选字游标:";
"Dachen (Microsoft Standard / Wang / 01, etc.)" = "大千排列 (微软标准/王安/零壹/仲鼎/国乔)"; "Dachen (Microsoft Standard / Wang / 01, etc.)" = "大千排列 (微软标准/王安/零壹/仲鼎/国乔)";
"Dachen 26 (libChewing)" = "酷音大千二十六键排列"; "Dachen 26 (libChewing)" = "酷音大千二十六键排列";
"DangerZone" = "禁区";
"Debug Mode" = "侦错模式"; "Debug Mode" = "侦错模式";
"Dictionary" = "辞典"; "Dictionary" = "辞典";
"Directly commit lowercased letters" = "直接递交小写字母"; "Directly commit lowercased letters" = "直接递交小写字母";
@ -175,4 +176,5 @@
"Universal Pinyin with Numeral Intonation" = "通用拼音+数字标调"; "Universal Pinyin with Numeral Intonation" = "通用拼音+数字标调";
"Use ESC key to clear the entire input buffer" = "敲 ESC 键以清空整个组字缓冲区"; "Use ESC key to clear the entire input buffer" = "敲 ESC 键以清空整个组字缓冲区";
"Vertical" = "纵向布局"; "Vertical" = "纵向布局";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "警告:该页面仅作未来功能测试所用。\n在此列出的功能并非处于完全可用之状态。";
"Yale Pinyin with Numeral Intonation" = "耶鲁拼音+数字标调"; "Yale Pinyin with Numeral Intonation" = "耶鲁拼音+数字标调";

View File

@ -122,6 +122,7 @@
"Cursor Selection:" = "選字游標:"; "Cursor Selection:" = "選字游標:";
"Dachen (Microsoft Standard / Wang / 01, etc.)" = "大千排列 (微軟標準/王安/零壹/仲鼎/國喬)"; "Dachen (Microsoft Standard / Wang / 01, etc.)" = "大千排列 (微軟標準/王安/零壹/仲鼎/國喬)";
"Dachen 26 (libChewing)" = "酷音大千二十六鍵排列"; "Dachen 26 (libChewing)" = "酷音大千二十六鍵排列";
"DangerZone" = "禁區";
"Debug Mode" = "偵錯模式"; "Debug Mode" = "偵錯模式";
"Dictionary" = "辭典"; "Dictionary" = "辭典";
"Directly commit lowercased letters" = "直接遞交小寫字母"; "Directly commit lowercased letters" = "直接遞交小寫字母";
@ -173,4 +174,5 @@
"Universal Pinyin with Numeral Intonation" = "通用拼音+數字標調"; "Universal Pinyin with Numeral Intonation" = "通用拼音+數字標調";
"Use ESC key to clear the entire input buffer" = "敲 ESC 鍵以清空整個組字緩衝區"; "Use ESC key to clear the entire input buffer" = "敲 ESC 鍵以清空整個組字緩衝區";
"Vertical" = "縱向佈局"; "Vertical" = "縱向佈局";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "警告:該頁面僅作未來功能測試所用。\n在此列出的功能並非處於完全可用之狀態。";
"Yale Pinyin with Numeral Intonation" = "耶魯拼音+數字標調"; "Yale Pinyin with Numeral Intonation" = "耶魯拼音+數字標調";

View File

@ -15,6 +15,7 @@ class ctlPrefUI {
private(set) var tabImageExperiences: NSImage! = NSImage(named: "PrefToolbar-Experiences") private(set) var tabImageExperiences: NSImage! = NSImage(named: "PrefToolbar-Experiences")
private(set) var tabImageDictionary: NSImage! = NSImage(named: "PrefToolbar-Dictionary") private(set) var tabImageDictionary: NSImage! = NSImage(named: "PrefToolbar-Dictionary")
private(set) var tabImageKeyboard: NSImage! = NSImage(named: "PrefToolbar-Keyboard") private(set) var tabImageKeyboard: NSImage! = NSImage(named: "PrefToolbar-Keyboard")
private(set) var tabImageDangerZone: NSImage! = NSImage(named: "PrefToolbar-DangerZone")
init() { init() {
if #available(macOS 11.0, *) { if #available(macOS 11.0, *) {
@ -30,6 +31,9 @@ class ctlPrefUI {
tabImageKeyboard = NSImage( tabImageKeyboard = NSImage(
systemSymbolName: "keyboard.macwindow", accessibilityDescription: "Keyboard Preferences" systemSymbolName: "keyboard.macwindow", accessibilityDescription: "Keyboard Preferences"
) )
tabImageDangerZone = NSImage(
systemSymbolName: "hand.raised.circle", accessibilityDescription: "DangerZone Preferences"
)
} }
} }
@ -63,6 +67,13 @@ class ctlPrefUI {
) { ) {
suiPrefPaneKeyboard() suiPrefPaneKeyboard()
}, },
Preferences.Pane(
identifier: Preferences.PaneIdentifier(rawValue: "DangerZone"),
title: NSLocalizedString("DangerZone", comment: ""),
toolbarIcon: tabImageDangerZone
) {
suiPrefPaneDangerZone()
},
], ],
style: .toolbarItems style: .toolbarItems
) )

View File

@ -0,0 +1,47 @@
// Copyright (c) 2021 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
import SwiftUI
@available(macOS 10.15, *)
struct suiPrefPaneDangerZone: View {
@State private var selUseIMKCandidateWindow: Bool = UserDefaults.standard.bool(
forKey: UserDef.kUseIMKCandidateWindow.rawValue)
private let contentWidth: Double = {
switch mgrPrefs.appleLanguages[0] {
case "ja":
return 520
default:
if mgrPrefs.appleLanguages[0].contains("zh-Han") {
return 480
} else {
return 550
}
}
}()
var body: some View {
Preferences.Container(contentWidth: contentWidth) {
Preferences.Section(title: "", bottomDivider: true) {
Text(
LocalizedStringKey(
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected.")
)
.fixedSize(horizontal: false, vertical: true)
Divider()
}
}
}
}
@available(macOS 11.0, *)
struct suiPrefPaneDangerZone_Previews: PreviewProvider {
static var previews: some View {
suiPrefPaneDangerZone()
}
}

View File

@ -40,6 +40,7 @@
5B62A35327AE89C400A19448 /* InputSourceHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B62A33127AE792F00A19448 /* InputSourceHelper.swift */; }; 5B62A35327AE89C400A19448 /* InputSourceHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B62A33127AE792F00A19448 /* InputSourceHelper.swift */; };
5B73FB5E27B2BE1300E9BF49 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5B73FB6027B2BE1300E9BF49 /* InfoPlist.strings */; }; 5B73FB5E27B2BE1300E9BF49 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5B73FB6027B2BE1300E9BF49 /* InfoPlist.strings */; };
5B782EC4280C243C007276DE /* KeyHandler_HandleCandidate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B782EC3280C243C007276DE /* KeyHandler_HandleCandidate.swift */; }; 5B782EC4280C243C007276DE /* KeyHandler_HandleCandidate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B782EC3280C243C007276DE /* KeyHandler_HandleCandidate.swift */; };
5B78EE0D28A562B4009456C1 /* suiPrefPaneDangerZone.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B78EE0C28A562B4009456C1 /* suiPrefPaneDangerZone.swift */; };
5B7BC4B027AFFBE800F66C24 /* frmPrefWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B7BC4AE27AFFBE800F66C24 /* frmPrefWindow.xib */; }; 5B7BC4B027AFFBE800F66C24 /* frmPrefWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5B7BC4AE27AFFBE800F66C24 /* frmPrefWindow.xib */; };
5B7F225D2808501000DDD3CB /* KeyHandler_HandleInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B7F225C2808501000DDD3CB /* KeyHandler_HandleInput.swift */; }; 5B7F225D2808501000DDD3CB /* KeyHandler_HandleInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B7F225C2808501000DDD3CB /* KeyHandler_HandleInput.swift */; };
5B84579E2871AD2200C93B01 /* convdict.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5B84579C2871AD2200C93B01 /* convdict.plist */; }; 5B84579E2871AD2200C93B01 /* convdict.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5B84579C2871AD2200C93B01 /* convdict.plist */; };
@ -246,6 +247,7 @@
5B73FB5427B2BD6900E9BF49 /* PhraseEditor-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "PhraseEditor-Info.plist"; path = "UserPhraseEditor/PhraseEditor-Info.plist"; sourceTree = SOURCE_ROOT; }; 5B73FB5427B2BD6900E9BF49 /* PhraseEditor-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "PhraseEditor-Info.plist"; path = "UserPhraseEditor/PhraseEditor-Info.plist"; sourceTree = SOURCE_ROOT; };
5B73FB5F27B2BE1300E9BF49 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 5B73FB5F27B2BE1300E9BF49 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
5B782EC3280C243C007276DE /* KeyHandler_HandleCandidate.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = KeyHandler_HandleCandidate.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; }; 5B782EC3280C243C007276DE /* KeyHandler_HandleCandidate.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = KeyHandler_HandleCandidate.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
5B78EE0C28A562B4009456C1 /* suiPrefPaneDangerZone.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = suiPrefPaneDangerZone.swift; sourceTree = "<group>"; };
5B7BC4AF27AFFBE800F66C24 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/frmPrefWindow.xib; sourceTree = "<group>"; }; 5B7BC4AF27AFFBE800F66C24 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/frmPrefWindow.xib; sourceTree = "<group>"; };
5B7BC4B227AFFC0B00F66C24 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/frmPrefWindow.strings; sourceTree = "<group>"; }; 5B7BC4B227AFFC0B00F66C24 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/frmPrefWindow.strings; sourceTree = "<group>"; };
5B7F225C2808501000DDD3CB /* KeyHandler_HandleInput.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = KeyHandler_HandleInput.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; }; 5B7F225C2808501000DDD3CB /* KeyHandler_HandleInput.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = KeyHandler_HandleInput.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
@ -652,6 +654,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5BA9FD0C27FEDB6B002DE248 /* ctlPrefUI.swift */, 5BA9FD0C27FEDB6B002DE248 /* ctlPrefUI.swift */,
5B78EE0C28A562B4009456C1 /* suiPrefPaneDangerZone.swift */,
5BA9FD0E27FEDB6B002DE248 /* suiPrefPaneDictionary.swift */, 5BA9FD0E27FEDB6B002DE248 /* suiPrefPaneDictionary.swift */,
5BA9FD0D27FEDB6B002DE248 /* suiPrefPaneExperience.swift */, 5BA9FD0D27FEDB6B002DE248 /* suiPrefPaneExperience.swift */,
5BA9FD0A27FEDB6B002DE248 /* suiPrefPaneGeneral.swift */, 5BA9FD0A27FEDB6B002DE248 /* suiPrefPaneGeneral.swift */,
@ -1184,6 +1187,7 @@
5B3A87BC28597CDB0090E163 /* LMSymbolNode.swift in Sources */, 5B3A87BC28597CDB0090E163 /* LMSymbolNode.swift in Sources */,
5BA9FD4327FEF3C8002DE248 /* Preferences.swift in Sources */, 5BA9FD4327FEF3C8002DE248 /* Preferences.swift in Sources */,
5BA9FD4427FEF3C8002DE248 /* SegmentedControlStyleViewController.swift in Sources */, 5BA9FD4427FEF3C8002DE248 /* SegmentedControlStyleViewController.swift in Sources */,
5B78EE0D28A562B4009456C1 /* suiPrefPaneDangerZone.swift in Sources */,
D47F7DCE278BFB57002F9DD7 /* ctlPrefWindow.swift in Sources */, D47F7DCE278BFB57002F9DD7 /* ctlPrefWindow.swift in Sources */,
5BD0113D2818543900609769 /* KeyHandler_Core.swift in Sources */, 5BD0113D2818543900609769 /* KeyHandler_Core.swift in Sources */,
5B2170E4289FACAD00BE7304 /* 2_Walker.swift in Sources */, 5B2170E4289FACAD00BE7304 /* 2_Walker.swift in Sources */,