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 » Dynamic theme changes
Dynamic theme changes [message #61206] Fri, 06 December 2024 10:20 Go to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Before this change, U++ loaded host platform skin only once on start for simplicity and further changes of theme were ignored.

This is now fixed, but the problem is a bit more complicated, so you have to activate this in GUI_APP_MAIN, docs near the end:

https://www.ultimatepp.org/dev/srcdoc$Draw$UhdAndDarkTheme_e n-us.html
Re: Dynamic theme changes [message #61208 is a reply to message #61206] Sat, 07 December 2024 06:05 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1430
Registered: December 2006
Ultimate Contributor
This change broke examples/BlueBar.
umk examples BlueBar CLANG -bus
UWord.cpp
/home/buildbot/worker/l-upp/build/uppsrc/art/BlueBar/BlueSkin.cpp:12:8: error: no member named 'Standard' in 'Upp::ToolBar::Style'
        s = s.Standard();
            ~ ^
/home/buildbot/worker/l-upp/build/uppsrc/art/BlueBar/BlueSkin.cpp:32:8: error: no member named 'Standard' in 'Upp::MenuBar::Style'
        s = s.Standard();
            ~ ^
2 errors generated.


Regards,
Novo
Re: Dynamic theme changes [message #61209 is a reply to message #61208] Sat, 07 December 2024 09:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Novo wrote on Sat, 07 December 2024 06:05
This change broke examples/BlueBar.
umk examples BlueBar CLANG -bus
UWord.cpp
/home/buildbot/worker/l-upp/build/uppsrc/art/BlueBar/BlueSkin.cpp:12:8: error: no member named 'Standard' in 'Upp::ToolBar::Style'
        s = s.Standard();
            ~ ^
/home/buildbot/worker/l-upp/build/uppsrc/art/BlueBar/BlueSkin.cpp:32:8: error: no member named 'Standard' in 'Upp::MenuBar::Style'
        s = s.Standard();
            ~ ^
2 errors generated.


Thanks, fixed.
Re: Dynamic theme changes [message #61210 is a reply to message #61209] Sat, 07 December 2024 12:04 Go to previous messageGo to next message
Tom1
Messages: 1303
Registered: March 2007
Ultimate Contributor
Hi,

TheIDE Errors panel does not seem to follow dynamic skin changes yet. Maybe it needs a Skin()?

Best regards,

Tom
Re: Dynamic theme changes [message #61211 is a reply to message #61210] Sat, 07 December 2024 12:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Tom1 wrote on Sat, 07 December 2024 12:04
Hi,

TheIDE Errors panel does not seem to follow dynamic skin changes yet. Maybe it needs a Skin()?

Best regards,

Tom


Thanks, hopefully fixed (also, in the process, I made SColor evaluation after skin change lazy)
Re: Dynamic theme changes [message #61212 is a reply to message #61211] Sat, 07 December 2024 15:52 Go to previous messageGo to next message
Tom1
Messages: 1303
Registered: March 2007
Ultimate Contributor
Hi,

Thanks, it works fine now.

BR, Tom
Re: Dynamic theme changes [message #61228 is a reply to message #61212] Fri, 13 December 2024 19:26 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello Mirek,

I am trying to make my GraphCtrl re-style correctly: it almost worked out of the box Smile
Except for one thing : I don't draw everything on refresh, some of the drawing is cached for performance reasons. So i am trying to find the correct method to detect this FULL REPAINT event.

I Tryed using
IsFullRefresh()
==> didn't work
I tryed overloading : void State(int reason)
virtual void State(int reason) {
  if (reason == LAYOUTPOS) {
    // do what I need
  }
}
==> this worked but is it the wright way ??
Re: Dynamic theme changes [message #61229 is a reply to message #61228] Fri, 13 December 2024 20:38 Go to previous messageGo to next message
Tom1
Messages: 1303
Registered: March 2007
Ultimate Contributor
Hi Didier,

I guess you should implement Skin() for your control.

Best regards,

Tom
Re: Dynamic theme changes [message #61230 is a reply to message #61229] Sat, 14 December 2024 09:31 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Thankyou Tom,

I guess it was to obvious, so I missed it Smile
Re: Dynamic theme changes [message #61275 is a reply to message #61230] Wed, 18 December 2024 23:22 Go to previous message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Just to share my little experience with dynamic theme changing.
There are some traps (at least one in which I fell Smile ):

If you use a Value to store a specific Style (to paint a rect for example): Value can store a Color, an Image, a function. Then it doesn't get modified when dynamic skin changes.

If you stored an Image inside the Value: things work out of the box Smile
If you stored a Color inside the Value, the solution is simply to make an AColor instead of Color and it just works out of the box Smile


Example:
struct MyCtrlStyle : ChStyle<MyCtrlStyle> {
	Value    plotBckgndStyle;
};

...
Replace:
plotBckgndStyle = Blend(SColorShadow(), SColorPaper(), 190);

with:
plotBckgndStyle = AColor( Blend(SColorShadow(), SColorPaper(), 190));


[Updated on: Wed, 18 December 2024 23:30]

Report message to a moderator

Previous Topic: ide: Multiline cursor
Next Topic: ide: git file history now displays author / commit info per line
Goto Forum:
  


Current Time: Wed Jun 18 11:47:06 CEST 2025

Total time taken to generate the page: 0.05358 seconds