Compare commits
No commits in common. "6821f1b9a08b9f6e6fefb8788fd6f321221c8ed9" and "6b7c828cc969b0e5b75a5cf0a9acc26c8429386f" have entirely different histories.
6821f1b9a0
...
6b7c828cc9
|
@ -25,7 +25,6 @@ public class Draft: NSManagedObject, Identifiable {
|
||||||
@NSManaged public var contentWarningEnabled: Bool
|
@NSManaged public var contentWarningEnabled: Bool
|
||||||
@NSManaged public var editedStatusID: String?
|
@NSManaged public var editedStatusID: String?
|
||||||
@NSManaged public var id: UUID
|
@NSManaged public var id: UUID
|
||||||
@NSManaged public var initialContentWarning: String?
|
|
||||||
@NSManaged public var initialText: String
|
@NSManaged public var initialText: String
|
||||||
@NSManaged public var inReplyToID: String?
|
@NSManaged public var inReplyToID: String?
|
||||||
@NSManaged public var language: String? // ISO 639 language code
|
@NSManaged public var language: String? // ISO 639 language code
|
||||||
|
@ -66,7 +65,7 @@ public class Draft: NSManagedObject, Identifiable {
|
||||||
extension Draft {
|
extension Draft {
|
||||||
public var hasContent: Bool {
|
public var hasContent: Bool {
|
||||||
(!text.isEmpty && text != initialText) ||
|
(!text.isEmpty && text != initialText) ||
|
||||||
(contentWarningEnabled && !contentWarning.isEmpty && contentWarning != initialContentWarning) ||
|
(contentWarningEnabled && !contentWarning.isEmpty) ||
|
||||||
attachments.count > 0 ||
|
attachments.count > 0 ||
|
||||||
poll?.hasContent == true
|
poll?.hasContent == true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22222" systemVersion="22G91" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22221.1" systemVersion="22G74" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
||||||
<entity name="Draft" representedClassName="ComposeUI.Draft" syncable="YES">
|
<entity name="Draft" representedClassName="ComposeUI.Draft" syncable="YES">
|
||||||
<attribute name="accountID" attributeType="String"/>
|
<attribute name="accountID" attributeType="String"/>
|
||||||
<attribute name="contentWarning" attributeType="String" defaultValueString=""/>
|
<attribute name="contentWarning" attributeType="String" defaultValueString=""/>
|
||||||
<attribute name="contentWarningEnabled" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
<attribute name="contentWarningEnabled" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||||
<attribute name="editedStatusID" optional="YES" attributeType="String"/>
|
<attribute name="editedStatusID" optional="YES" attributeType="String"/>
|
||||||
<attribute name="id" attributeType="UUID" usesScalarValueType="NO"/>
|
<attribute name="id" attributeType="UUID" usesScalarValueType="NO"/>
|
||||||
<attribute name="initialContentWarning" optional="YES" attributeType="String"/>
|
|
||||||
<attribute name="initialText" attributeType="String"/>
|
<attribute name="initialText" attributeType="String"/>
|
||||||
<attribute name="inReplyToID" optional="YES" attributeType="String"/>
|
<attribute name="inReplyToID" optional="YES" attributeType="String"/>
|
||||||
<attribute name="language" optional="YES" attributeType="String"/>
|
<attribute name="language" optional="YES" attributeType="String"/>
|
||||||
|
|
|
@ -88,7 +88,6 @@ public class DraftsPersistentContainer: NSPersistentContainer {
|
||||||
draft.text = text
|
draft.text = text
|
||||||
draft.initialText = text
|
draft.initialText = text
|
||||||
draft.contentWarning = contentWarning
|
draft.contentWarning = contentWarning
|
||||||
draft.initialContentWarning = contentWarning
|
|
||||||
draft.contentWarningEnabled = !contentWarning.isEmpty
|
draft.contentWarningEnabled = !contentWarning.isEmpty
|
||||||
draft.inReplyToID = inReplyToID
|
draft.inReplyToID = inReplyToID
|
||||||
draft.visibility = visibility
|
draft.visibility = visibility
|
||||||
|
@ -113,7 +112,6 @@ public class DraftsPersistentContainer: NSPersistentContainer {
|
||||||
draft.initialText = source.text
|
draft.initialText = source.text
|
||||||
draft.contentWarning = source.spoilerText
|
draft.contentWarning = source.spoilerText
|
||||||
draft.contentWarningEnabled = !source.spoilerText.isEmpty
|
draft.contentWarningEnabled = !source.spoilerText.isEmpty
|
||||||
draft.initialContentWarning = source.spoilerText
|
|
||||||
draft.inReplyToID = inReplyToID
|
draft.inReplyToID = inReplyToID
|
||||||
draft.visibility = visibility
|
draft.visibility = visibility
|
||||||
draft.localOnly = localOnly
|
draft.localOnly = localOnly
|
||||||
|
|
|
@ -91,10 +91,7 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDeleg
|
||||||
}
|
}
|
||||||
|
|
||||||
private func updateTitle(draft: Draft) {
|
private func updateTitle(draft: Draft) {
|
||||||
// Don't set the scene title on macOS since it shows both that and the VC title in the window titlebar
|
guard let scene = window?.windowScene,
|
||||||
#if !targetEnvironment(macCatalyst)
|
|
||||||
guard !ProcessInfo.processInfo.isiOSAppOnMac,
|
|
||||||
let scene = window?.windowScene,
|
|
||||||
let mastodonController = scene.session.mastodonController else {
|
let mastodonController = scene.session.mastodonController else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -104,7 +101,6 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDeleg
|
||||||
} else {
|
} else {
|
||||||
scene.title = "New Post"
|
scene.title = "New Post"
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func themePrefChanged() {
|
@objc private func themePrefChanged() {
|
||||||
|
|
|
@ -16,7 +16,7 @@ protocol LargeImageContentView: UIView {
|
||||||
var animationImage: UIImage? { get }
|
var animationImage: UIImage? { get }
|
||||||
var activityItemsForSharing: [Any] { get }
|
var activityItemsForSharing: [Any] { get }
|
||||||
var owner: LargeImageViewController? { get set }
|
var owner: LargeImageViewController? { get set }
|
||||||
func setControlsVisible(_ controlsVisible: Bool, animated: Bool)
|
func setControlsVisible(_ controlsVisible: Bool)
|
||||||
func grayscaleStateChanged()
|
func grayscaleStateChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,11 +75,13 @@ class LargeImageImageContentView: UIImageView, LargeImageContentView {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func setControlsVisible(_ controlsVisible: Bool, animated: Bool) {
|
func setControlsVisible(_ controlsVisible: Bool) {
|
||||||
#if !targetEnvironment(macCatalyst)
|
#if !targetEnvironment(macCatalyst)
|
||||||
if #available(iOS 16.0, *),
|
if #available(iOS 16.0, *),
|
||||||
let analysisInteraction {
|
let analysisInteraction {
|
||||||
analysisInteraction.setSupplementaryInterfaceHidden(!controlsVisible, animated: animated)
|
// note: passing animated: true here doesn't seem to do anything by itself as of iOS 16.2 (20C5032e)
|
||||||
|
// so the LargeImageViewController handles animating, but we still need to pass true here otherwise it doesn't animate
|
||||||
|
analysisInteraction.setSupplementaryInterfaceHidden(!controlsVisible, animated: true)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -136,7 +138,7 @@ class LargeImageGifContentView: GIFImageView, LargeImageContentView {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func setControlsVisible(_ controlsVisible: Bool, animated: Bool) {
|
func setControlsVisible(_ controlsVisible: Bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func grayscaleStateChanged() {
|
func grayscaleStateChanged() {
|
||||||
|
@ -187,7 +189,7 @@ class LargeImageGifvContentView: GifvAttachmentView, LargeImageContentView {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func setControlsVisible(_ controlsVisible: Bool, animated: Bool) {
|
func setControlsVisible(_ controlsVisible: Bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func grayscaleStateChanged() {
|
func grayscaleStateChanged() {
|
||||||
|
|
|
@ -282,17 +282,13 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate, LargeIma
|
||||||
self.controlsVisible = controlsVisible
|
self.controlsVisible = controlsVisible
|
||||||
if animated {
|
if animated {
|
||||||
UIView.animate(withDuration: 0.2) {
|
UIView.animate(withDuration: 0.2) {
|
||||||
// note: the value of animated: is passed to ImageAnalysisInteractino.setSupplementaryInterfaceHidden which (as of iOS 17.0.2 (21A350)):
|
self.contentView.setControlsVisible(controlsVisible)
|
||||||
// - does not animate with animated:false when wrapped in a UIView.animate block
|
|
||||||
// - does not animate with animated:true unless also wrapped in a UIView.animate block
|
|
||||||
self.contentView.setControlsVisible(controlsVisible, animated: true)
|
|
||||||
self.updateControlsView()
|
self.updateControlsView()
|
||||||
}
|
}
|
||||||
if controlsVisible && !descriptionTextView.isHidden {
|
if controlsVisible && !descriptionTextView.isHidden {
|
||||||
descriptionTextView.flashScrollIndicators()
|
descriptionTextView.flashScrollIndicators()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
contentView.setControlsVisible(controlsVisible, animated: false)
|
|
||||||
updateControlsView()
|
updateControlsView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue