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

Aqua dark transition #106

Merged
merged 10 commits into from
Sep 18, 2018
Merged

Aqua dark transition #106

merged 10 commits into from
Sep 18, 2018

Conversation

balthisar
Copy link

I don't recommend merging this into your master, but if you'd like to setup a working branch, I'd certainly like to stay in sync with anything you might add for getting dark mode to work.

Although this PR seems to involve a lot of files, most of that is the result of cleaning up the Framework files in the directory structure.

In essence, the views look good right now with the simply color changes that I made to the ruler's initializer and the default preferences, in both dark and aqua modes.

There's still a lot of work to do as we discussed in #105, but at least when compiled with 10.14 SDK and running on a 10.14 system, MGSFragariaView no longer sticks out like a sore thumb.

This seems like a good base to start further work from.

- Deployment target to 10.10 for the use of named colors to support Dark Mode.
- Remove deprecations and simplify internal calls, due to deployment target change.
- Update some constraints to prevent IB complaints.
- Add colors suitable for dark mode.
…tory.

- Preserved existing, non-directory groups within the top level framework folder,
  as we don't want to litter the filesystem with too many levels.
- Synced all of the demo applications to the file system and target names, and
  removed unnecessary nesting from the groups.
- Everything tested and running manually.
- All existing tests pass.
MGSUserDefaultsController.

There's an existing bug in the MGSHybridUserDefaultsController, where it's
not updated when underlying data is changed.
@balthisar
Copy link
Author

Okay, a working update that supports dark mode!

Instead of the approach we discussed in #105, I left MGSFragariaView and everything else alone. Instead, MGSUserDefaultsController is capable of managing multiple sets of defaults, and swapping the values any time the appearance changes. It's working quite nicely.

When the prefs don't exist for the "new" appearance, the existing prefs are used, or the existing defaults. I've added a delegate to get overrides, so clients apps can provide new default colors for any mode they want.

I've discovered any existing bug in the hybrid controller, though. It won't receive notifications of updates when its underlying data is changed, and you can see this in the Fragaria Prefs sample application, but opening both the Hybrid Prefs and the Prefs windows.

This will take some additional work.

Possibly some of dark mode ruler colors may need adjusting, too.

For now, though, with macOS 10.14 release approaching, it seems like we have a good base for going forward.

…asis.

This fixes the long outstanding (apparently) issue of multiple preferences
windows not staying synchronized. Note that the CONTENTS of the theme popup
are not synchronized. Not sure if there's a use case for this in the real
world, as the Fragaria Prefs example is kind of contrived.
@balthisar
Copy link
Author

Did you start something with MGSColourSchemeOption and then stop? For example there's no implementation for sourceFile, and as a result deleting schemes doesn't work.

Also, with the last bug fix and tweaks, I think this change is pretty much ready to use.

  • Tests still pass.
  • Works like always on 10.13 (haven't tested earlier systems, though).
  • Switching between dark and aqua modes on 10.14 is beautiful. Set the theme colors and other options in either mode, and they stay static for that mode.
  • The hybrid controller has been fixed for all macOS versions.

@shysaur shysaur merged commit 154f33c into shysaur:master Sep 18, 2018
@shysaur
Copy link
Owner

shysaur commented Sep 18, 2018

Did you start something with MGSColourSchemeOption and then stop?

Looks like I did, but then I completely forgot about it. sourceFile was meant to be set in -initWithSchemeFileURL:error:. Thanks!

@shysaur
Copy link
Owner

shysaur commented Sep 18, 2018

And of course thanks for the PR!

@balthisar
Copy link
Author

And of course thanks for the PR!

My pleasure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants