autoDock fixes

This commit is contained in:
True Zhuanjia committed 2026-04-13 18:16:37 +08:00
1 parent d61942caec
commit fcfe83572f
1 file changed
+5 -4
+5 -4
View File
@@ -3090,7 +3090,7 @@ import ObjectiveC.runtime
// MARK: - Auto Dock // MARK: - Auto Dock
private static let autoDockExposedEdgeLength: CGFloat = GenericUtils.isIPhone() ? 90 : 90 private static let autoDockExposedEdgeLength: CGFloat = GenericUtils.isIPhone() ? 90 : 90
private static let autoDockExposedThickness: CGFloat = 17 private static let autoDockExposedThickness: CGFloat = 22
private static let autoDockVerticalInset: CGFloat = 12 private static let autoDockVerticalInset: CGFloat = 12
@objc var autoDockIdleDuration: TimeInterval = 5 @objc var autoDockIdleDuration: TimeInterval = 5
private static let autoDockInitialAlpha: CGFloat = 0.8 private static let autoDockInitialAlpha: CGFloat = 0.8
@@ -3119,7 +3119,7 @@ import ObjectiveC.runtime
}() }()
private var autoDockTimer: Timer? private var autoDockTimer: Timer?
private var autoDockStoredCenter: CGPoint? // private var autoDockStoredCenter: CGPoint?
private var autoDockDockedCenter: CGPoint? private var autoDockDockedCenter: CGPoint?
private var autoDockDockedToBottomEdge: Bool = false private var autoDockDockedToBottomEdge: Bool = false
private var autoDockDistance: CGFloat = 3 private var autoDockDistance: CGFloat = 3
@@ -3302,7 +3302,7 @@ import ObjectiveC.runtime
hostView.layoutIfNeeded() hostView.layoutIfNeeded()
layoutIfNeeded() layoutIfNeeded()
autoDockStoredCenter = center // autoDockStoredCenter = storedCenter
let rightDistance = hostView.bounds.width - frame.maxX let rightDistance = hostView.bounds.width - frame.maxX
let bottomDistance = hostView.bounds.height - frame.maxY let bottomDistance = hostView.bounds.height - frame.maxY
autoDockDistance = min(rightDistance, bottomDistance) autoDockDistance = min(rightDistance, bottomDistance)
@@ -3342,7 +3342,8 @@ import ObjectiveC.runtime
} }
private func autoDockRestoreWidget(animated: Bool) { private func autoDockRestoreWidget(animated: Bool) {
guard autoDockIsDocked, let restoreCenter = autoDockStoredCenter else { return } guard autoDockIsDocked else { return }
let restoreCenter = storedCenter
OnScreenWidgetView.hasRestoredFromAutoDock = true OnScreenWidgetView.hasRestoredFromAutoDock = true
autoDockStopCountdown() autoDockStopCountdown()
autoDockStopSettledAlphaTimer() autoDockStopSettledAlphaTimer()