Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » Dark theme issues
Re: U++ 2019.1.rc4 released [message #51610 is a reply to message #51609] Fri, 19 April 2019 14:55 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Look of focused button
Next Topic: LabelBox style
Goto Forum:
  


Current Time: Mon May 06 01:53:36 CEST 2024

Total time taken to generate the page: 0.02021 seconds