Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode support #532

Merged
merged 23 commits into from
Jul 3, 2019
Merged

Dark mode support #532

merged 23 commits into from
Jul 3, 2019

Conversation

zwaldowski
Copy link
Contributor

@zwaldowski zwaldowski commented Jun 23, 2019

Completes #463.

TODO

  • Investigate controlBackgroundColor.

This PR brings the dark mode implementation from @saagarjha and @douglashill into upstream.

In addition to their (awesome) work, this PR:

  • Better supports the color scheme changing at runtime
  • Makes some icon buttons light up instead of darkening when pressed in Dark Mode
  • Makes rows in the configuration editor are readable in Dark Mode
  • Automatically supports the main graph/map view desktop-color tinting in Dark Mode
  • Draws the separator grid lines in diff views without a "hatched" effect

Review Notes

Due to parts of the app being unusable when dark mode isn’t supported in that screen, this PR isn’t as small and granular as would be ideal. However, the diff was specifically adjusted to limit unnecessary churn, such as avoiding the automatic rewriting of xibs. I failed to identify good points to break up what remains; if you find chunks you’re rather me split out to review separately, I’d be happy to do so (through the magic of GitUp!).

Screenshots

10.15 (Dark) 10.15 Dark #1 10.15 Dark #2 10.15 Dark #3 10.15 Dark #4 10.15 Dark #5
10.15 (Light) 10.15 Light #1 10.15 Light #2 10.15 Light #3 10.15 Light #4 10.15 Light #5
10.14 (Dark) 10.14 Dark #1 10.14 Dark #2 10.14 Dark #3 10.14 Dark #4 10.14 Dark #5
10.14 (Light) 10.14 Light #1 10.14 Light #2 10.14 Light #3 10.14 Light #4 10.14 Light #5
10.13 (Light) 10.13 #1 10.13 #2 10.13 #3 10.13 #4 10.13 #5
10.12 (Light) 10.12 #1 10.12 #2 10.12 #3 10.12 #4 10.12 #5
10.11 10.11 #1 10.11 #2 10.11 #3 10.11 #4 10.11 #5
10.10 10.10 #1 10.10 #2 10.10 #3 10.10 #4 10.10 #5

And Finally…

I AGREE TO THE GITUP CONTRIBUTOR LICENSE AGREEMENT

@zwaldowski zwaldowski force-pushed the compat-dark-mode branch 2 times, most recently from 6362108 to 294aa54 Compare June 25, 2019 15:46
Copy link
Collaborator

@lucasderraugh lucasderraugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks amazing! Thanks for the tremendous effort by everyone and for pulling this all together. The changes all seem pretty safe with a few comments, but maybe I'm just misunderstanding the NSImage logic. Is this an issue for backwards compatibility that we have to conditionally select the dark/light image in code rather than let the asset catalogs handle this for us?

@zwaldowski
Copy link
Contributor Author

Is this an issue for backwards compatibility that we have to conditionally select the dark/light image in code rather than let the asset catalogs handle this for us?

That is correct.

@zwaldowski
Copy link
Contributor Author

Will also investigate Travis in a sec…

@zwaldowski
Copy link
Contributor Author

Added commentary around viewDidChangeEffectiveAppearance et. al. and (I think) fixed Travis.

@lucasderraugh
Copy link
Collaborator

lucasderraugh commented Jun 26, 2019

Seemed like @swisspol was fine with bumping to 10.10 in the original issue. If it would make the commit cleaner to simply support 10.10 and higher I think it would be worth bumping. Alternatively we could bump later, just might be easier to cleanup beforehand.

@zwaldowski
Copy link
Contributor Author

I will prepare a PR for bumping and then rebase this onto that once merged, or will have it clean up bits of this it can; whichever comes first.

@zwaldowski
Copy link
Contributor Author

OK, it totally is much simpler. I'm getting CI to check on this branch then posting a PR for the deployment change.

@zwaldowski zwaldowski changed the title Compatibility dark mode dark mode Jun 27, 2019
@zwaldowski zwaldowski changed the title dark mode Dark mode support Jun 27, 2019
@zwaldowski zwaldowski force-pushed the compat-dark-mode branch 8 times, most recently from 8f9e2e3 to a82db23 Compare July 1, 2019 17:14
@zwaldowski zwaldowski force-pushed the compat-dark-mode branch 4 times, most recently from a606dbf to 0321aaa Compare July 2, 2019 00:21
@lucasderraugh
Copy link
Collaborator

lucasderraugh commented Jul 2, 2019

Everything looks great. I'm not sure the colors are just right though, it does seem a little too dark if I compare it to Xcode which has slightly softer blacks. I'm not going to block merging on this, but I think we need to add the ability to toggle back to light mode if I'm to push this as an official update. Something like this perhaps:
Screen Shot 2019-07-02 at 10 12 57 PM
If you don't have the time, I'd be happy to add it in when I get the time, but I can imagine some people might not be happy if they can't use it as they were using it before. Pierre's number 1 concern was around breaking anything as it works currently, and this could be seen as breaking old behavior. What do you think?

@zwaldowski
Copy link
Contributor Author

I'm not sure the colors are just right though, it does seem a little too dark if I compare it to Xcode which has slightly softer blacks.

This is probably my doing, the map has defaulted to controlBackgroundColor like a text view and should probably be something else. Please hold.

… and this could be seen as breaking old behavior

I am pretty strongly against spending time on adding new code for that until it is requested, but you're welcome to do whatever you want.

Users that this would hypothetically "break" will have already explicitly chosen Dark Mode at the system level. The documentation/HIG/WWDC sessions pretty recommend against custom appearance toggles unless the app is specifically media-focused; otherwise, it is more important to respect the users' choices. Meanwhile, GitUp has been blindingly, searingly white for people who have made that choice for over a year, and so has been certainly "broken" in the same way.

@swisspol
Copy link
Contributor

swisspol commented Jul 3, 2019

Pierre's number 1 concern was around breaking anything as it works currently

I was referring to functional behavior. For visuals, if things evolve spatially or in the used colors, I have no problem.

@lucasderraugh
Copy link
Collaborator

@swisspol Good to know 🙂. @zwaldowski let me know when you're done testing out an alternate dark background color and we'll merge this in.

@zwaldowski
Copy link
Contributor Author

This is probably my doing, the map has defaulted to controlBackgroundColor like a text view and should probably be something else. Please hold.

Edit: This is recommended by the SDK, it's the same color/texture used by all scrolling content. The list of things that use it would be too many to count. In fact, it is the identical counterpart to the hard-coded whiteColor used in light mode before this PR. (i.e., controlBackgroundColor yields the same pure white in light mode.)

Xcode is not a great point of comparison because it involves custom theming. That said, the "sharpness" might be from the contrast with the branch colors? Ours in this branch are pretty much lifted from their counterparts in Calendar, and those are definitely on the neon side of things. We can definitely evolve those; doing so would be trivial and could happen whenever. In the spirit of moving things forward, if there are still concerns we could open an issue for it and I could experiment with it later this week.

@lucasderraugh lucasderraugh merged commit dac600c into git-up:master Jul 3, 2019
@lucasderraugh
Copy link
Collaborator

lucasderraugh commented Jul 3, 2019

For me it's the red/green/black in diff views I find a bit jarring, but I'd have to play around with some colors to see what bothers me about it. Let's try it out and see what we think!

@zwaldowski zwaldowski deleted the compat-dark-mode branch July 3, 2019 01:04
simpzan pushed a commit to simpzan/GitUp that referenced this pull request Oct 22, 2020
* Add a helper for looking up the GitUpKit bundle

* Add polyfills for NSAppearance

* Enable dark mode

* Draw consistent grid for diffs with line number gutters in dark mode

* Remove map status label backgrounds on Mojave

For some reason the label backgrounds did not match the window background in dark mode. As I understand it, Mojave no longer uses sub-pixel antialiasing so this workaround is no longer needed.

* Add a namespace for defining semantic colors

* Allow window-tinted background in graph view

* Support Dark Mode in modal views

* Fix dark-on-dark text in selected cells in dark mode

* Don't fill the background color for conflict/empty rows in diff views

* Support Dark Mode in welcome window

* Support Dark Mode in main window toolbar

* Support Dark Mode in main window status bar

* Support Dark Mode in window tip overlays

* Support Dark Mode in map view

* Support Dark Mode in diff views

* Support Dark Mode in commit editors

* Support Dark Mode in commit viewers

* Support Dark Mode in commit lists

* Improve branch colors

More closely based on the system colors like systemRedColor. Adds orange instead of using two variants of green. Uses more saturated colors in Dark Mode

* Support Dark Mode in config editor

* Update Document.m

Fix bad merge from master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants