From ed6b014aacf75ace97f6f76758ccca630825f776 Mon Sep 17 00:00:00 2001 From: Maciek <108873945+rozwader@users.noreply.github.com> Date: Fri, 2 Oct 2026 10:23:02 +0200 Subject: [PATCH] chore: deleted icons from stats views (#906) --- .../src/view/app/analytics/tiles.rs | 79 +++++-------------- .../src/view/app/clusters/instance/cards.rs | 2 +- .../src/view/app/clusters/instance/create.rs | 2 +- .../src/view/app/clusters/instance/data.rs | 4 - .../src/view/app/clusters/instance/edit.rs | 2 +- .../src/view/app/clusters/instance/shell.rs | 10 +-- .../src/view/app/clusters/instance/steps.rs | 2 +- 7 files changed, 27 insertions(+), 74 deletions(-) diff --git a/packages/oneclient_app/src/view/app/analytics/tiles.rs b/packages/oneclient_app/src/view/app/analytics/tiles.rs index 43234dc2..99bd10d0 100644 --- a/packages/oneclient_app/src/view/app/analytics/tiles.rs +++ b/packages/oneclient_app/src/view/app/analytics/tiles.rs @@ -42,7 +42,6 @@ impl Component for TilesRow { }; let hero = hero_tile( - IconType::ClockRewind, "Total playtime", format_duration(stats.total_secs), format!( @@ -53,32 +52,15 @@ impl Component for TilesRow { ); let mut rest = vec![ - stat_tile(IconType::Play, "Sessions", stats.session_count.to_string()), + stat_tile("Sessions", stats.session_count.to_string()), + stat_tile("Avg / session", format_duration(avg_session)), stat_tile( - IconType::Sliders04, - "Avg / session", - format_duration(avg_session), - ), - stat_tile( - IconType::Maximize01, "Longest session", format_duration(stats.longest_session_secs), ), - stat_tile( - IconType::Rocket02, - "Day streak", - streak_value(stats.current_streak), - ), - stat_tile( - IconType::CheckCircle, - "Best streak", - streak_value(stats.longest_streak), - ), - stat_tile( - IconType::Calendar, - "Days played", - stats.active_days.to_string(), - ), + stat_tile("Day streak", streak_value(stats.current_streak)), + stat_tile("Best streak", streak_value(stats.longest_streak)), + stat_tile("Days played", stats.active_days.to_string()), ]; let mut root = rect().vertical().width(Size::fill()).spacing(TILE_GAP); @@ -135,18 +117,7 @@ fn streak_value(days: usize) -> String { format!("{days}d") } -fn icon_chip(icon: IconType, size: f32, tint: Color) -> Element { - rect() - .width(Size::px(size)) - .height(Size::px(size)) - .corner_radius(CornerRadius::new_all(size * 0.5)) - .background(tint.with_a(38)) - .center() - .child(Icon::new(icon).size(size * 0.52).color(tint)) - .into_element() -} - -fn hero_tile(icon: IconType, caption: &str, value: String, note: String) -> Element { +fn hero_tile(caption: &str, value: String, note: String) -> Element { card() .width(Size::fill()) .height(Size::fill()) @@ -154,18 +125,11 @@ fn hero_tile(icon: IconType, caption: &str, value: String, note: String) -> Elem .background(colors::brand().with_a(18)) .border(border_all_color(1., colors::brand().with_a(90))) .child( - rect() - .horizontal() - .cross_align(Alignment::Center) - .spacing(8.) - .child(icon_chip(icon, 24., colors::brand())) - .child( - label() - .text(caption.to_string()) - .font_size(12.) - .font_weight(FontWeight::MEDIUM) - .color(colors::fg_secondary()), - ), + label() + .text(caption.to_string()) + .font_size(12.) + .font_weight(FontWeight::MEDIUM) + .color(colors::fg_secondary()), ) .child( rect() @@ -193,25 +157,18 @@ fn hero_tile(icon: IconType, caption: &str, value: String, note: String) -> Elem .into_element() } -fn stat_tile(icon: IconType, caption: &str, value: String) -> Element { +fn stat_tile(caption: &str, value: String) -> Element { card() .width(Size::fill()) .height(Size::fill()) .main_align(Alignment::SpaceBetween) .child( - rect() - .horizontal() - .cross_align(Alignment::Center) - .spacing(8.) - .child(icon_chip(icon, 24., colors::fg_secondary())) - .child( - label() - .text(caption.to_string()) - .font_size(12.) - .max_lines(1) - .width(Size::fill()) - .color(colors::fg_secondary()), - ), + label() + .text(caption.to_string()) + .font_size(12.) + .max_lines(1) + .width(Size::fill()) + .color(colors::fg_secondary()), ) .child( label() diff --git a/packages/oneclient_app/src/view/app/clusters/instance/cards.rs b/packages/oneclient_app/src/view/app/clusters/instance/cards.rs index e64cebc6..60cc0eb8 100644 --- a/packages/oneclient_app/src/view/app/clusters/instance/cards.rs +++ b/packages/oneclient_app/src/view/app/clusters/instance/cards.rs @@ -184,7 +184,7 @@ pub fn wide_card(card: WideCard) -> Element { .cross_align(Alignment::Center) .spacing(14.) .child(marker(selected, false)) - .child(Icon::new(icon).size(20.).color(if selected { + .child(Icon::new(icon).size(25.).color(if selected { colors::fg_primary() } else { colors::fg_secondary() diff --git a/packages/oneclient_app/src/view/app/clusters/instance/create.rs b/packages/oneclient_app/src/view/app/clusters/instance/create.rs index 1efec3df..a87c2d0a 100644 --- a/packages/oneclient_app/src/view/app/clusters/instance/create.rs +++ b/packages/oneclient_app/src/view/app/clusters/instance/create.rs @@ -157,7 +157,7 @@ impl Component for CreateInstanceModal { shell(Shell { rail: wizard_rail(wizard, &picks), - eyebrow: picks.progress(), + eyebrow: None, title: title.to_string(), subtitle, body: steps::body(wizard, &picks), diff --git a/packages/oneclient_app/src/view/app/clusters/instance/data.rs b/packages/oneclient_app/src/view/app/clusters/instance/data.rs index 7dd34168..3b8191da 100644 --- a/packages/oneclient_app/src/view/app/clusters/instance/data.rs +++ b/packages/oneclient_app/src/view/app/clusters/instance/data.rs @@ -78,10 +78,6 @@ impl Picks { (Some(loader), None) => loader.to_string(), } } - - pub fn progress(&self) -> String { - format!("Step {} of {}", self.index + 1, self.steps.len()) - } } fn matches_filter(kind: GameVersionKind, filter: u8) -> bool { diff --git a/packages/oneclient_app/src/view/app/clusters/instance/edit.rs b/packages/oneclient_app/src/view/app/clusters/instance/edit.rs index 238523c7..73a20f70 100644 --- a/packages/oneclient_app/src/view/app/clusters/instance/edit.rs +++ b/packages/oneclient_app/src/view/app/clusters/instance/edit.rs @@ -116,7 +116,7 @@ impl Component for EditInstanceModal { ), tags, }), - eyebrow: "Instance details".to_string(), + eyebrow: Some("Instance details".to_string()), title: "Edit the instance".to_string(), subtitle: "Only how it is presented changes here. The version, loader and installed content stay as they are." .to_string(), diff --git a/packages/oneclient_app/src/view/app/clusters/instance/shell.rs b/packages/oneclient_app/src/view/app/clusters/instance/shell.rs index 4a601dcf..18a19a94 100644 --- a/packages/oneclient_app/src/view/app/clusters/instance/shell.rs +++ b/packages/oneclient_app/src/view/app/clusters/instance/shell.rs @@ -11,7 +11,7 @@ pub const PANE_PADDING: f32 = 24.; pub struct Shell { pub rail: Element, - pub eyebrow: String, + pub eyebrow: Option, pub title: String, pub subtitle: String, pub body: Element, @@ -101,7 +101,7 @@ pub fn shell(parts: Shell) -> Element { .into_element() } -fn header(eyebrow: String, title: String, subtitle: String, on_close: EventHandler<()>) -> Element { +fn header(eyebrow: Option, title: String, subtitle: String, on_close: EventHandler<()>) -> Element { rect() .horizontal() .width(Size::fill()) @@ -114,14 +114,14 @@ fn header(eyebrow: String, title: String, subtitle: String, on_close: EventHandl .vertical() .width(Size::flex(1.0)) .spacing(5.) - .child( + .maybe_child(eyebrow.map(|eyebrow| { label() .text(eyebrow) .font_size(11.) .font_weight(FontWeight::MEDIUM) .letter_spacing(1.6) - .color(colors::fg_secondary()), - ) + .color(colors::fg_secondary()) + })) .child( label() .text(title) diff --git a/packages/oneclient_app/src/view/app/clusters/instance/steps.rs b/packages/oneclient_app/src/view/app/clusters/instance/steps.rs index 05435ee5..95612996 100644 --- a/packages/oneclient_app/src/view/app/clusters/instance/steps.rs +++ b/packages/oneclient_app/src/view/app/clusters/instance/steps.rs @@ -57,7 +57,7 @@ fn type_step(mut wizard: Wizard, picks: &Picks) -> Element { let cards = [ ( TypeChoice::OneClient, - IconType::Rocket02, + IconType::IconLogo, "OneClient", Some("Recommended"), "The most bleeding edge performance, QoL mods and world hosting in one instance.",