mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35: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
|
// Actions
|
||||||
pub fn update(&self, progress_fraction: Option<f64>) {
|
pub fn update(&self, progress_fraction: Option<f64>) {
|
||||||
// Skip Non value
|
// Skip update animation for Non value
|
||||||
if let Some(value) = progress_fraction {
|
if let Some(value) = progress_fraction {
|
||||||
// Update shared fraction value for async progressbar animation
|
// Update shared fraction value for async progressbar function, animate on changed only
|
||||||
self.progress.fraction.replace(value);
|
if value != self.progress.fraction.replace(value) {
|
||||||
|
// Start new frame on previous process function completed (`source_id` changed to None)
|
||||||
// Start new frame on previous process completed only (`source_id` is None)
|
|
||||||
// If previous process still active, we have just updated shared fraction value before, to use it inside the active process
|
// 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() {
|
if self.progress.source_id.borrow().is_none() {
|
||||||
// Start new animation frame iterator, update `source_id`
|
// Start new animation frame iterator, update `source_id`
|
||||||
|
|
@ -101,6 +100,7 @@ impl Request {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
pub fn set_text(&self, value: &GString, activate: bool) {
|
pub fn set_text(&self, value: &GString, activate: bool) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue