From 7a892d6a2d3bfa5f663fffb41ea5d98e9379ffc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 1 Dec 2026 03:19:00 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20update=20progress=20say?= =?UTF-8?q?s=20what=20it=20is:=20'Downloading=20update'=20/=20'Installing?= =?UTF-8?q?=20update'=20above=20the=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/lang/en/update.txt | 4 ++-- crates/client/lang/tr/update.txt | 4 ++-- crates/client/src/gui/update_view.rs | 25 ++++++++++++++++--------- 3 files changed, 20 insertions(+), 13 deletions(-) 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(),