diff --git a/crates/client/lang/en/update.txt b/crates/client/lang/en/update.txt index 97c9fcc..50440ad 100644 --- a/crates/client/lang/en/update.txt +++ b/crates/client/lang/en/update.txt @@ -2,6 +2,6 @@ update = Update restart = Restart retry = Retry required = Update required -downloading = Downloading -installing = Installing +downloading = Downloading update +installing = Installing update restarting = Restarting diff --git a/crates/client/lang/tr/update.txt b/crates/client/lang/tr/update.txt index a711e56..5bf4160 100644 --- a/crates/client/lang/tr/update.txt +++ b/crates/client/lang/tr/update.txt @@ -2,6 +2,6 @@ update = Güncelle restart = Yeniden başlat retry = Tekrar dene required = Güncelleme gerekli -downloading = İndiriliyor -installing = Kuruluyor +downloading = Güncelleme indiriliyor +installing = Güncelleme kuruluyor restarting = Yeniden başlatılıyor diff --git a/crates/client/src/gui/update_view.rs b/crates/client/src/gui/update_view.rs index af6d5f8..eba6b95 100644 --- a/crates/client/src/gui/update_view.rs +++ b/crates/client/src/gui/update_view.rs @@ -11,6 +11,15 @@ fn percent(fraction: f32) -> String { format!("{}%", (fraction * 100.) as u32) } +fn status(phase: Phase) -> &'static str { + match phase { + Phase::Downloading { .. } => w().update.downloading, + Phase::Installing { .. } => w().update.installing, + Phase::Ready(_) => w().update.restarting, + _ => "", + } +} + impl Yumush { pub(super) fn update_control(&self, palette: Palette) -> Option { if self.update.required() { @@ -27,15 +36,18 @@ impl Yumush { return Some( div() .flex() - .items_center() - .gap(px(space::SM)) - .child(parts::track(parts::Fill::Part(fraction), false, t).flex_1()) + .flex_col() + .gap(px(space::XS)) .child( div() + .flex() + .justify_between() .text_size(t.text(text::CAPTION)) .text_color(palette.muted) + .child(status(self.update)) .child(percent(fraction)), ) + .child(parts::track(parts::Fill::Part(fraction), false, t)) .into_any_element(), ); } @@ -60,12 +72,7 @@ impl Yumush { pub(super) fn update_required(&self, palette: Palette) -> impl IntoElement { let t = palette.tokens; - let status = match self.update { - Phase::Downloading { .. } => w().update.downloading, - Phase::Installing { .. } => w().update.installing, - Phase::Ready(_) => w().update.restarting, - _ => "", - }; + let status = status(self.update); let label = match self.update.progress() { Some(fraction) => format!("{status} {}", percent(fraction)), None => status.to_string(),