From 8d327ff9df8264936d5bcb86a197d52a53851652 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 4 Jul 2025 21:20:46 +0300 Subject: [PATCH] format bytes on page preload --- src/app/browser/window/tab/item/client/driver/nex.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/browser/window/tab/item/client/driver/nex.rs b/src/app/browser/window/tab/item/client/driver/nex.rs index 2391173a..a10b9797 100644 --- a/src/app/browser/window/tab/item/client/driver/nex.rs +++ b/src/app/browser/window/tab/item/client/driver/nex.rs @@ -1,6 +1,7 @@ //! https://nightfall.city/nex/info/specification.txt use super::{Feature, Page}; +use crate::tool::{Format, uri_to_title}; use gtk::gio::{MemoryInputStream, SocketConnection}; use gtk::prelude::{ Cast, IOStreamExt, InputStreamExtManual, OutputStreamExtManual, SocketClientExt, @@ -189,9 +190,12 @@ impl Nex { if loading_total.replace(t) > 102400 { let mut l = loading.borrow_mut(); match *l { - Some(ref this) => this.set_description( - Some(&format!("Preload: {t} bytes")), - ), + Some(ref this) => { + this.set_description(Some(&format!( + "Preload: {}", + t.bytes() + ))) + } None => { l.replace( p.content.to_status_loading(None), @@ -257,7 +261,6 @@ fn render( (p, f, u): (Rc, Rc, Uri), c: Cancellable, ) { - use crate::tool::uri_to_title; let q = u.path(); if is_image(&q) { p.window_action.find.simple_action.set_enabled(false);