Compare commits
No commits in common. "bf6dfab1218205d70cc311d6167197cd4cfba1f7" and "06f761bf56b188458b3b05f93abd602e7493f373" have entirely different histories.
bf6dfab121
...
06f761bf56
|
@ -49,9 +49,7 @@ class AttachmentRowController: ViewController {
|
||||||
|
|
||||||
private func removeAttachment() {
|
private func removeAttachment() {
|
||||||
withAnimation {
|
withAnimation {
|
||||||
var newAttachments = parent.draft.draftAttachments
|
parent.draft.attachments.remove(attachment)
|
||||||
newAttachments.removeAll(where: { $0.id == attachment.id })
|
|
||||||
parent.draft.attachments = NSMutableOrderedSet(array: newAttachments)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,8 +70,8 @@ class AttachmentRowController: ViewController {
|
||||||
private func recognizeText() {
|
private func recognizeText() {
|
||||||
descriptionMode = .recognizingText
|
descriptionMode = .recognizingText
|
||||||
|
|
||||||
self.attachment.getData(features: self.parent.mastodonController.instanceFeatures, skipAllConversion: true) { result in
|
DispatchQueue.global(qos: .userInitiated).async {
|
||||||
DispatchQueue.main.async {
|
self.attachment.getData(features: self.parent.mastodonController.instanceFeatures, skipAllConversion: true) { result in
|
||||||
let data: Data
|
let data: Data
|
||||||
switch result {
|
switch result {
|
||||||
case .success((let d, _)):
|
case .success((let d, _)):
|
||||||
|
|
|
@ -22,11 +22,10 @@ struct LanguagePicker: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
static func codeFromInputMode(_ mode: UITextInputMode) -> Locale.LanguageCode? {
|
static func codeFromInputMode(_ mode: UITextInputMode) -> Locale.LanguageCode? {
|
||||||
guard let bcp47Lang = mode.primaryLanguage,
|
guard let bcp47Lang = mode.primaryLanguage else {
|
||||||
!bcp47Lang.isEmpty else {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var maybeIso639Code = bcp47Lang[..<bcp47Lang.index(bcp47Lang.startIndex, offsetBy: min(3, bcp47Lang.count))]
|
var maybeIso639Code = bcp47Lang[..<bcp47Lang.index(bcp47Lang.startIndex, offsetBy: 3)]
|
||||||
if maybeIso639Code.last == "-" {
|
if maybeIso639Code.last == "-" {
|
||||||
maybeIso639Code = maybeIso639Code[..<maybeIso639Code.index(before: maybeIso639Code.endIndex)]
|
maybeIso639Code = maybeIso639Code[..<maybeIso639Code.index(before: maybeIso639Code.endIndex)]
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,7 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
|
||||||
explore.loadViewIfNeeded()
|
explore.loadViewIfNeeded()
|
||||||
|
|
||||||
let search = secondaryNavController.viewControllers.first as! InlineTrendsViewController
|
let search = secondaryNavController.viewControllers.first as! InlineTrendsViewController
|
||||||
if search.searchController?.isActive == true {
|
if search.searchController.isActive {
|
||||||
// Copy the search query from the search VC to the Explore VC's search controller.
|
// Copy the search query from the search VC to the Explore VC's search controller.
|
||||||
let query = search.searchController.searchBar.text ?? ""
|
let query = search.searchController.searchBar.text ?? ""
|
||||||
explore.searchController.searchBar.text = query
|
explore.searchController.searchBar.text = query
|
||||||
|
|
|
@ -240,9 +240,7 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell {
|
||||||
|
|
||||||
override var accessibilityLabel: String? {
|
override var accessibilityLabel: String? {
|
||||||
get {
|
get {
|
||||||
guard let first = group.notifications.first else {
|
let first = group.notifications.first!
|
||||||
return nil
|
|
||||||
}
|
|
||||||
var str = ""
|
var str = ""
|
||||||
switch group.kind {
|
switch group.kind {
|
||||||
case .favourite:
|
case .favourite:
|
||||||
|
|
|
@ -263,9 +263,6 @@ class NotificationsCollectionViewController: UIViewController, TimelineLikeColle
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var snapshot = dataSource.snapshot()
|
var snapshot = dataSource.snapshot()
|
||||||
guard snapshot.sectionIdentifiers.contains(.notifications) else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let items = snapshot.itemIdentifiers(inSection: .notifications)
|
let items = snapshot.itemIdentifiers(inSection: .notifications)
|
||||||
let toDelete = statusIDs.flatMap { id in
|
let toDelete = statusIDs.flatMap { id in
|
||||||
items.lazy.filter { $0.group?.notifications.first?.status?.id == id }
|
items.lazy.filter { $0.group?.notifications.first?.status?.id == id }
|
||||||
|
|
|
@ -77,11 +77,7 @@ struct TipJarView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onPreferenceChange(ButtonWidthKey.self) { newValue in
|
.onPreferenceChange(ButtonWidthKey.self) { newValue in
|
||||||
if let buttonWidth {
|
self.buttonWidth = newValue
|
||||||
self.buttonWidth = max(buttonWidth, newValue)
|
|
||||||
} else {
|
|
||||||
self.buttonWidth = newValue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let total = getTotalTips(), total > 0 {
|
if let total = getTotalTips(), total > 0 {
|
||||||
|
|
|
@ -105,11 +105,7 @@ class PollOptionsView: UIControl {
|
||||||
|
|
||||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||||
// don't let subviews receive touch events
|
// don't let subviews receive touch events
|
||||||
if isEnabled {
|
return self
|
||||||
return self
|
|
||||||
} else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - UIControl
|
// MARK: - UIControl
|
||||||
|
|
|
@ -32,12 +32,10 @@ class PollVoteButton: UIView {
|
||||||
|
|
||||||
button.translatesAutoresizingMaskIntoConstraints = false
|
button.translatesAutoresizingMaskIntoConstraints = false
|
||||||
button.setTitleColor(.secondaryLabel, for: .disabled)
|
button.setTitleColor(.secondaryLabel, for: .disabled)
|
||||||
button.contentHorizontalAlignment = .trailing
|
|
||||||
embedSubview(button)
|
embedSubview(button)
|
||||||
#if targetEnvironment(macCatalyst)
|
#if targetEnvironment(macCatalyst)
|
||||||
label.textColor = .secondaryLabel
|
label.textColor = .secondaryLabel
|
||||||
label.translatesAutoresizingMaskIntoConstraints = false
|
label.translatesAutoresizingMaskIntoConstraints = false
|
||||||
label.textAlignment = .right
|
|
||||||
embedSubview(label)
|
embedSubview(label)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,6 @@ class StatusPollView: UIView, StatusContentPollView {
|
||||||
voteButton.translatesAutoresizingMaskIntoConstraints = false
|
voteButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
voteButton.addTarget(self, action: #selector(votePressed))
|
voteButton.addTarget(self, action: #selector(votePressed))
|
||||||
voteButton.setFont(infoLabel.font)
|
voteButton.setFont(infoLabel.font)
|
||||||
voteButton.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
|
|
||||||
addSubview(voteButton)
|
addSubview(voteButton)
|
||||||
|
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
|
@ -78,7 +77,7 @@ class StatusPollView: UIView, StatusContentPollView {
|
||||||
infoLabel.leadingAnchor.constraint(equalTo: leadingAnchor),
|
infoLabel.leadingAnchor.constraint(equalTo: leadingAnchor),
|
||||||
infoLabel.topAnchor.constraint(equalTo: optionsView.bottomAnchor),
|
infoLabel.topAnchor.constraint(equalTo: optionsView.bottomAnchor),
|
||||||
infoLabel.bottomAnchor.constraint(equalTo: bottomAnchor),
|
infoLabel.bottomAnchor.constraint(equalTo: bottomAnchor),
|
||||||
infoLabel.trailingAnchor.constraint(equalTo: voteButton.leadingAnchor, constant: -8),
|
infoLabel.trailingAnchor.constraint(lessThanOrEqualTo: voteButton.leadingAnchor, constant: -8),
|
||||||
|
|
||||||
voteButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 44),
|
voteButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 44),
|
||||||
voteButton.trailingAnchor.constraint(equalTo: trailingAnchor),
|
voteButton.trailingAnchor.constraint(equalTo: trailingAnchor),
|
||||||
|
@ -142,7 +141,7 @@ class StatusPollView: UIView, StatusContentPollView {
|
||||||
}
|
}
|
||||||
|
|
||||||
func estimateHeight(effectiveWidth: CGFloat) -> CGFloat {
|
func estimateHeight(effectiveWidth: CGFloat) -> CGFloat {
|
||||||
guard poll != nil else { return 0 }
|
guard let poll else { return 0 }
|
||||||
return optionsView.estimateHeight(effectiveWidth: effectiveWidth) + infoLabel.sizeThatFits(UIView.layoutFittingExpandedSize).height
|
return optionsView.estimateHeight(effectiveWidth: effectiveWidth) + infoLabel.sizeThatFits(UIView.layoutFittingExpandedSize).height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,6 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
|
||||||
]).configure {
|
]).configure {
|
||||||
$0.axis = .horizontal
|
$0.axis = .horizontal
|
||||||
$0.spacing = 8
|
$0.spacing = 8
|
||||||
$0.distribution = .fillProportionally
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private let timestampAndClientLabel = UILabel().configure {
|
private let timestampAndClientLabel = UILabel().configure {
|
||||||
|
@ -327,12 +326,7 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
|
||||||
}
|
}
|
||||||
|
|
||||||
override func updateConfiguration(using state: UICellConfigurationState) {
|
override func updateConfiguration(using state: UICellConfigurationState) {
|
||||||
var config = UIBackgroundConfiguration.listPlainCell().updated(for: state)
|
backgroundConfiguration = .appListPlainCell(for: state)
|
||||||
// conv main status isn't selectable
|
|
||||||
if !state.isFocused {
|
|
||||||
config.backgroundColor = .appBackground
|
|
||||||
}
|
|
||||||
backgroundConfiguration = config
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Configure UI
|
// MARK: Configure UI
|
||||||
|
|
|
@ -784,8 +784,7 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
||||||
}
|
}
|
||||||
|
|
||||||
func contextMenuConfiguration() -> UIContextMenuConfiguration? {
|
func contextMenuConfiguration() -> UIContextMenuConfiguration? {
|
||||||
guard let mastodonController,
|
guard let status = mastodonController.persistentContainer.status(for: statusID) else {
|
||||||
let status = mastodonController.persistentContainer.status(for: statusID) else {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return UIContextMenuConfiguration {
|
return UIContextMenuConfiguration {
|
||||||
|
|
Loading…
Reference in New Issue