Customized user scripts/stylesheets: iPhone fixes
This commit is contained in:
@@ -120,7 +120,7 @@ class BrowserView: UIView
|
|||||||
// Compact: toolbar is at the bottom
|
// Compact: toolbar is at the bottom
|
||||||
if traitCollection.horizontalSizeClass == .compact {
|
if traitCollection.horizontalSizeClass == .compact {
|
||||||
var bottomOffset: CGFloat = 0.0
|
var bottomOffset: CGFloat = 0.0
|
||||||
if keyboardLayoutOffset == 0 {
|
if keyboardLayoutOffset < CGFloat.leastNonzeroMagnitude {
|
||||||
toolbarSize.height += safeAreaInsets.bottom
|
toolbarSize.height += safeAreaInsets.bottom
|
||||||
} else if toolbarView.urlBar?.textField.isFirstResponder ?? false {
|
} else if toolbarView.urlBar?.textField.isFirstResponder ?? false {
|
||||||
bottomOffset = keyboardLayoutOffset
|
bottomOffset = keyboardLayoutOffset
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ class CodeEditorSettingsView: UIView
|
|||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
|
self.backgroundColor = UIColor.systemBackground
|
||||||
|
|
||||||
|
textView.backgroundColor = UIColor.secondarySystemBackground
|
||||||
textView.font = .monospacedSystemFont(ofSize: 12.0, weight: .regular)
|
textView.font = .monospacedSystemFont(ofSize: 12.0, weight: .regular)
|
||||||
textView.autocorrectionType = .no
|
textView.autocorrectionType = .no
|
||||||
textView.autocapitalizationType = .none
|
textView.autocapitalizationType = .none
|
||||||
@@ -66,6 +69,11 @@ class CodeEditorSettingsViewController: UIViewController, UITextViewDelegate
|
|||||||
settingsView.textView.text = Settings.shared[keyPath: settingsKeypath]
|
settingsView.textView.text = Settings.shared[keyPath: settingsKeypath]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func viewWillDisappear(_ animated: Bool) {
|
||||||
|
super.viewWillDisappear(animated)
|
||||||
|
saveContents()
|
||||||
|
}
|
||||||
|
|
||||||
private func saveContents() {
|
private func saveContents() {
|
||||||
Settings.shared[keyPath: settingsKeypath] = settingsView.textView.text!
|
Settings.shared[keyPath: settingsKeypath] = settingsView.textView.text!
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import MachO
|
|
||||||
|
|
||||||
class RedirectRulesSettingsViewController: UICollectionViewController
|
class RedirectRulesSettingsViewController: UICollectionViewController
|
||||||
{
|
{
|
||||||
@@ -52,15 +51,17 @@ class RedirectRulesSettingsViewController: UICollectionViewController
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
let config = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
|
let config = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
|
||||||
let layout = UICollectionViewCompositionalLayout { section, layoutEnvironment in
|
|
||||||
let listSection = NSCollectionLayoutSection.list(using: config, layoutEnvironment: layoutEnvironment)
|
|
||||||
|
|
||||||
#if targetEnvironment(macCatalyst)
|
#if targetEnvironment(macCatalyst)
|
||||||
|
let layout = UICollectionViewCompositionalLayout { section, layoutEnvironment in
|
||||||
|
let listSection = NSCollectionLayoutSection.list(using: config, layoutEnvironment: layoutEnvironment)
|
||||||
listSection.contentInsets = NSDirectionalEdgeInsets(top: 24.0, leading: 164.0, bottom: 24.0, trailing: 164.0)
|
listSection.contentInsets = NSDirectionalEdgeInsets(top: 24.0, leading: 164.0, bottom: 24.0, trailing: 164.0)
|
||||||
#endif
|
|
||||||
|
|
||||||
return listSection
|
return listSection
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
let layout = UICollectionViewCompositionalLayout.list(using: config)
|
||||||
|
#endif
|
||||||
|
|
||||||
super.init(collectionViewLayout: layout)
|
super.init(collectionViewLayout: layout)
|
||||||
|
|
||||||
|
|||||||
@@ -49,18 +49,18 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>UIWindowSceneSessionRoleApplication</key>
|
<key>UIWindowSceneSessionRoleApplication</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
|
||||||
<key>UISceneDelegateClassName</key>
|
|
||||||
<string>$(PRODUCT_MODULE_NAME).SettingsSceneDelegate</string>
|
|
||||||
<key>UISceneConfigurationName</key>
|
|
||||||
<string>Settings</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
<dict>
|
||||||
<key>UISceneConfigurationName</key>
|
<key>UISceneConfigurationName</key>
|
||||||
<string>Browser</string>
|
<string>Browser</string>
|
||||||
<key>UISceneDelegateClassName</key>
|
<key>UISceneDelegateClassName</key>
|
||||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>UISceneDelegateClassName</key>
|
||||||
|
<string>$(PRODUCT_MODULE_NAME).SettingsSceneDelegate</string>
|
||||||
|
<key>UISceneConfigurationName</key>
|
||||||
|
<string>Settings</string>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
Reference in New Issue
Block a user