Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit b42fdfc

Browse files
authored
Preferences tab (#93)
* Add the initial preferences implementation. * Add localized strings. * Support different tab types. * Wire up the options menu. * Handle the tabType attribute via NSSecureCoding. * Rename some of the download functions/properties. * Organize the appearance preferences. * Fix a compilation error. * Add NSViewControllerExtension. * Rename Preference to PreferenceSection. * Track login detection. * Connect the Preferences menu item. * Use the selected download URL when downloading. * Appease Interface Builder. * Store a preference for prompting on every download. * Reload data after removing all fireproof domains. * Filter fireproof domains when searching. * Drop the WWW when managing fireproof domains. * Refresh the default browser row when appropriate. * Remove logging and clean up function signatures. * Prompt for the download location at the end of the download. * Apply the app theme on launch. * Fix some colors, UI issues, SwiftLint warnings, and more. * Move the appearance string into UserText. * Fix an issue with clicking the ColorView. * Add an extension to determine whether the tab’s address bar should become the first responder. * Make the preferences table view the first responder when selected. * Fix keyboard navigation in the preferences sidebar. * Add another scrolling safeguard. Also: new assets! * Reload the appearance row when the system theme changes. * Use hex values for the separator color, rather than alpha values. * Fix a SwiftLint violation. * Fix the padding on the About row. * Remove an unused file. * Add appearance preferences tests. * Test the download preferences. * Create a new color for dividers that are on a white background. * Remove an unused test extension. * Remove an unused computed variable. * Update the Share button icon. * Apply a rounded style to favicons. * Remove the NSResponder propagation code. * Set the tab type to standard when setting a URL. * Set the path control border color based on the app appearance. * Add a DEBUG check to help with default browser protection. * Change hasPrefix to hasSuffix. * Use `contains` for the debug check, for maximum safety. * Only focus standard tabs.
1 parent 7a9ee85 commit b42fdfc

File tree

88 files changed

+3263
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3263
-41
lines changed

DuckDuckGo.xcodeproj/project.pbxproj

+147-7
Large diffs are not rendered by default.

DuckDuckGo/AppDelegate/AppDelegate.swift

+7
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
7575
grammarCheckEnabler = GrammarCheckEnabler(windowControllersManager: WindowControllersManager.shared)
7676
grammarCheckEnabler.enableIfNeeded()
7777

78+
applyPreferredTheme()
79+
7880
launchTimingPixel.fire()
7981

8082
appUsageActivityMonitor = AppUsageActivityMonitor(delegate: self)
@@ -116,6 +118,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
116118
WindowControllersManager.shared.show(url: url)
117119
}
118120

121+
private func applyPreferredTheme() {
122+
let appearancePreferences = AppearancePreferences()
123+
appearancePreferences.updateUserInterfaceStyle()
124+
}
125+
119126
}
120127

121128
extension AppDelegate: AppUsageActivityMonitorDelegate {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.898",
9+
"green" : "0.898",
10+
"red" : "0.898"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.278",
27+
"green" : "0.278",
28+
"red" : "0.278"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.910",
9+
"green" : "0.910",
10+
"red" : "0.910"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "display-p3",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.244",
27+
"green" : "0.242",
28+
"red" : "0.243"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}

DuckDuckGo/Assets.xcassets/Colors/SeparatorColor.colorset/Contents.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"color-space" : "srgb",
66
"components" : {
77
"alpha" : "0.100",
8-
"blue" : "0.000",
9-
"green" : "0.000",
10-
"red" : "0.000"
8+
"blue" : "0x00",
9+
"green" : "0x00",
10+
"red" : "0x00"
1111
}
1212
},
1313
"idiom" : "universal"
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Bookmark-Add-16.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Folder-New-16.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Appearance.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Bookmarks-16.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "macos-dark-theme.pdf",
5+
"idiom" : "mac"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Default Browser (Color).pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Downloads.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Expand-16.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "FavoriteFilledBorder.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Folder-Color-16.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "macos-light-theme.pdf",
5+
"idiom" : "mac"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Preferences.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Privacy (Color).pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Share-16.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "SolidCheckmark.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "macos-system-theme.pdf",
5+
"idiom" : "mac"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Warning.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"template-rendering-intent" : "template"
14+
}
15+
}
Binary file not shown.

0 commit comments

Comments
 (0)