Revert "Fixed a couple of bugs"

This reverts commit ec71cd5854.
This commit is contained in:
Giuliano Bellini s294739 2023-04-26 12:56:46 +02:00
parent ec71cd5854
commit 46302d208d
3 changed files with 10 additions and 20 deletions

View file

@ -28,8 +28,6 @@ pub fn footer(
let release_details_row =
get_release_details(language, style, font_footer, newer_release_available);
let symbols_font = get_symbols_font();
let footer_row = Row::new()
.width(Length::Fill)
.padding([0, 20])
@ -49,11 +47,8 @@ pub fn footer(
.push(
Text::new("❤")
.width(Length::Fixed(14.0))
.size(FONT_SIZE_FOOTER + match symbols_font {
Font::Default => 0.0,
_ => 4.0
})
.font(symbols_font)
.size(FONT_SIZE_FOOTER + 4.0)
.font(get_symbols_font())
)
.push(
Text::new(" by Giuliano Bellini")

View file

@ -1,8 +1,7 @@
use iced::Font;
use once_cell::sync::OnceCell;
use plotters::style::RGBColor;
use std::collections::HashMap;
use plotters::style::RGBColor;
use crate::translations::types::language::Language;
pub type FontsMap = HashMap<&'static str, Font>;
@ -28,12 +27,9 @@ const FONT_METADATA: [FontMetadata; 9] = [
async fn download_font(base_url: &str, metadata: &FontMetadata) -> Result<Font, reqwest::Error> {
let url = format!("{}/{}", base_url, metadata.file);
let client = reqwest::Client::builder().redirect(reqwest::redirect::Policy::none()).build()?;
let response = client.get(url).send().await?;
let content_type = response.headers().get(reqwest::header::CONTENT_TYPE).map(|ct| ct.to_str().unwrap_or("")).unwrap_or("");
let response = reqwest::get(url).await?;
if response.status() != reqwest::StatusCode::OK
|| content_type != "application/octet-stream" {
if response.status() == reqwest::StatusCode::NOT_FOUND {
return Ok(Font::Default);
}
@ -41,7 +37,7 @@ async fn download_font(base_url: &str, metadata: &FontMetadata) -> Result<Font,
let font_data = Box::new(bytes);
let font = Font::External {
name: metadata.name,
bytes: &*Box::leak(font_data)
bytes: &*Box::leak(font_data),
};
Ok(font)
}

View file

@ -209,9 +209,7 @@ pub fn get_open_report_tooltip(language: Language) -> String {
}
pub fn print_cli_welcome_message() {
let ver = format!("{:<8}", APP_VERSION);
println!(
print!(
r"
╔════════════════════════════════════════════════════════════════════╗
║ ███████╗███╗ ██╗██╗███████╗███████╗███╗ ██╗███████╗████████╗ ║
@ -223,11 +221,12 @@ pub fn print_cli_welcome_message() {
║ ▁▁▁▁▁▁▁▁▁▁▁▁▁ ║
║ ┃┌───────────┐┃ ║
║ ┃│ $ ver │┃ ║
║ ┃│ v{ver} │┃ ║
║ ┃│ v{APP_VERSION} │┃ ║
║ ┃└───────────┘┃________________________ ║
║ / ▭▭▭▭▭▭▭▭▭ ▣ \ by Giuliano Bellini ) ║
║ / ◻◻◻◻◻◻◻◻◻◻◻◻◻ \ / ║
║ (▁▁▁▁▁▁▁▭▭▭▁▁▁▁▁▁▁) =D-' ║
╚════════════════════════════════════════════════════════════════════╝"
╚════════════════════════════════════════════════════════════════════╝
"
);
}