Skip to content

Commit

Permalink
draft to fix issues in accessibility mode with large text
Browse files Browse the repository at this point in the history
  • Loading branch information
hosy committed Aug 6, 2024
1 parent 99a97cd commit 9567d93
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
19 changes: 15 additions & 4 deletions ownCloud/Bookmarks/Setup/BookmarkSetupStepViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class BookmarkSetupStepViewController: UIViewController, UITextFieldDelegate {
var continueButton: UIButton = ThemeButton(withSelectors: [.filled])
var backButton: UIButton = ThemeCSSButton(withSelectors: [])

var contentContainerView: UIView?
var contentContainerView: UIScrollView?
var contentView: UIView? {
willSet {
if newValue != contentView {
Expand Down Expand Up @@ -110,6 +110,7 @@ class BookmarkSetupStepViewController: UIViewController, UITextFieldDelegate {

override func loadView() {
var views: [UIView] = topViews ?? []
var viewsSub: [UIView] = topViews ?? []

let contentView = UIView()
contentView.cssSelectors = [.step, step.cssSelector]
Expand All @@ -122,7 +123,7 @@ class BookmarkSetupStepViewController: UIViewController, UITextFieldDelegate {
titleLabel?.font = UIFont.preferredFont(forTextStyle: .headline, with: .bold)
titleLabel?.makeLabelWrapText()

views.append(titleLabel!)
viewsSub.append(titleLabel!)
}

if let stepMessage = textOverride(for: "message") ?? stepMessage {
Expand All @@ -132,16 +133,26 @@ class BookmarkSetupStepViewController: UIViewController, UITextFieldDelegate {
messageLabel?.font = UIFont.preferredFont(forTextStyle: .subheadline, with: .regular)
messageLabel?.makeLabelWrapText()

views.append(messageLabel!)
viewsSub.append(messageLabel!)
}

// Content container view
contentContainerView = UIView()
contentContainerView = UIScrollView()
contentContainerView?.backgroundColor = .yellow
contentContainerView?.translatesAutoresizingMaskIntoConstraints = false

if let contentContainerView {
views.append(contentContainerView)
}

let contentViewSub = UIView()
contentViewSub.cssSelectors = [.step, step.cssSelector]

contentViewSub.embedVertically(views: viewsSub, insets: NSDirectionalEdgeInsets(top: 20, leading: 20, bottom: 20, trailing: 20), spacingProvider: { leadingView, trailingView in
return 5
}, centered: false)

contentContainerView?.addSubview(contentViewSub)

// Continue Button
var buttonConfiguration = UIButton.Configuration.borderedProminent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BookmarkSetupStepEnterURLViewController: BookmarkSetupStepViewController {

focusTextFields = [ urlTextField! ]

contentView = urlTextField
//contentView = urlTextField

updateState()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ public class ComposedMessageView: UIView, Themeable {
view.topAnchor.constraint(equalTo: self.topAnchor, constant: (element.insets.top + elementInsets.top))
])
}
constraints.append(contentsOf: [
view.widthAnchor.constraint(equalToConstant: 300)
])

previousElement = element
}
Expand Down

0 comments on commit 9567d93

Please sign in to comment.