forge
Explore
Log in

Don't you dare go Hollow

Update progress says what it is: 'Downloading update' / 'Installing update' above the bar

Browse files at this commit

7a892d6a2d3bfa5f663fffb41ea5d98e9379ffc9Ahmet Kaan GümüşParent: e541d69
  • style
    • update progress says what it is: 'Downloading update' / 'Installing update' above the bar
Show full message
💄 style: update progress says what it is: 'Downloading update' / 'Installing update' above the bar
crates/client/lang/en/update.txtmodified+2 -2
@@ -2,6 +2,6 @@ update = Update
22 restart = Restart
33 retry = Retry
44 required = Update required
5-downloading = Downloading
6-installing = Installing
5+downloading = Downloading update
6+installing = Installing update
77 restarting = Restarting
crates/client/lang/tr/update.txtmodified+2 -2
@@ -2,6 +2,6 @@ update = Güncelle
22 restart = Yeniden başlat
33 retry = Tekrar dene
44 required = Güncelleme gerekli
5-downloading = İndiriliyor
6-installing = Kuruluyor
5+downloading = Güncelleme indiriliyor
6+installing = Güncelleme kuruluyor
77 restarting = Yeniden başlatılıyor
crates/client/src/gui/update_view.rsmodified+16 -9
@@ -11,6 +11,15 @@ fn percent(fraction: f32) -> String {
1111 format!("{}%", (fraction * 100.) as u32)
1212 }
1313
14+fn status(phase: Phase) -> &'static str {
15+ match phase {
16+ Phase::Downloading { .. } => w().update.downloading,
17+ Phase::Installing { .. } => w().update.installing,
18+ Phase::Ready(_) => w().update.restarting,
19+ _ => "",
20+ }
21+}
22+
1423 impl Yumush {
1524 pub(super) fn update_control(&self, palette: Palette) -> Option<AnyElement> {
1625 if self.update.required() {
@@ -27,15 +36,18 @@ impl Yumush {
2736 return Some(
2837 div()
2938 .flex()
30- .items_center()
31- .gap(px(space::SM))
32- .child(parts::track(parts::Fill::Part(fraction), false, t).flex_1())
39+ .flex_col()
40+ .gap(px(space::XS))
3341 .child(
3442 div()
43+ .flex()
44+ .justify_between()
3545 .text_size(t.text(text::CAPTION))
3646 .text_color(palette.muted)
47+ .child(status(self.update))
3748 .child(percent(fraction)),
3849 )
50+ .child(parts::track(parts::Fill::Part(fraction), false, t))
3951 .into_any_element(),
4052 );
4153 }
@@ -60,12 +72,7 @@ impl Yumush {
6072
6173 pub(super) fn update_required(&self, palette: Palette) -> impl IntoElement {
6274 let t = palette.tokens;
63- let status = match self.update {
64- Phase::Downloading { .. } => w().update.downloading,
65- Phase::Installing { .. } => w().update.installing,
66- Phase::Ready(_) => w().update.restarting,
67- _ => "",
68- };
75+ let status = status(self.update);
6976 let label = match self.update.progress() {
7077 Some(fraction) => format!("{status} {}", percent(fraction)),
7178 None => status.to_string(),