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 » Developing U++ » U++ Developers corner » styling of widgets ( animation / look and feel)
Re: styling of widgets ( animation / look and feel) [message #59810 is a reply to message #59808] Thu, 20 April 2023 21:51 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
dodobar wrote on Thu, 20 April 2023 19:17
Thanks, however the base classes I provided could still be relevant with a few modifications
To be more in line with what you're suggesting , possibly functions passed to it as the easing


Those are trivialities. Obviously you need some time based transition to animate, but that is not the problem.

Problem is that following code:

Quote:

Color start_color = SColorFace();
Color end_color = SColorHighlight();
Color current_color = animation.LerpColor(start_color, end_color);


cannot be code. It has to be parametrised so it can be replaced it with any (or no) animation

Think about Button. Its look (and feel) is parametrized as

	struct Style : ChStyle<Style> {
		Value look[4];
		Color monocolor[4], textcolor[4];
		Point pressoffset;
		int   focusmargin;
		int   overpaint;
		Font  font;
		Image ok, cancel, exit;
		bool  transparent;
		bool  focus_use_ok;
	};


Now buton has 4 basic states (normal, hot (when mouse is over), pushed, disabled). Proper animation support most provide transition beween any 2 of them (that is 12 transitions if I count right) while allowing to set such animation in Style somehow and also while not singificantly complicating Option::Draw. Ideally, animation code, if any, should be completely outside of Option code.

EDIT: Moreover, it needs correct transitions between partial states (e.g. user moves mouse over, so hot state ends before animation is complete).

Mirek

[Updated on: Thu, 20 April 2023 21:53]

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
Previous Topic: AsyncWork and pick/std::move problems...
Next Topic: U++ GTK Wayland Port
Goto Forum:
  


Current Time: Sat Jul 12 20:55:46 CEST 2025

Total time taken to generate the page: 0.04364 seconds