Skip to content

Popup #462

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Popup #462

wants to merge 18 commits into from

Conversation

Guocork
Copy link
Contributor

@Guocork Guocork commented Apr 9, 2025

2025-04-23.12-14-29.webm

@Guocork Guocork marked this pull request as draft April 9, 2025 12:17
@Guocork Guocork marked this pull request as ready for review April 14, 2025 07:49
@alanpoon
Copy link
Contributor

@alanpoon
Copy link
Contributor

for (live_file) in cx .live_registry .clone() .borrow_mut() .live_files.iter_mut() { for live_node in &mut live_file.expanded.nodes { if live_node.id.to_string() == "duration" { live_node.value = LiveValue::Float64(9.0); } } }

I've found a way to dynamically update the animation's duration. You find the correct liveId and the correct condition to compute and update the required height.

@Guocork
Copy link
Contributor Author

Guocork commented Apr 23, 2025

To test the component effects, I added two triggers — one when logging in, and another when sending a message in a room — both will trigger a popup.

@alanpoon
Copy link
Contributor

alanpoon commented Apr 28, 2025

https://gist.github.com/alanpoon/be43c184ee90bec5992148d5b132fc5e

Added:

  1. live duration
  2. VecQueue closure for the popup notification
  3. event.hits_with_capture_overload
Screen.Recording.2025-04-29.at.5.02.04.PM.mov

You need to

  1. support Long text in your notifications, using text wrap.
  2. You removed, if self.opened { let _ = self.content.draw_all(cx, scope); } You need to think of ways to optimize the draw_walk and handle_event function when the popup is idle.

///
/// The function does not handle the case where the live file or the nodes
/// do not exist, because this should not happen in normal usage.
fn use_live_duration(&mut self, cx: &mut Cx) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alanpoon This method can set the value in the node, but when I change the value of duration, the animation doesn't play according to the new setting. That's weird. I'm guessing the animation value might have already been set before I made the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants