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

Graphite app appearance ? #118

Closed
perfaram opened this issue May 21, 2014 · 7 comments
Closed

Graphite app appearance ? #118

perfaram opened this issue May 21, 2014 · 7 comments

Comments

@perfaram
Copy link

Couldn't we add support for the graphite app appearance ?
image

Can be done through putting the following in main.m :

[[NSUserDefaults standardUserDefaults] setVolatileDomain:@{@"AppleAquaColorVariant": @6} forName:NSArgumentDomain];

This works in regular Cocoa apps, but I don't know exactly in which order MacGap loads things...
E.g : If MacGap starts looking at JS only after Window creation, then we're screwed

@jeff-h
Copy link
Member

jeff-h commented May 22, 2014

Are you saying this code temporarily changes the system appearance setting to graphite, for when this app is active? I had a quick try and it didn't seem to do this, at least not after the window is already drawn.

I did see code around which reads this value so if we added support for that, you could have your app's JS adjust the CSS to a graphite theme.

@perfaram
Copy link
Author

When you put the code I gave in main.m :
macgapgraphite - copie

The result is :
macgap2

I changes the appearance for the app only (e.g, like FCPX)

@perfaram
Copy link
Author

Well, looks like it can only be changed before the Window drawing

EDIT : Now I'm sure, it has to be done before drawing
I tried putting the following first in the beep function (didn't work), just after drawing (didn't work), and then just before drawing (worked)

NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults setVolatileDomain:@{@"AppleAquaColorVariant": @6} forName:NSArgumentDomain];

@jeff-h
Copy link
Member

jeff-h commented May 24, 2014

Sounds like an ideal contender for the MacGap 2 way of doing things. MG2 is currently under very early development, but one improvement is the addition of a config.json file which allows the JS developer to specify a bunch of initial settings, currently covering items such as the window size and position, meaning these can be applied before the window is drawn (and before any JS has even run). It would almost certainly be trivial to add your idea above in this scenario.

Can you think of a way to get this working within the current codebase? I guess I would rather not go adding a config.json into MacGap 1 at this point.

@perfaram
Copy link
Author

Within the current code, no. But with MacGap 2, yes, and this is great news ! Sounds really good

@jeff-h
Copy link
Member

jeff-h commented May 25, 2014

Referenced this issue from the wiki here: https://github.com/maccman/macgap/wiki/MacGap-2-planning

@jeff-h jeff-h closed this as completed May 25, 2014
@jeff-h
Copy link
Member

jeff-h commented May 29, 2014

Sadly even in MG2 this looks like it's tricky. The issue is always that it seems to have to run so very early in the process. Currently where we load the config.json file in MG2 it's not early enough for this to have any effect.

We'll definitely keep this on the list and see if things come together in MG2 in such a way that this will be possible.

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

No branches or pull requests

2 participants