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 » Community » U++ community news and announcements » DarkTheme function parameters changed
Re: DarkTheme function parameters changed [message #60916 is a reply to message #60913] Mon, 07 October 2024 14:48 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Lance wrote on Mon, 07 October 2024 13:57
mirek wrote on Mon, 07 October 2024 03:43


I mean that Blend(SColorPaper, SColorMark, 220) has to be evaluated at some point. From developer perspective, the most logical point is when he calls Blend. It this was supposed to work without SkinChanged, we would need to do something like changing all colors stored in widgets to functions. I do not think that is a good idea...

Mirek

//header
struct SysColors
{
   Color paper;
   Color ink;
   Color mark;
   Color highlight;
   ...
   void RefreshColors();

   ...

   static SysColors scs;

private:
   SysColors(){ RefreshColors(); }
};
Color& SColorPaper = SysColors::scs.paper;
Color& SColorMark  = SysColors::scs.mark;
//cpp
SysColors SysColors::scs;



Then
Blend(SColorPaper, SColorMark, 220)

will be evaluated everytime with refreshed System Colors.


No.

ArrayCtrl ctrl;
ctrl.EvenRowColor();

it gets evaulate once, at this point. If SystemColors change, it is still evaluated for the old values. Changing values to references does not really help, you would at least need to call EvenRowColor again.

And pls note that this is just one example. What about e.g.

ctrl.Add(AttrText("Hello there!").Ink(IsDarkTheme() ? Blend(White(), LtBlue()) : Blue());

[Updated on: Mon, 07 October 2024 14:50]

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: SetRect "MegaRect" support...
Next Topic: 2024rc
Goto Forum:
  


Current Time: Mon Jun 09 00:07:59 CEST 2025

Total time taken to generate the page: 0.04969 seconds