From 83ecd3022400304efa4136d65b5d167ac81e55bb Mon Sep 17 00:00:00 2001 From: ensan-hcl Date: Fri, 10 Nov 2023 23:36:23 +0900 Subject: [PATCH] clean up --- MainApp/Setting/SettingTab.swift | 148 ++++++++++++++----------------- 1 file changed, 69 insertions(+), 79 deletions(-) diff --git a/MainApp/Setting/SettingTab.swift b/MainApp/Setting/SettingTab.swift index edc82e30..f196b730 100644 --- a/MainApp/Setting/SettingTab.swift +++ b/MainApp/Setting/SettingTab.swift @@ -40,101 +40,90 @@ struct SettingTabView: View { var body: some View { NavigationView { Form { - Group { - Section(header: Text("キーボードの種類")) { - NavigationLink("キーボードの種類を設定する", destination: KeyboardLayoutTypeDetailsView()) - } + Section("キーボードの種類") { + NavigationLink("キーボードの種類を設定する", destination: KeyboardLayoutTypeDetailsView()) } - Section(header: Text("ライブ変換")) { + Section("ライブ変換") { BoolSettingView(.liveConversion) NavigationLink("詳しい設定", destination: LiveConversionSettingView()) } - - Group { - Section("カスタムキー") { - CustomKeysSettingView() - if !self.isCustard(appStates.japaneseLayout) || !self.isCustard(appStates.englishLayout) { - BoolSettingView(.useNextCandidateKey) - } - if self.canQwertyLayout(appStates.englishLayout) { - BoolSettingView(.useShiftKey) - } - if !SemiStaticStates.shared.needsInputModeSwitchKey, self.canFlickLayout(appStates.japaneseLayout) { - BoolSettingView(.enablePasteButton) - } - } - Section(header: Text("バー")) { - BoolSettingView(.useReflectStyleCursorBar) - BoolSettingView(.displayTabBarButton) - BoolSettingView(.enableClipboardHistoryManagerTab) - if SemiStaticStates.shared.hasFullAccess { - NavigationLink("「ペーストを許可」のダイアログについて", destination: PasteFromOtherAppsPermissionTipsView()) - } - NavigationLink("タブバーを編集", destination: EditingTabBarView(manager: $appStates.custardManager)) + Section("カスタムキー") { + CustomKeysSettingView() + if !self.isCustard(appStates.japaneseLayout) || !self.isCustard(appStates.englishLayout) { + BoolSettingView(.useNextCandidateKey) } - // デバイスが触覚フィードバックをサポートしている場合のみ表示する - if SemiStaticStates.shared.hapticsAvailable { - Section(header: Text("サウンドと振動")) { - BoolSettingView(.enableKeySound) - BoolSettingView(.enableKeyHaptics) - } - } else { - Section(header: Text("サウンド")) { - BoolSettingView(.enableKeySound) - } + if self.canQwertyLayout(appStates.englishLayout) { + BoolSettingView(.useShiftKey) } - Section(header: Text("表示")) { - KeyboardHeightSettingView(.keyboardHeightScale) - FontSizeSettingView(.keyViewFontSize, .key, availableValueRange: 15 ... 28) - FontSizeSettingView(.resultViewFontSize, .result, availableValueRange: 12...24) - } - Section(header: Text("操作性")) { - BoolSettingView(.hideResetButtonInOneHandedMode) - if self.canFlickLayout(appStates.japaneseLayout) { - FlickSensitivitySettingView(.flickSensitivity) - } + if !SemiStaticStates.shared.needsInputModeSwitchKey, self.canFlickLayout(appStates.japaneseLayout) { + BoolSettingView(.enablePasteButton) } } - Group { - Section(header: Text("変換")) { - BoolSettingView(.englishCandidate) - BoolSettingView(.halfKanaCandidate) - BoolSettingView(.fullRomanCandidate) - BoolSettingView(.typographyLetter) - BoolSettingView(.unicodeCandidate) - MarkedTextSettingView(.markedTextSetting) - ContactImportSettingView() - NavigationLink("絵文字と顔文字", destination: AdditionalDictManageView()) - } - - Section(header: Text("言語")) { - PreferredLanguageSettingView() + Section("バー") { + BoolSettingView(.useReflectStyleCursorBar) + BoolSettingView(.displayTabBarButton) + BoolSettingView(.enableClipboardHistoryManagerTab) + if SemiStaticStates.shared.hasFullAccess { + NavigationLink("「ペーストを許可」のダイアログについて", destination: PasteFromOtherAppsPermissionTipsView()) } - - Section(header: Text("ユーザ辞書")) { - BoolSettingView(.useOSUserDict) - NavigationLink("azooKeyユーザ辞書", destination: AzooKeyUserDictionaryView()) + NavigationLink("タブバーを編集", destination: EditingTabBarView(manager: $appStates.custardManager)) + } + // デバイスが触覚フィードバックをサポートしている場合のみ表示する + if SemiStaticStates.shared.hapticsAvailable { + Section("サウンドと振動") { + BoolSettingView(.enableKeySound) + BoolSettingView(.enableKeyHaptics) } - - Section(header: Text("テンプレート")) { - NavigationLink("テンプレートの管理", destination: TemplateListView()) - } - - Section(header: Text("学習機能")) { - LearningTypeSettingView() - MemoryResetSettingItemView() + } else { + Section("サウンド") { + BoolSettingView(.enableKeySound) } + } + Section("表示") { + KeyboardHeightSettingView(.keyboardHeightScale) + FontSizeSettingView(.keyViewFontSize, .key, availableValueRange: 15 ... 28) + FontSizeSettingView(.resultViewFontSize, .result, availableValueRange: 12...24) + } - Section(header: Text("カスタムタブ")) { - NavigationLink("カスタムタブの管理", destination: ManageCustardView(manager: $appStates.custardManager)) + Section("操作性") { + BoolSettingView(.hideResetButtonInOneHandedMode) + if self.canFlickLayout(appStates.japaneseLayout) { + FlickSensitivitySettingView(.flickSensitivity) } } - Section(header: Text("オープンソースソフトウェア")) { + Section("変換") { + BoolSettingView(.englishCandidate) + BoolSettingView(.halfKanaCandidate) + BoolSettingView(.fullRomanCandidate) + BoolSettingView(.typographyLetter) + BoolSettingView(.unicodeCandidate) + MarkedTextSettingView(.markedTextSetting) + ContactImportSettingView() + NavigationLink("絵文字と顔文字", destination: AdditionalDictManageView()) + } + Section("言語") { + PreferredLanguageSettingView() + } + Section("ユーザ辞書") { + BoolSettingView(.useOSUserDict) + NavigationLink("azooKeyユーザ辞書", destination: AzooKeyUserDictionaryView()) + } + Section("テンプレート") { + NavigationLink("テンプレートの管理", destination: TemplateListView()) + } + Section("学習機能") { + LearningTypeSettingView() + MemoryResetSettingItemView() + } + Section("カスタムタブ") { + NavigationLink("カスタムタブの管理", destination: ManageCustardView(manager: $appStates.custardManager)) + } + Section("オープンソースソフトウェア") { Text("azooKeyはオープンソースソフトウェアであり、GitHubでソースコードを公開しています。") FallbackLink("View azooKey on GitHub", destination: URL(string: "https://github.com/ensan-hcl/azooKey")!) NavigationLink("Acknowledgements", destination: OpenSourceSoftwaresLicenseView()) } - Section(header: Text("このアプリについて")) { + Section("このアプリについて") { NavigationLink("お問い合わせ", destination: ContactView()) FallbackLink("プライバシーポリシー", destination: URL(string: "https://azookey.netlify.app/PrivacyPolicy")!) .foregroundStyle(.primary) @@ -149,11 +138,12 @@ struct SettingTabView: View { HStack { Text("バージョン") Spacer() - Text(SharedStore.currentAppVersion?.description ?? "取得中です") + Text(verbatim: SharedStore.currentAppVersion?.description ?? "取得中です") } } } - .navigationBarTitle(Text("設定"), displayMode: .large) + .navigationTitle("設定") + .navigationBarTitleDisplayMode(.large) .onAppear { if appStates.requestReviewManager.shouldTryRequestReview, appStates.requestReviewManager.shouldRequestReview() { if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene {