-
Notifications
You must be signed in to change notification settings - Fork 46
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
[Windows] add is highcontrast #153
Conversation
Thanks! I'll take a look next week |
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.
Great idea to split PR into small chunks! I like the implementation, the only issue I have with it is that it should be on a separate static class, now on a Window (apologies if I ever suggested otherwise)
/** | ||
* <p>check whether OS currently uses high contrast mode.</p> | ||
*/ | ||
public abstract boolean isHighContrast(); |
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.
You were correct in #143 that themes are per-app, not per-window. Apologies if it was me who confused and/or suggested this method to be on a Window class.
It could either go on App or on a new class called Theme, similar how Clipboard groups all the functions related to clipboard manipulation. I suggest Theme.
Note: this would be different from dark/light enum, this will be a class containing static methods like isHighContrast() etc. We’ll have to come up with something different re: dark/light
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.
According to your advice, I added a Theme class.
70c2fcc
to
7c84338
Compare
I have one question. (I am not quite familiar with GUI app and this may be a stupid question). |
It’s important that all communication with OS APIs, either it’s on Windows, Linux or Mac, happen from the same thread on which window was created. We (and most of the other UI framewors) call it UI thread. It’s usually a single dedicated thread where even loop was started and it’s usually blocked in that loop.
Simple rule of thumb would be to put it everywhere. |
a21de28
to
0f67087
Compare
0f67087
to
56eb769
Compare
Thanks, merged |
I’ve pushed macOS impl and removed C++ ThemeWin32 class, seems unnecessary. Please take a look 5a680f3 |
Actually, commit is now bada613, I rebased to fix compilation |
separate changes in #143
I separated #143 because it becomes a bit messy.
This PR contains changes related to
isHighcontrast
functionality.