Skip to content
This repository was archived by the owner on Aug 11, 2024. It is now read-only.

Commit 35b78a5

Browse files
Accommodate updated System Preferences window size.
1 parent 8707130 commit 35b78a5

File tree

6 files changed

+41
-18
lines changed

6 files changed

+41
-18
lines changed

Retroactive.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@
980980
CODE_SIGN_ENTITLEMENTS = Retroactive/Support/Retroactive.entitlements;
981981
CODE_SIGN_STYLE = Automatic;
982982
COMBINE_HIDPI_IMAGES = YES;
983-
CURRENT_PROJECT_VERSION = 74;
983+
CURRENT_PROJECT_VERSION = 75;
984984
INFOPLIST_FILE = Retroactive/Support/Info.plist;
985985
LD_RUNPATH_SEARCH_PATHS = (
986986
"$(inherited)",
@@ -1001,7 +1001,7 @@
10011001
CODE_SIGN_ENTITLEMENTS = Retroactive/Support/Retroactive.entitlements;
10021002
CODE_SIGN_STYLE = Automatic;
10031003
COMBINE_HIDPI_IMAGES = YES;
1004-
CURRENT_PROJECT_VERSION = 74;
1004+
CURRENT_PROJECT_VERSION = 75;
10051005
INFOPLIST_FILE = Retroactive/Support/Info.plist;
10061006
LD_RUNPATH_SEARCH_PATHS = (
10071007
"$(inherited)",

Retroactive/Common/Extensions/CGType-Extension.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,21 @@ extension CGSize {
44
func similarToSize(_ size: CGSize, maxDeltaX: CGFloat = 8, maxDeltaY: CGFloat = 8) -> Bool {
55
return abs(self.width - size.width) <= maxDeltaX && abs(self.height - size.height) <= maxDeltaY
66
}
7+
8+
var similarToSecurityPrefPaneSize: Bool {
9+
// Security preferences window is around 668x573 on Catalina, 668x587 on Big Sur
10+
return self.similarToSize(CGSize(width: 668, height: osAtLeastBigSur ? 587 : 573), maxDeltaX: 180, maxDeltaY: 5)
11+
}
12+
13+
var similarToPasswordDialogSize: Bool {
14+
return self.similarToSize(CGSize(width: 444, height: 212), maxDeltaX: 40, maxDeltaY: 212)
15+
}
16+
17+
var similarToDimmingBackgroundSize: Bool {
18+
if (!osAtLeastBigSur) {
19+
return false
20+
}
21+
// Dimming background is around 668x535 on Big Sur
22+
return self.similarToSize(CGSize(width: 668, height: 535), maxDeltaX: 180, maxDeltaY: 5)
23+
}
724
}

Retroactive/StepFour/SyncingViewController.swift

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ class SyncingViewController: NSViewController, GuaranteeViewControllerDelegate,
5858
func populateGuarantees() {
5959
let guarantees: [GuaranteeSection] = [
6060
GuaranteeSection(title: "Why does iPod syncing need Full Disk Access?".localized(),
61-
explaination: "iPod devices are considered as removable storage by macOS Catalina. iTunes needs Full Disk Access to access removable storage and shared network drives.".localized(),
61+
explaination: String(format: "iPod devices are considered as removable storage by %@. iTunes needs Full Disk Access to access removable storage and shared network drives.".localized(), ProcessInfo.versionName),
6262
buttonText: nil,
6363
buttonAction: nil),
6464
GuaranteeSection(title: "Can I use iTunes without Full Disk Access?".localized(),
6565
explaination: "Yes, you can. However, iTunes will not sync with iPod devices, play music on removable storage, or access shared iTunes libraries on a network drive.".localized(),
6666
buttonText: "Use iTunes without Full Disk Access".localized() + disclosureArrow,
6767
buttonAction: { self.skipSyncingClicked(self) }),
6868
GuaranteeSection(title: "Why isn’t this more granular?".localized(),
69-
explaination: "While apps optimized for macOS Catalina can request granular access to Removable Volumes, iTunes was built before macOS Catalina. Retroactive’s loader script has similar requirements.".localized(),
69+
explaination: String(format: "While apps optimized for %@ can request granular access to Removable Volumes, iTunes was built before %@. Retroactive’s loader script has similar requirements.".localized(), ProcessInfo.versionName, ProcessInfo.versionName),
7070
buttonText: nil,
7171
buttonAction: nil)
7272
]
@@ -143,12 +143,16 @@ class SyncingViewController: NSViewController, GuaranteeViewControllerDelegate,
143143
lastOrigin = CGPoint(x: windowX, y: windowY)
144144
lastWidthHeight = CGSize(width: windowWidth, height: windowHeight)
145145
}
146+
if (lastWidthHeight.similarToPasswordDialogSize) {
147+
// On Big Sur, there's two extra windows for dimmed sheet presentations.
148+
// Ignore them once a sheet window is found.
149+
break
150+
}
146151
}
147152

148153
let screen = NSScreen.screens.first!
149154
let yPositionInScreenSpace = screen.frame.size.height - lastOrigin.y - lastWidthHeight.height
150-
if (lastWidthHeight.similarToSize(CGSize(width: 668, height: 573), maxDeltaX: 180, maxDeltaY: 5)) {
151-
// Security preferences window is around 668x573
155+
if (lastWidthHeight.similarToSecurityPrefPaneSize) {
152156
if (shouldShowDragBashView) {
153157
padlockWindow.orderOut(self)
154158
// to drag window
@@ -167,20 +171,22 @@ class SyncingViewController: NSViewController, GuaranteeViewControllerDelegate,
167171
y: yPositionInScreenSpace - padlockWindow.frame.height + 25))
168172
}
169173
mostRecentPrefsFrame = CGRect(x: lastOrigin.x, y: lastOrigin.y, width: lastWidthHeight.width, height: lastWidthHeight.height)
170-
} else if (lastWidthHeight.similarToSize(CGSize(width: 444, height: 212), maxDeltaX: 40, maxDeltaY: 212)) {
174+
} else if (lastWidthHeight.similarToPasswordDialogSize) {
171175
// Password entry
172176
shouldShowDragBashView = true
173177
padlockWindow.orderOut(self)
174178
dragWindow.orderOut(self)
175179
upArrowWindow.orderOut(self)
176180
} else {
177181
// Main preferences window is around 668x586
178-
shouldShowDragBashView = false
179182
padlockWindow.orderOut(self)
180183
dragWindow.orderOut(self)
181184
upArrowWindow.orderOut(self)
182-
self.view.window?.deminiaturize(self)
183-
self.view.window?.makeKeyAndOrderFront(self)
185+
if (!lastWidthHeight.similarToDimmingBackgroundSize) {
186+
shouldShowDragBashView = false
187+
self.view.window?.deminiaturize(self)
188+
self.view.window?.makeKeyAndOrderFront(self)
189+
}
184190
}
185191
}
186192

Retroactive/Support/SupportPath.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
<plist version="1.0">
44
<dict>
55
<key>NewVersionVisibleTitle</key>
6-
<string>Retroactive 1.8 (Build 74) adds new features and improves compatibility.</string>
6+
<string>Retroactive 1.8 (Build 75) adds new features and improves compatibility.</string>
77
<key>NewVersionChangelog</key>
88
<string>• Adds support for unlocking Xcode 11.7 on macOS Mojave
99
• Adds experimental support for unlocking Aperture and iTunes on macOS Big Sur
1010
</string>
1111
<key>NewVersionVisibleTitlezhHans</key>
12-
<string>新版本解印 1.8 (版本号 74) 包含新功能,并改进了兼容性</string>
12+
<string>新版本解印 1.8 (版本号 75) 包含新功能,并改进了兼容性</string>
1313
<key>NewVersionChangelogzhHans</key>
1414
<string>• 新增支持在 macOS Mojave 下解锁 Xcode 11.7
1515
• 新增实验性支持在 macOS Big Sur 下解锁 Aperture 和 iTunes
1616
</string>
1717
<key>NewVersionVisibleTitlezhHant</key>
18-
<string>新版本解印 1.8 (版本號 74) 包含新功能,並改進了兼容性</string>
18+
<string>新版本解印 1.8 (版本號 75) 包含新功能,並改進了兼容性</string>
1919
<key>NewVersionChangelogzhHant</key>
2020
<string>• 新增支持在 macOS Mojave 下解鎖 Xcode 11.7
2121
• 新增實驗性支持在 macOS Big Sur 下解鎖 Aperture 和 iTunes
2222
</string>
2323
<key>LatestZIP</key>
2424
<string>https://github.com/cormiertyshawn895/Retroactive/releases/download/1.8/Retroactive.1.8.zip</string>
2525
<key>LatestBuildNumber</key>
26-
<integer>74</integer>
26+
<integer>75</integer>
2727
<key>SupportPathURL</key>
2828
<string>https://raw.githubusercontent.com/cormiertyshawn895/Retroactive/master/Retroactive/Support/SupportPath.plist</string>
2929
<key>ReleasePage</key>

Retroactive/Support/zh-Hans.lproj/Localizable.strings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
"View Release Page..." = "查看下载发布页...";
139139
"Waiting..." = "等待中...";
140140
"We recommend updating %@ to version %@." = "解印推荐您将 %@ 更新至 %@ 版本";
141-
"While apps optimized for macOS Catalina can request granular access to Removable Volumes, iTunes was built before macOS Catalina. Retroactive’s loader script has similar requirements." = "尽管为 macOS Catalina 优化的应用程序可以选择只允许访问可移除的宗卷,iTunes 为 macOS Catalina 之前的系统构建。解印的加载脚本也有类似的要求。";
141+
"While apps optimized for %@ can request granular access to Removable Volumes, iTunes was built before %@. Retroactive’s loader script has similar requirements." = "尽管为 %@ 优化的应用程序可以选择只允许访问可移除的宗卷,iTunes 为 %@ 之前的系统构建。解印的加载脚本也有类似的要求。";
142142
"Why does iPod syncing need Full Disk Access?" = "为什么与 iPod 同步需要完全磁盘访问权限?";
143143
"Why isn’t this more granular?" = "为什么不能选择更加细化的访问权限?";
144144
"Working..." = "进行中...";
@@ -165,7 +165,7 @@
165165
"downloading and installing" = "下载和安装";
166166
"fix" = "修复";
167167
"iPhoto has reduced functionality" = "iPhoto 功能受限";
168-
"iPod devices are considered as removable storage by macOS Catalina. iTunes needs Full Disk Access to access removable storage and shared network drives." = "macOS 将 iPod 设备认定为可移除的宗卷。iTunes 需要完全磁盘访问权限才能访问可移除宗卷和共享的网络服务器。";
168+
"iPod devices are considered as removable storage by %@. iTunes needs Full Disk Access to access removable storage and shared network drives." = "%@ 将 iPod 设备认定为可移除的宗卷。iTunes 需要完全磁盘访问权限才能访问可移除宗卷和共享的网络服务器。";
169169
"install" = "安装";
170170
"installing support files for" = "安装组件以支持";
171171
"unlock" = "解锁";

Retroactive/Support/zh-Hant.lproj/Localizable.strings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
"View Release Page..." = "查看下載發布頁...";
139139
"Waiting..." = "等待中...";
140140
"We recommend updating %@ to version %@." = "解印推薦您將 %@ 更新至 %@ 版本";
141-
"While apps optimized for macOS Catalina can request granular access to Removable Volumes, iTunes was built before macOS Catalina. Retroactive’s loader script has similar requirements." = "儘管為 macOS Catalina 優化的應用程序可以選擇只允許訪問可移除的宗卷,iTunes 為 macOS Catalina 之前的系統構建。解印的加載腳本也有類似的要求。";
141+
"While apps optimized for %@ can request granular access to Removable Volumes, iTunes was built before %@. Retroactive’s loader script has similar requirements." = "盡管為 %@ 優化的應用程序可以選擇隻允許訪問可移除的宗卷,iTunes 為 %@ 之前的係統構建。解印的加載腳本也有類似的要求。";
142142
"Why does iPod syncing need Full Disk Access?" = "為什麼與 iPod 同步需要完全取用瓷碟?";
143143
"Why isn’t this more granular?" = "為什麼不能選擇更加細化的訪問權限?";
144144
"Working..." = "進行中...";
@@ -165,7 +165,7 @@
165165
"downloading and installing" = "下載和安裝";
166166
"fix" = "修復";
167167
"iPhoto has reduced functionality" = "iPhoto 功能受限";
168-
"iPod devices are considered as removable storage by macOS Catalina. iTunes needs Full Disk Access to access removable storage and shared network drives." = "macOS 將 iPod 設備認定為可移除的宗卷。iTunes 需要完全取用瓷碟才能訪問可移除宗捲和共享的網絡服務器。";
168+
"iPod devices are considered as removable storage by %@. iTunes needs Full Disk Access to access removable storage and shared network drives." = "%@ 將 iPod 設備認定為可移除的宗卷。iTunes 需要完全磁盤訪問權限才能訪問可移除宗卷和共享的網絡服務器。";
169169
"install" = "安裝";
170170
"installing support files for" = "安裝組件以支持";
171171
"unlock" = "解鎖";

0 commit comments

Comments
 (0)