mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
animate progress function on value changed only
This commit is contained in:
parent
0f5a990105
commit
323cb72a6f
1 changed files with 33 additions and 33 deletions
|
|
@ -61,12 +61,11 @@ impl Request {
|
|||
|
||||
// Actions
|
||||
pub fn update(&self, progress_fraction: Option<f64>) {
|
||||
// Skip Non value
|
||||
// Skip update animation for Non value
|
||||
if let Some(value) = progress_fraction {
|
||||
// Update shared fraction value for async progressbar animation
|
||||
self.progress.fraction.replace(value);
|
||||
|
||||
// Start new frame on previous process completed only (`source_id` is None)
|
||||
// Update shared fraction value for async progressbar function, animate on changed only
|
||||
if value != self.progress.fraction.replace(value) {
|
||||
// Start new frame on previous process function completed (`source_id` changed to None)
|
||||
// If previous process still active, we have just updated shared fraction value before, to use it inside the active process
|
||||
if self.progress.source_id.borrow().is_none() {
|
||||
// Start new animation frame iterator, update `source_id`
|
||||
|
|
@ -101,6 +100,7 @@ impl Request {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setters
|
||||
pub fn set_text(&self, value: &GString, activate: bool) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue