Skip to content

Commit

Permalink
Fix diagnostics big font size accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
martenrebane committed Jan 30, 2024
1 parent 33c78a6 commit 4a05f4a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 47 deletions.
34 changes: 28 additions & 6 deletions MoppApp/MoppApp/DiagnosticsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class DiagnosticsViewController: MoppViewController, UIDocumentPickerDelegate {
@IBOutlet weak var centralConfigurationLabel: UILabel!
@IBOutlet weak var updateDateLabel: UILabel!
@IBOutlet weak var lastCheckLabel: UILabel!
@IBOutlet weak var refreshConfigurationLabel: UIButton!
@IBOutlet weak var saveDiagnosticsLabel: UIButton!
@IBOutlet weak var refreshConfigurationLabel: ScaledLabel!
@IBOutlet weak var saveDiagnosticsLabel: ScaledLabel!
@IBOutlet weak var enableOneTimeLoggingLabel: UILabel!
@IBOutlet weak var oneTimeLoggingSwitch: UISwitch!
@IBAction func fileLoggingSwitchChanged(_ sender: Any) {
Expand Down Expand Up @@ -71,7 +71,7 @@ class DiagnosticsViewController: MoppViewController, UIDocumentPickerDelegate {
@IBOutlet weak var updateDate: UILabel!
@IBOutlet weak var lastCheckDate: UILabel!

@IBAction func refreshConfiguration(_ sender: Any) {
@objc func refreshConfiguration() {
DispatchQueue.global(qos: .userInitiated).async {
printLog("Refreshing central configuration")
SettingsConfiguration().loadCentralConfiguration() { error in
Expand All @@ -86,7 +86,7 @@ class DiagnosticsViewController: MoppViewController, UIDocumentPickerDelegate {
}
}

@IBAction func saveDiagnostics(_ sender: Any) {
@objc func saveDiagnostics() {
printLog("Saving diagnostics")
printLog("Formatting diagnostics data")
let diagnosticsText = formatDiagnosticsText()
Expand Down Expand Up @@ -146,9 +146,21 @@ class DiagnosticsViewController: MoppViewController, UIDocumentPickerDelegate {
librariesLabel.text = "libdigidocpp \(libdigidocppVersion)"
tslCacheLabel.text = L(.diagnosticsTslCacheLabel)
centralConfigurationLabel.text = L(.centralConfigurationLabel)
refreshConfigurationLabel.setTitle(L(.refreshConfigurationLabel))
saveDiagnosticsLabel.setTitle(L(.saveDiagnosticsLabel))
refreshConfigurationLabel.text = L(.refreshConfigurationLabel)
saveDiagnosticsLabel.text = L(.saveDiagnosticsLabel)

refreshConfigurationLabel.accessibilityLabel = self.refreshConfigurationLabel.text?.lowercased()
refreshConfigurationLabel.font = .moppMedium
refreshConfigurationLabel.textColor = .systemBlue
refreshConfigurationLabel.isUserInteractionEnabled = true
refreshConfigurationLabel.resetLabelProperties()

saveDiagnosticsLabel.accessibilityLabel = self.saveDiagnosticsLabel.text?.lowercased()
saveDiagnosticsLabel.font = .moppMedium
saveDiagnosticsLabel.textColor = .systemBlue
saveDiagnosticsLabel.isUserInteractionEnabled = true
saveDiagnosticsLabel.resetLabelProperties()

tsls.isAccessibilityElement = false

dismissButton.setTitle(L(.closeButton))
Expand All @@ -158,6 +170,16 @@ class DiagnosticsViewController: MoppViewController, UIDocumentPickerDelegate {

oneTimeLoggingSwitch.accessibilityLabel = enableOneTimeLoggingLabel.text
oneTimeLoggingSwitch.accessibilityUserInputLabels = [L(.voiceControlEnableLogGeneration)]

if self.refreshConfigurationLabel.gestureRecognizers == nil || self.refreshConfigurationLabel.gestureRecognizers?.isEmpty == true {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.refreshConfiguration))
self.refreshConfigurationLabel.addGestureRecognizer(tapGesture)
}

if self.saveDiagnosticsLabel.gestureRecognizers == nil || self.saveDiagnosticsLabel.gestureRecognizers?.isEmpty == true {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.saveDiagnostics))
self.saveDiagnosticsLabel.addGestureRecognizer(tapGesture)
}

if FileLogUtil.isLoggingEnabled() {
saveLogButtonLabel.isHidden = false
Expand Down
Loading

0 comments on commit 4a05f4a

Please sign in to comment.