This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 442
Fix #1493: Themes / Dark Mode Support #1324
Merged
Merged
Changes from 81 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
09c10ab
Added new theming mechanism built off of JSON files.
jhreis c5fe2cc
Added Transparencies to theme file.
jhreis da616c3
Added private theme.
jhreis 08d688d
Added `styleChildren` call to all `Themeable` children.
jhreis 6760afb
Added some clarifying comments.
jhreis f357eb1
Fixed theming issue with home page and tabs.
jhreis 5c9a457
Unselected TabBarCell now follow addressBar color for deselection.
jhreis 20ae592
Fixed up URL / Address bar coloring.
jhreis f4eaed8
Added `accent` color to theming file.
jhreis cb924f4
Updated more attributes throughout, removing some now unneeded consta…
jhreis 517f002
Removed all `BrowserColor` code.
jhreis 0abb459
Fixed up tab tray to respect better color theming.
jhreis b8def89
Removed TabTray color constants.
jhreis 77d2807
Using Theme.of in more necessary places.
jhreis b4611aa
Refactored ToolbarButton to be more stylistically flexible.
jhreis b1c9c52
Fixed up TabsButton for theming.
jhreis 3b7c2e9
Fixed reader mode button to use accent color for selection.
jhreis c93646e
migrate to Swift5/Xcode 11
iccub afbc261
Update Alamofire to beta 7.
iccub a960475
Update tests to swift5, fix SearchSuggestion Alamofire change.
iccub e4fc23c
Cleaned up TabsButton creation.
jhreis b1539b2
Added theming comment to TabTray for unconventional logic.
jhreis 1c25db3
Fixed up the private mode toggle button.
jhreis 979d5e6
Updated main menu to support themes.
jhreis 58b21ae
Relocated theming json files.
jhreis 616effa
Update bootstrap script and KIF framework.
iccub 705f07e
Added theme file navigation for identifying desired themes.
jhreis e250b3b
Merge remote-tracking branch 'iccub/feature/swift5' into themes
jhreis 3fad383
Wired in settings UI, and created default theming enum to support this.
jhreis a9b317a
Actually use preference for setting theme!
jhreis f19172f
Updated JSON file for dark mode.
jhreis f94b3ff
Updated the theme preference for private mode with correct UUID.
jhreis ea3a992
Updated prefferedStatusBarStyle.
jhreis 381ab45
Removed stale reference to tab.theme, which was never used.
jhreis 61c4ca5
Removed hardcoded theme reference to top toolbar.
jhreis 2fea40f
Switched over to solely using dynamic themes.
jhreis e224369
Fixed up most Settings children VC's colorings.
jhreis 4b36537
TabBar tabs now update immediately on theme change.
jhreis 91aa527
Moved `appearance()` adjustments to theme extension.
jhreis 8a5e4f3
Added color adjustment to navigation headers.
jhreis 1029ff8
Fixed up table coloring for history / bookmarks.
jhreis e001f2a
Color adjustments for history / bookmark headers.
jhreis d712f4d
Improved bookmark editing colors.
jhreis 3fd9d21
Tab bar side glow effect respects theme now.
jhreis b15b4a2
Close button on tab bar now colored correctly.
jhreis 033795c
Initial OS level integration.
jhreis 708b6fd
Much better OS theming support for hard-to-control-views.
jhreis 4d4bd1e
Merge branch 'beta' into themes
jhreis 9eaf35e
Merge branch 'development' into themes
jhreis 3066bd7
Merge branch 'development' into themes
jhreis 524ff87
Onboarding theme support!
jhreis dbdc8ef
Shield panel now has theming support.
jhreis 78b2ac7
Updated light theme colors.
jhreis 0b4bb4b
Merge branch 'development' into themes
jhreis 52da737
Fixed on-boarding search engine table color.
jhreis 3d2cec8
Fixed up passcode UI.
jhreis 8f78047
Removed `system` theme option from iOS 12
jhreis 3814663
Keyboard adjusted based on theme.
jhreis ce12c37
Fixed label coloring for iOS 12.
jhreis e3c4fd8
Modified selection mechanism for private mode button.
jhreis 0e5e5ac
Removed `BrowserColor`.
jhreis 771f176
Switched to window system theme override.
jhreis 8fe3082
Added UIView override, since Window override not enough.
jhreis f9efb39
Added theming for sync screens.
jhreis 206b38a
Merge branch 'development' into themes
jhreis c9da2e7
Fixed up addressbar, home, and header color usage.
jhreis 6971d15
Merge branch 'development' into themes
jhreis b391bfc
Updated dark and private theme files.
jhreis d35ad4b
Updated all theme copy and made it translatable.
jhreis 2db24bb
Merge branch 'development' into themes
jhreis f6f1f86
Merge branch 'development' into themes
jhreis 82d429e
Fixed up theme for search suggestions.
jhreis 0877f49
Updated Light and Dark metadata theme files.
jhreis 30a917e
Merge branch 'development' into themes
jhreis aac7073
Merge branch 'development' into themes
jhreis 5e85e5c
Private mode button now themed correctly when opening menu.
jhreis 1672219
Merge branch 'development' into themes
jhreis 7e0d126
Updated iOS 12 theming to better support upgrading to iOS 13.
jhreis e9de252
Merge branch 'development' into themes
jhreis cc80f41
Merge branch 'development' into themes
jhreis b0ee471
Fix #1488: Changing Private Browsing Only, adjusts theme correctly.
jhreis 21b880f
Cleaned up a bunch of comments and cleaned up code.
jhreis bc537a8
Switched from using tab.type to tab.theme for theme change detection.
jhreis 38f5e5d
Removed unneeded comment.
jhreis c8b5721
Cleaned up comments.
jhreis 50fb67f
Improved ShieldView API for themeable interface.
jhreis 4c90ca8
Removed DefaultTheme's `id` prop (use rawValue).
jhreis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,6 +209,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati | |
// Override point for customization after application launch. | ||
var shouldPerformAdditionalDelegateHandling = true | ||
|
||
// BVC generally handles theme applying, but in some instances views are established | ||
// before then (e.g. passcode, so can be privacy concern, meaning this should be called ASAP) | ||
// In order to properly apply background and align this with the rest of the UI (keyboard / header) | ||
// this needs to be called. UI could be handled internally to view systems, | ||
// but then keyboard may misalign with Brave selected theme override | ||
Theme.of(nil).applyAppearanceProperties() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like we could have another Theme method for getting theme by preference/privacy mode, something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main thing is ideally this is quite rare. I ma primary hesitant to use a |
||
|
||
UIScrollView.doBadSwizzleStuff() | ||
|
||
#if BUDDYBUILD | ||
|
@@ -266,13 +273,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati | |
} | ||
|
||
AdblockResourceDownloader.shared.startLoading() | ||
|
||
UINavigationBar.appearance().tintColor = BraveUX.BraveOrange | ||
|
||
(UISwitch.appearance() as UISwitch).do { | ||
$0.tintColor = BraveUX.SwitchTintColor | ||
$0.onTintColor = BraveUX.BraveOrange | ||
} | ||
|
||
return shouldPerformAdditionalDelegateHandling | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Client/Assets/Themes/ACE618A3-D6FC-45A4-94F2-1793C40AE927.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"uuid": "ACE618A3-D6FC-45A4-94F2-1793C40AE927", | ||
"title": "Default light", | ||
"url": "www.brave.com", | ||
"description": "The standard default light theme", | ||
"thumbnail": "https://www.google.com", | ||
"isDark": false, | ||
"enabled": true, | ||
|
||
"colors": { | ||
"header": "0xf4f4f4", | ||
"footer": "0xf8f8f8", | ||
"home": "0xe8e8e8", | ||
"addressBar": "0xffffff", | ||
"border": "0x000000", | ||
"accent": "0xfb542b", | ||
"tints": { | ||
"home": "0x434351", | ||
"header": "0x434351", | ||
"footer": "0x434351", | ||
"addressBar": "0x434351" | ||
}, | ||
"transparencies": { | ||
"addressBarAlpha": 1.0, | ||
"borderAlpha": 0.2, | ||
}, | ||
"stats": { | ||
"ads": "0xFA4214", | ||
"trackers": "0x742BC4", | ||
"httpse": "0x9339D4", | ||
"timeSaved": "0x222326" | ||
} | ||
}, | ||
"images": { | ||
"header": "https://www.google.com", | ||
"footer": "https://www.google.com", | ||
"home": "https://www.google.com", | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Client/Assets/Themes/B900A41F-2C02-4664-9DE4-C170956339AC.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"uuid": "B900A41F-2C02-4664-9DE4-C170956339AC", | ||
"title": "Default dark", | ||
"url": "www.brave.com", | ||
"description": "The standard default dark theme", | ||
"thumbnail": "https://www.google.com", | ||
"isDark": true, | ||
"enabled": true, | ||
|
||
"colors": { | ||
"header": "0x282828", | ||
"footer": "0x282828", | ||
"home": "0x1c1c1c", | ||
"addressBar": "0x444444", | ||
"border": "0xffffff", | ||
"accent": "0xff631c", | ||
"tints": { | ||
"home": "0xE7E6E9", | ||
"header": "0xE7E6E9", | ||
"footer": "0xE7E6E9", | ||
"addressBar": "0xE7E6E9" | ||
}, | ||
"transparencies": { | ||
"addressBarAlpha": 1.0, | ||
"borderAlpha": 0.2, | ||
}, | ||
"stats": { | ||
"ads": "0xFA4214", | ||
"trackers": "0x1bc760", | ||
"httpse": "0x9339D4", | ||
"timeSaved": "0xffffff" | ||
} | ||
}, | ||
"images": { | ||
"header": "https://www.google.com", | ||
"footer": "https://www.google.com", | ||
"home": "https://www.google.com", | ||
} | ||
} | ||
|
39 changes: 39 additions & 0 deletions
39
Client/Assets/Themes/C5CB0D9A-5467-432C-AB35-1A78C55CFB41.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"uuid": "C5CB0D9A-5467-432C-AB35-1A78C55CFB41", | ||
"title": "Default private", | ||
"url": "www.brave.com", | ||
"description": "The standard default private theme", | ||
"thumbnail": "https://www.google.com", | ||
"isDark": true, | ||
"enabled": true, | ||
|
||
"colors": { | ||
"header": "0x1B0C32", | ||
"footer": "0x1B0C32", | ||
"home": "0x301B5A", | ||
"addressBar": "0x3D2742", | ||
"border": "0xffffff", | ||
"accent": "0xcf68ff", | ||
"tints": { | ||
"home": "0xE7E6E9", | ||
"header": "0xE7E6E9", | ||
"footer": "0xE7E6E9", | ||
"addressBar": "0xE7E6E9" | ||
}, | ||
"transparencies": { | ||
"addressBarAlpha": 1.0, | ||
"borderAlpha": 0.2, | ||
}, | ||
"stats": { | ||
"ads": "0xFA4214", | ||
"trackers": "0x1bc760", | ||
"httpse": "0x9339D4", | ||
"timeSaved": "0xffffff" | ||
} | ||
}, | ||
"images": { | ||
"header": "https://www.google.com", | ||
"footer": "https://www.google.com", | ||
"home": "https://www.google.com", | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember Sriram talking about changing this setting title, have we decided on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't heard anything, we're going with this for now, can adjust in future 🤷♂