mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-09 09:54:14 +00:00
rename method
This commit is contained in:
parent
3f67c93c3d
commit
9a916ed1a3
@ -276,7 +276,7 @@ impl Page {
|
|||||||
/// Update `Self` witch children components
|
/// Update `Self` witch children components
|
||||||
pub fn update(&self) {
|
pub fn update(&self) {
|
||||||
// Update components
|
// Update components
|
||||||
self.navigation.update(self.progress_fraction());
|
self.navigation.update(self.to_progress_fraction());
|
||||||
// @TODO self.content.update();
|
// @TODO self.content.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,8 +364,9 @@ impl Page {
|
|||||||
self.title.borrow().clone()
|
self.title.borrow().clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get value for progress bar, depending on `Self::Status`
|
/// Convert `Self` to `progress-fraction` presentation
|
||||||
pub fn progress_fraction(&self) -> Option<f64> {
|
/// * see also: [Entry](https://docs.gtk.org/gtk4/property.Entry.progress-fraction.html)
|
||||||
|
pub fn to_progress_fraction(&self) -> Option<f64> {
|
||||||
// Interpret status to progress fraction
|
// Interpret status to progress fraction
|
||||||
match *self.status.borrow() {
|
match *self.status.borrow() {
|
||||||
Status::Reload | Status::SessionRestore => Some(0.0),
|
Status::Reload | Status::SessionRestore => Some(0.0),
|
||||||
@ -385,7 +386,7 @@ impl Page {
|
|||||||
|
|
||||||
/// Get `Self` loading status
|
/// Get `Self` loading status
|
||||||
pub fn is_loading(&self) -> bool {
|
pub fn is_loading(&self) -> bool {
|
||||||
match self.progress_fraction() {
|
match self.to_progress_fraction() {
|
||||||
Some(progress_fraction) => progress_fraction < 1.0,
|
Some(progress_fraction) => progress_fraction < 1.0,
|
||||||
None => false,
|
None => false,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user