-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting a default easing function in Style
#5463
Comments
I would also like this, but the problem with this solution would be that Style is De/Serializable and there is no way to to serialize a function :/ we could of course just set the default easings when deserializing but that would suck. An alternative approach would be to add an |
I thought that was okay, because Lines 240 to 241 in 27a5803
Lines 19 to 21 in 27a5803
But I personally like the enum idea :). |
Ah, good point, also I think serde support here isn't super important, since the biggest usecase is probably for exporting / importing ui themes and I don't think a lot of egui Apps do that. |
Is your feature request related to a problem? Please describe.
Developer may prefer using certain easing function because of branding, coherence with easing used by rest of the system or personal preference. But now, the built-in animations such as
SidePanel::show_animated
orCollapsingHeader
use the default, non-customizable easing.Describe the solution you'd like
I would add new field to
Style
, something likeeasing
being a struct containing three easing functions:ease_out
,ease_in
andease_in_out
. The built-in widgets would use these easing functions by default (eg.animate_bool_responsive
would useease_out
).Additionally, widgets built by the community could also use these default easings, making animations customizable while keeping them consistent.
Describe alternatives you've considered
ease_out
function in the style, because AFAIK ease-in isn't used anywhere in egui right now. This would also eliminate the need for something like anEasings
struct.The text was updated successfully, but these errors were encountered: