Browse Source

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
fa50b45b68

+ 4 - 0
Nextcloud.xcodeproj/project.pbxproj

@@ -147,6 +147,7 @@
 		F719D9E2288D396100762E33 /* NCColorPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F719D9E1288D396100762E33 /* NCColorPicker.swift */; };
 		F71CD6CA2930D7B1006C95C1 /* NCApplicationHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71CD6C92930D7B1006C95C1 /* NCApplicationHandle.swift */; };
 		F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7226EDB1EE4089300EBECB1 /* Main.storyboard */; };
+		F7237DD1295463E700A9D8B7 /* NCBrandFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7237DD0295463E700A9D8B7 /* NCBrandFont.swift */; };
 		F723985C253C95CE00257F49 /* NCViewerRichdocument.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F723985B253C95CE00257F49 /* NCViewerRichdocument.storyboard */; };
 		F7239871253D86B600257F49 /* NCEmptyDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7239870253D86B600257F49 /* NCEmptyDataSet.swift */; };
 		F7239877253D86D300257F49 /* NCEmptyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7239876253D86D300257F49 /* NCEmptyView.xib */; };
@@ -774,6 +775,7 @@
 		F719D9E1288D396100762E33 /* NCColorPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCColorPicker.swift; sourceTree = "<group>"; };
 		F71CD6C92930D7B1006C95C1 /* NCApplicationHandle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCApplicationHandle.swift; sourceTree = "<group>"; };
 		F7226EDB1EE4089300EBECB1 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
+		F7237DD0295463E700A9D8B7 /* NCBrandFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCBrandFont.swift; sourceTree = "<group>"; };
 		F723985B253C95CE00257F49 /* NCViewerRichdocument.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerRichdocument.storyboard; sourceTree = "<group>"; };
 		F7239870253D86B600257F49 /* NCEmptyDataSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEmptyDataSet.swift; sourceTree = "<group>"; };
 		F7239876253D86D300257F49 /* NCEmptyView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCEmptyView.xib; sourceTree = "<group>"; };
@@ -1930,6 +1932,7 @@
 				F70F96AF2874394B006C8379 /* Nextcloud-Bridging-Header.h */,
 				F73CB5771ED46807005F2A5A /* NCBridgeSwift.h */,
 				F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */,
+				F7237DD0295463E700A9D8B7 /* NCBrandFont.swift */,
 			);
 			path = Brand;
 			sourceTree = "<group>";
@@ -3075,6 +3078,7 @@
 				F76673ED22C901F6007ED366 /* FileProviderDomain.swift in Sources */,
 				F7A321AD1E9E6AD50069AD1B /* CCAdvanced.m in Sources */,
 				F77B0E4F1D118A16002130FE /* CCManageAutoUpload.m in Sources */,
+				F7237DD1295463E700A9D8B7 /* NCBrandFont.swift in Sources */,
 				F7BAADC81ED5A87C00B7EAD4 /* NCDatabase.swift in Sources */,
 				F75C0C4823D1FAE300163CC8 /* NCRichWorkspaceCommon.swift in Sources */,
 				F78ACD4A21903F850088454D /* NCTrashListCell+NCTrashCellProtocol.swift in Sources */,

+ 34 - 0
iOSClient/Brand/NCBrandFont.swift

@@ -0,0 +1,34 @@
+//
+//  NCBrandFont.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 22/12/22.
+//  Copyright © 2022 Marino Faggiana. All rights reserved.
+//
+//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import Foundation
+import SwiftUI
+
+class NCBrandFont: NSObject {
+    static let shared: NCBrandFont = {
+        let instance = NCBrandFont()
+        return instance
+    }()
+
+    var settings: Font = .subheadline
+}

+ 13 - 4
iOSClient/Settings/NCManageE2EE.swift

@@ -170,6 +170,7 @@ struct NCViewE2EE: View {
                         Section(header: SectionView(height: 10), footer:Text(manageE2EE.statusOfService + "\n" + "End-to-End Encription " + versionE2EE)) {
                             Label {
                                 Text(NSLocalizedString("_e2e_settings_activated_", comment: ""))
+                                    .font(NCBrandFont.shared.settings)
                             } icon: {
                                 Image(systemName: "checkmark.circle.fill")
                                     .resizable()
@@ -180,7 +181,9 @@ struct NCViewE2EE: View {
                         }
 
                         Label {
-                            Text(NSLocalizedString("_e2e_settings_read_passphrase_", comment: "")).onTapGesture {
+                            Text(NSLocalizedString("_e2e_settings_read_passphrase_", comment: ""))
+                                .font(NCBrandFont.shared.settings)
+                                .onTapGesture {
                                 if CCUtility.getPasscode().isEmpty {
                                     NCContentPresenter.shared.showInfo(error: NKError(errorCode: 0, errorDescription: "_e2e_settings_lock_not_active_"))
                                 } else {
@@ -196,7 +199,9 @@ struct NCViewE2EE: View {
                         }
 
                         Label {
-                            Text(NSLocalizedString("_e2e_settings_remove_", comment: "")).onTapGesture {
+                            Text(NSLocalizedString("_e2e_settings_remove_", comment: ""))
+                                .font(NCBrandFont.shared.settings)
+                                .onTapGesture {
                                 if CCUtility.getPasscode().isEmpty {
                                     NCContentPresenter.shared.showInfo(error: NKError(errorCode: 0, errorDescription: "_e2e_settings_lock_not_active_"))
                                 } else {
@@ -277,7 +282,9 @@ struct DeleteCerificateSection: View {
         Section(header: Text("Delete Server keys"), footer: Text("Available only in debug")) {
 
             Label {
-                Text("Delete certificate").onTapGesture {
+                Text("Delete certificate")
+                    .font(NCBrandFont.shared.settings)
+                    .onTapGesture {
                     NextcloudKit.shared.deleteE2EECertificate { account, error in
                         if error == .success {
                             NCContentPresenter.shared.messageNotification("E2E delete certificate", error: error, delay: NCGlobal.shared.dismissAfterSecond, type: .success)
@@ -295,7 +302,9 @@ struct DeleteCerificateSection: View {
             }
 
             Label {
-                Text("Delete PrivateKey").onTapGesture {
+                Text("Delete PrivateKey")
+                    .font(NCBrandFont.shared.settings)
+                    .onTapGesture {
                     NextcloudKit.shared.deleteE2EEPrivateKey { account, error in
                         if error == .success {
                             NCContentPresenter.shared.messageNotification("E2E delete privateKey", error: error, delay: NCGlobal.shared.dismissAfterSecond, type: .success)