Repository navigation
Conversation
Preferences > General gets an "App Icon" row with two icons to choose from: the original pink icon (default) and a new white one. Clicking an icon selects it, and the selected one is outlined with the accent color. The choice is applied right away to the Dock icon and, through NSWorkspace, to the icon of the app bundle shown in Finder, Launchpad and Spotlight. Choosing the pink icon again removes the custom bundle icon. Updating the app replaces its bundle and drops the custom icon, so it is restored on the next launch.
|
| if (self.bundleHasCustomIcon == [self isDefaultAppIcon:appIcon]) { | ||
| [self updateBundleIcon:appIcon]; |
There was a problem hiding this comment.
Existing custom icons disappear
If a user has given GitUp a custom icon in Finder, applySelectedAppIcon removes it on launch even when they have never used this picker. The registered pink default makes this condition true whenever Icon\r exists, and updateBundleIcon then calls setIcon:nil.
Preserve existing custom icons until the user explicitly chooses an icon, or track which icons this feature owns.
The app icon buttons only showed the selection with the accent outline, so VoiceOver read both of them as plain buttons. They now report the radio button role, with an accessibility value of 1 for the selected icon and 0 for the other one.
Summary
This PR adds an App Icon option to Preferences → General, so you can choose which icon GitUp uses. There are two icons for now: the original pink one (default) and a new white one.
Clicking an icon selects it right away. The selected icon is outlined with the system accent color, as in System Settings.
Changes
PreferencesWindowController.h/.m: newPreferencesAppIconService, which works likePreferencesThemeService. It saves the choice under theAppIconuser default and applies it in two places:NSApp.applicationIconImage;GitUp.appin Finder, Launchpad and Spotlight, via-[NSWorkspace setIcon:forFile:options:]. Choosing the pink icon again removes the custom icon.PreferencesWindowController.xib: an "App Icon" row under "Text Size" with two 60 pt icon buttons. Each button sits on a customNSBoxthat draws the 3 pt accent-colored outline. The box of the unselected icon is set totransparent. The General tab is 84 pt taller.AppDelegate.m: registers the pink icon as the default and applies the saved icon at launch.Application.xcassets/AppIconWhite.imageset: the white icon (512 px @1x, 1024 px @2x).Notes
Icon\rfile and a Finder info attribute in the root ofGitUp.app. While the white icon is selected,codesign --verify --strictreports "resource fork, Finder information, or similar detritus". The app still launches normally. Sparkle updates are not affected either:SUCodeSigningVerifieronly reads the designated requirement of the installed app and checks the downloaded update against it.Testing
Applicationscheme, Debug).whiteIcontoAppIcon.codesign --verify --strictpasses again.