|
|
Home » U++ Library support » Look and Chameleon Technology » Dark theme issues
Dark theme issues [message #51581] |
Thu, 18 April 2019 12:43 |
cbpporter
Messages: 1412 Registered: September 2007
|
Ultimate Contributor |
|
|
Tom1 wrote on Thu, 18 April 2019 11:30Hi cbpporter,
Dark theme is enabled in Windows 10 using Settings > Colors > Choose your default app mode > Dark
Then restart TheIDE.
Best regards,
Tom
Thanks! I mean more like in code, how to turn on CtrlLib dark mode.
Found it in GIT: Ctrl::SetDarkThemeEnabled();
But... sweet baby Jesus, my eyes! I do not mean to be rude or anything, but those colors... That contrast... That Cyan text if you switch code editor to dark mode in TheIDE. That color scheme is completely unusable. It makes my eyes bleed. And literally hurt.
Again, not to be rude, but to avoid personal bias, I showed the theme to about 5 people and we had a good time. Except for the eye bleeding...
Not to mention that it is buggy and once I switched CodeEditor to dark mode, switching it to light mode doesn't work and restoring defaults.
I need to delete settings to get things back to normal...
We need something like SetDarkIconsEnabled which is independent on SetDarkThemeEnabled, maybe support for two color icons...
And a serious pass on the colors...
I tried to change the colors but it is not as simple as it sounds because of TheIDE: I noticed that several parts of TheIDE and CodeEditor work differently when together or used separately, probably because TheIDE micros and sets stuff multiple times in different points. So changing test application was easy, changing TheIDE very hard.
Chameleon needs refactoring.
Still, after about 15 minutes of work, see the attached screenshot.
I am not a graphics designer...
-
Attachment: darkmode.png
(Size: 203.49KB, Downloaded 432 times)
|
|
|
|
Re: U++ 2019.1.rc4 released [message #51584 is a reply to message #51581] |
Thu, 18 April 2019 13:33 |
|
mirek
Messages: 14112 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Thu, 18 April 2019 12:43Tom1 wrote on Thu, 18 April 2019 11:30Hi cbpporter,
Dark theme is enabled in Windows 10 using Settings > Colors > Choose your default app mode > Dark
Then restart TheIDE.
Best regards,
Tom
Thanks! I mean more like in code, how to turn on CtrlLib dark mode.
Found it in GIT: Ctrl::SetDarkThemeEnabled();
But... sweet baby Jesus, my eyes! I do not mean to be rude or anything, but those colors... That contrast... That Cyan text if you switch code editor to dark mode in TheIDE. That color scheme is completely unusable. It makes my eyes bleed. And literally hurt.
Again, not to be rude, but to avoid personal bias, I showed the theme to about 5 people and we had a good time. Except for the eye bleeding...
Not to mention that it is buggy and once I switched CodeEditor to dark mode, switching it to light mode doesn't work and restoring defaults.
I need to delete settings to get things back to normal...
We need something like SetDarkIconsEnabled which is independent on SetDarkThemeEnabled, maybe support for two color icons...
And a serious pass on the colors...
Your post is confusing, I am really not able to tell what you are speaking about...
Are you annoyed by colors in theide editor in the dark mode? (If so, welcome to the club, I dislike it too. But then I really dislike dark theme itself, so who am I to judge...).
SetDarkThemeEnabled tells U++ that application is ready to handle the dark theme. It in fact has any meaning only in windows. If you activate that, app starts following theme setting in Windows 10.
|
|
|
|
Re: U++ 2019.1.rc4 released [message #51587 is a reply to message #51585] |
Thu, 18 April 2019 14:02 |
cbpporter
Messages: 1412 Registered: September 2007
|
Ultimate Contributor |
|
|
The issues is that TheIDE CtrlCore constantly overrides your changes. In a very counter-intuitive way. Chameleon has been doing this for over a decade now. If you want to correct something, you can't easily do it. If you want to implement your own theme on top of the current dark mode? It is fairly hard. It is fairly hard to force a dark app on a light windows or the other way around. Making TheIDE do the same thing is even harder because it also constantly overrides you changes in many places. The same for code editor.
Chameleon has always been a bit hard to use and counter-intuitive.
As an example, the newest addition: SetDarkThemeEnabled. This should set your app to dark theme. Always. Without asking the operating system in 1000 places if IsDarkTheme.
Quote:SetDarkThemeEnabled tells U++ that application is ready to handle the dark theme. It in fact has any meaning only in windows. If you activate that, app starts following theme setting in Windows 10.
IMHO that is a counter-intuitive and problematic design. SetDarkThemeEnabled means "Set my theme to dark": change colors and skins.
Why cant U++ detect multiple themes and be coded to religiously follow those themes. So that if you change them, I don't have to track down dozen of places to make things just work.
I would use a design where you have a Theme, all theme aware components just read from the theme, nobody can write, the theme knows if it is dark or now (you can use heuristics if not sure) and then people are free to update that theme. The system would auto-detect the theme before GUI_APP_MAIN, produce both light an dark versions, and then you in GUI_APP_MAIN can produce a new theme based on both, set the theme without ruining the originals and things should just work.
In short, two phases:
- auto-detect and build several themes
- use the theme (just set a pointer and force the gui to refresh)
And negative icons must be turned on or off independently from any setting. All my hand inverted dark mode icons are now auto-inverted and made ugly.
Been though this multiple times, but never arrived to a final perfect dark mode skin.
I'm currently googling samples, this is the best I found for full GUI.
https:// www.reddit.com/r/Unity3D/comments/9reqtm/i_wasnt_planning_on _sharing_this_so_early_but/
I'll continue searching and am open to suggestions. If anybody knows a good dark UI that is easy to copy, please let me know.
|
|
|
Re: U++ 2019.1.rc4 released [message #51588 is a reply to message #51587] |
Thu, 18 April 2019 14:13 |
|
mirek
Messages: 14112 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Thu, 18 April 2019 14:02The issues is that TheIDE CtrlCore constantly overrides your changes. In a very counter-intuitive way. Chameleon has been doing this for over a decade now. If you want to correct something, you can't easily do it. If you want to implement your own theme on top of the current dark mode? It is fairly hard. It is fairly hard to force a dark app on a light windows or the other way around. Making TheIDE do the same thing is even harder because it also constantly overrides you changes in many places. The same for code editor.
Chameleon has always been a bit hard to use and counter-intuitive.
Maybe because the problem itself is hard and counterintiutive?
Anyway, missing docs about Chameleon is not helping. Will try to fix than.
Quote:
Quote:SetDarkThemeEnabled tells U++ that application is ready to handle the dark theme. It in fact has any meaning only in windows. If you activate that, app starts following theme setting in Windows 10.
IMHO that is a counter-intuitive and problematic design. SetDarkThemeEnabled means "Set my theme to dark": change colors and skins.
OK, we can argue about the name and I am willing to change it. But I really need that function to do exactly what it does.
Quote:
Why cant U++ detect multiple themes and be coded to religiously follow those themes. So that if you change them, I don't have to track down dozen of places to make things just work.
I would use a design where you have a Theme, all theme aware components just read from the theme, nobody can write, the theme knows if it
Thats centralized model which is not extensible - that is the issue I wanted to avoid.
Quote:
- use the theme (just set a pointer and force the gui to refresh)
void Ctrl::SetSkin(void (*_skin)())
Mirek
[Updated on: Thu, 18 April 2019 14:13] Report message to a moderator
|
|
|
Re: U++ 2019.1.rc4 released [message #51589 is a reply to message #51588] |
Thu, 18 April 2019 14:29 |
cbpporter
Messages: 1412 Registered: September 2007
|
Ultimate Contributor |
|
|
OK, let's go in order.
Before the dark mode support, setting dark mode in Windows didn't work. So clearly it is not a "simple" issue of applying a system theme, because most applications ignore that windows option.
So U++ creates this new dark theme.
So my questions are:
- how do you activate dark theme in any app once, and have it work forever? Even if Windows is in light mode. Same for light mode.
- how do you detect which mode it is. I want: if (isdarkmode) setdarkmode else setlightmode. That is a nice intuitive model.
- how do you do a few basic changes to it, like SColorPaper_Write(Color(51, 51, 51)) and force this change forever?
- how do you do the same for TheIDE, because things that work in normal apps need special extra work for TheIDE.
Quote:Thats centralized model which is not extensible - that is the issue I wanted to avoid.
It looks like to me like you achieved the exact opposite, with Chameleon doing its own thing and being super hard to reliably and intuitively override. Is there anybody who ever had luck with doing anything in Chameleon except for me 10 years ago?
This invisible magic macro system is IMHO in no way superior to a non-extensible simple deign and the non-extensible bit is arguable. There is nothing non-extensible about it because you don't need to extend upon it. For years now people have been able to define incredibly diverse themes with a CSS and a bunch of pictures.
Case in point:
void Ctrl::SetSkin(void (*_skin)())
It is not clear what it does and there are 100 more ways to touch skins. I remember now, but my bazaar/Theme did not call this function and in consequence you couldn't reliably change the theme after program launch. So GUI elements and colors updated, some didn't. So I decided back then to set the them as the first thing in the program.
|
|
|
Re: U++ 2019.1.rc4 released [message #51590 is a reply to message #51589] |
Thu, 18 April 2019 14:54 |
|
mirek
Messages: 14112 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Thu, 18 April 2019 14:29OK, let's go in order.
Before the dark mode support, setting dark mode in Windows didn't work. So clearly it is not a "simple" issue of applying a system theme, because most applications ignore that windows option.
Well, the real secret is that Windows does not really support dark theme for Win32 apps....
So what we do is to detect the fact that win10 is in dark theme, then roll out our own based on DarkTheme versions of system colors.
Quote:
So my questions are:
- how do you activate dark theme in any app once, and have it work forever? Even if Windows is in light mode. Same for light mode.
Do not call DarkThemeEnabled. It does something else.
Create dark theme skin. That must be a function that sets everything to your desired colors.
Use SetSkin.
Quote:
Case in point:
void Ctrl::SetSkin(void (*_skin)())
It is not clear what it does and there are 100 more ways to touch skins.
There are 100 ways to touch the skin, BUT you are supposed to do them in skin routine.
So basically it does what you would want from SetTheme(Theme *). But the advantage is that you inherit some default skin which you are changing and you can even call "subskin" routines there.
I agree that more docs and some cleanup would be nice, but the basic idea is IMO sound.
Mirek
|
|
|
|
Re: U++ 2019.1.rc4 released [message #51595 is a reply to message #51590] |
Thu, 18 April 2019 20:31 |
cbpporter
Messages: 1412 Registered: September 2007
|
Ultimate Contributor |
|
|
mirek wrote on Thu, 18 April 2019 15:54
I agree that more docs and some cleanup would be nice, but the basic idea is IMO sound.
Let's agree to disagree on this one .
Everything is a singleton and U++ often updates stuff in a surprising fashion. And there are macros involved. When choosing color at runtime, I can't write code like: oh, it looks like I'm using black ink on black paper. This is what the curent theme asks of me. The curent theme is dark. Let me see if the system theme does not have a light color for this element?
And this extends to CodeEditor too. If you make those colors work and be different for several programming languages, like when writing an IDE, dark and light theme, plus user profiles you can load or save, the whole updating singletons does not look like a good idea to me. I've been struggling with this for a long time. I remember for months when a single background color would not update because you had to update it outside of CodeEditor or vice-versa.
Tomorrow I'll continue investigating dark mode and see if I can can turn this mess into a half decent looking skin.
So how do you activate the dark theme in an application using SetSkin, let's say in AddressBook.
Other things:
- Icons: at the very least icons must have a flag. If checked, U++ should draw them as they are. And also a way to disable all UHD and sizing shenanigans.
- Not just icons, but everything else needs to have light mode/dark mode override. Like in TheIDE, as you described and I have noticed, CodeEditor and GUI light/dark mode are separate. This is perfectly fine, as long as each knows if it is dark/light and can access both light and dark colors at the same time. So singleton SColorFace just won't do.
- The standard U++ set skin code must set the controls/icons dark/light flag on request and only then.
Tomorrow I will go over all the colors, replace them with red and blue, see how they work and what they affect and hopefully correct this theme problem for my apps, if not for TheIDE.
The problem is that I'm not good at graphics design. I would certainly pay an affordable to designer to create a professional GUI theme. Until then all I can do is look at screenshots on the Internat and try out colors and skins.
I'm also thinking of replacing icons with SVG ans scale them on app activation, but like I said in a post, SVG are drawn with white background and that is nonsensical. Default should be Null color. Another thing to fork.
|
|
|
|
|
|
|
|
|
|
Re: U++ 2019.1.rc4 released [message #51610 is a reply to message #51609] |
Fri, 19 April 2019 14:55 |
cbpporter
Messages: 1412 Registered: September 2007
|
Ultimate Contributor |
|
|
I'm close to getting a workable system for themeing that does not need U++ changes (maybe something minor) but lives peacefully together.
What I want to do is have choice in what theme to use.
if(Ctrl::IsDarkThemeEnabled() && IsSystemThemeDark() && !IsDark(Color::FromCR(GetSysColor(COLOR_WINDOW))))
sEmulateDarkTheme = true;
So basically if IsDarkThemeEnabled and the system is dark themed, we use dark theme.
Here is where I want more control. I want all valid combinations of system dark theme and app dark theme, so 4 combinations.
We need to adjust this condition a bit.
I propose we rename IsDarkThemeEnabled, in something like IsDarkModePermited and add a new IsDarkThemeEnabled, geter and seter, where the user can choose if the skin is dark. SetDarkThemeEnabled would be called set as is today, with IsSystemThemeDark() && !IsDark(Color::FromCR(GetSysColor(COLOR_WINDOW))), but NOT in ChSysInit. Before, on system startup, so auto-detection is correct, but I can override it later.
Of course, this is just an option. Here is what I want:
// autodetect light or dark
void SetHostSkin() {
Ctrl::SetDarkThemeEnabled();
Ctrl::SetSkin(ChHostSkin);
}
// always light
void SetLightHostSkin() {
Ctrl::SetDarkThemeEnabled(false);
Ctrl::SetSkin(ChHostSkin);
}
// always dark
void SetDarkHostSkin() {
Ctrl::SetDarkThemeEnabled(true);
Ctrl::ForceDarkSkin(true);
Ctrl::SetSkin(ChHostSkin);
}
// old, unchaged
void SetStdSkin() {
Ctrl::SetDarkThemeEnabled(false);
Ctrl::SetSkin(ChStdSkin);
}
// old, unchaged
void SetClassicSkin() {
Ctrl::SetDarkThemeEnabled(false);
Ctrl::SetSkin(ChClassicSkin);
}
// my fixed version
void SetNewDarkHostSkin() {
Ctrl::SetDarkThemeEnabled(false);
Ctrl::SetSkin(ChHostSkin);
// do fixes
Ctrl::ReSkin();
}
I managed to do this, except for forcing dark skin on light skin windows. Hence the Ctrl::ForceDarkSkin(true); or the proposed rename mentioned above.
[Updated on: Fri, 19 April 2019 14:58] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sun Nov 10 20:58:28 CET 2024
Total time taken to generate the page: 0.02542 seconds
|
|
|