Skip to content

Commit

Permalink
Fix #4986: Settings screen distorted with biggest accessibility font …
Browse files Browse the repository at this point in the history
…size (#6373)

Co-authored-by: Mykola Aleshchenko <[email protected]>
  • Loading branch information
maleshchenko and Mykola Aleshchenko authored Apr 20, 2020
1 parent 526651e commit 39c8d1c
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions Client/Frontend/Settings/SettingsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -721,11 +721,6 @@ class SettingsTableViewController: ThemedTableViewController {

override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let section = settings[indexPath.section]
// Workaround for calculating the height of default UITableViewCell cells with a subtitle under
// the title text label.
if let setting = section[indexPath.row], setting is BoolSetting && setting.status != nil {
return calculateStatusCellHeightForSetting(setting)
}
if let setting = section[indexPath.row], let height = setting.cellHeight {
return height
}
Expand All @@ -742,18 +737,6 @@ class SettingsTableViewController: ThemedTableViewController {
}
}

fileprivate func calculateStatusCellHeightForSetting(_ setting: Setting) -> CGFloat {
dummyToggleCell.layoutSubviews()

let topBottomMargin: CGFloat = 10
let width = dummyToggleCell.contentView.frame.width - 2 * dummyToggleCell.separatorInset.left

return
heightForLabel(dummyToggleCell.textLabel!, width: width, text: setting.title?.string) +
heightForLabel(dummyToggleCell.detailTextLabel!, width: width, text: setting.status?.string) +
2 * topBottomMargin
}

fileprivate func heightForLabel(_ label: UILabel, width: CGFloat, text: String?) -> CGFloat {
guard let text = text else { return 0 }

Expand Down

0 comments on commit 39c8d1c

Please sign in to comment.