Skip to content

Conversation

KongJian520
Copy link

@KongJian520 KongJian520 commented Sep 10, 2025

Description

This commit introduces two new properties for the Spinner control: speed and clockwise, allowing developers to customize the behavior of its rotation animation.

Major Changes

  • Added speed: Option<f64> and clockwise: Option<bool> fields to the Spinner structure.
  • Provided chainable speed() and clockwise() methods to facilitate setting these new properties.
  • In the ui method of the Widget implementation, unwrap_or is used to set default values ​​for these two properties to ensure they work correctly even when not explicitly set.
  • Modified the paint_at method signature to directly accept the processed speed and clockwise parameters to simplify the drawing logic.
  • In order to avoid affecting the effect of the original component, I Modify the loading in the image component to Spinner::new().paint_at(ui, rect, 1.0, true);()
  • I have followed the instructions in the PR template

@KongJian520 KongJian520 marked this pull request as ready for review September 10, 2025 12:34
Copy link

Preview available at https://egui-pr-preview.github.io/pr/7532-kongjian520feat-Spinner
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@KongJian520
Copy link
Author

@lucasmerlin I'm ready, thanks for the review

@lucasmerlin lucasmerlin added feature New feature or request egui labels Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

egui feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants