Skip to content

Commit

Permalink
set LXGW as default font and fixed some aesthetic problems
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Feb 26, 2023
1 parent 15f8e4c commit 3cf665a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 29 deletions.
16 changes: 0 additions & 16 deletions src/gui/components/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ pub fn ip_version_radios(
)
.font(font)
.size(15)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
Expand Down Expand Up @@ -67,8 +65,6 @@ pub fn transport_protocol_radios(
)
.font(font)
.size(15)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
Expand Down Expand Up @@ -98,8 +94,6 @@ pub fn language_radios(
)
.spacing(7)
.font(font)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.size(15)
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
Expand Down Expand Up @@ -141,8 +135,6 @@ pub fn sound_packets_threshold_radios(
.spacing(7)
.font(font)
.size(15)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
Expand Down Expand Up @@ -180,8 +172,6 @@ pub fn sound_bytes_threshold_radios(
.spacing(7)
.font(font)
.size(15)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
Expand Down Expand Up @@ -219,8 +209,6 @@ pub fn sound_favorite_radios(
.spacing(7)
.font(font)
.size(15)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
Expand Down Expand Up @@ -256,8 +244,6 @@ pub fn chart_radios(
.spacing(7)
.font(font)
.size(15)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
Expand Down Expand Up @@ -293,8 +279,6 @@ pub fn report_radios(
.spacing(7)
.font(font)
.size(15)
// fix Simplified Chinese display
.width(Length::Fixed(100.0))
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/pages/overview_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::utility::get_formatted_strings::{
get_active_filters_string, get_active_filters_string_nobr, get_app_count_string,
get_connection_color, get_formatted_bytes_string, get_percentage_string, get_report_path,
};
use crate::utility::style_constants::{get_font, HEIGHT_BODY, ICONS, INCONSOLATA_BOLD, LXGW_MONO_LITE_BOLD};
use crate::utility::style_constants::{get_font, HEIGHT_BODY, ICONS, LXGW_MONO_LITE_BOLD};
use crate::utility::translations::{
error_translation, filtered_application_translation, filtered_bytes_translation,
filtered_packets_translation, no_addresses_translation, no_favorites_translation,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/pages/settings_style_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fn get_palette_container(
Button::new(content)
.height(Length::Fixed(130.0))
.width(Length::Fixed(360.0))
.padding(10)
.padding(5)
.style(StyleTuple(style, ElementType::BorderedRound).into())
.on_press(Message::Style(on_press))
}
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ pub fn main() -> iced::Result {
&config_settings,
&config_device,
),
default_font: Some(include_bytes!("../resources/fonts/inconsolata-regular.ttf")),
default_font: Some(include_bytes!(
"../resources/fonts/LXGWWenKaiMonoLite-Regular.ttf"
)),
default_text_size: FONT_SIZE_BODY,
text_multithreading: true,
antialiasing: false,
Expand Down
4 changes: 3 additions & 1 deletion src/structs/traffic_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use plotters_iced::{Chart, ChartBuilder, ChartWidget, DrawingBackend};

use crate::enums::message::Message;
use crate::structs::palette::to_rgb_color;
use crate::utility::style_constants::{get_color_mix_chart, CHARTS_LINE_BORDER, INCONSOLATA_BOLD, LXGW_MONO_LITE_BOLD};
use crate::utility::style_constants::{
get_color_mix_chart, CHARTS_LINE_BORDER, LXGW_MONO_LITE_BOLD,
};
use crate::utility::translations::{incoming_translation, outgoing_translation};
use crate::{get_colors, ChartType, Language, RunTimeData, StyleType};

Expand Down
16 changes: 8 additions & 8 deletions src/utility/style_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ pub const MON_AMOUR_STYLE: Palette = Palette {
// name: "inconsolata_regular",
// bytes: include_bytes!("../../fonts/inconsolata-regular.ttf"),
// };
pub const INCONSOLATA_BOLD: Font = Font::External {
name: "inconsolata_bold",
bytes: include_bytes!("../../resources/fonts/inconsolata-bold.ttf"),
};
// pub const INCONSOLATA_BOLD: Font = Font::External {
// name: "inconsolata_bold",
// bytes: include_bytes!("../../resources/fonts/inconsolata-bold.ttf"),
// };

pub const LXGW_MONO_LITE_BOLD: Font = Font::External {
name: "lxgw_lite_bold",
Expand Down Expand Up @@ -182,10 +182,10 @@ pub const DEEP_SEA: &[u8] = include_bytes!("../../resources/palettes/DeepSea.png
pub const MON_AMOUR: &[u8] = include_bytes!("../../resources/palettes/MonAmour.png");

// font sizes
pub const FONT_SIZE_FOOTER: f32 = 15.0;
pub const FONT_SIZE_BODY: f32 = 18.0;
pub const FONT_SIZE_SUBTITLE: f32 = 22.0;
pub const FONT_SIZE_TITLE: f32 = 24.0;
pub const FONT_SIZE_FOOTER: f32 = 17.0;
pub const FONT_SIZE_BODY: f32 = 20.0;
pub const FONT_SIZE_SUBTITLE: f32 = 23.0;
pub const FONT_SIZE_TITLE: f32 = 25.0;

// border styles
pub const BORDER_WIDTH: f32 = 2.0;
Expand Down
2 changes: 1 addition & 1 deletion src/utility/translations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn traffic_rate_translation(language: Language) -> Text<'static> {
Language::ES => "Tasa de tráfico:",
Language::PL => "Prędkość ruchu:",
Language::DE => "Daten Frequenz:",
Language::CN => "网络速率图",
Language::CN => "网络速率图:",
})
}

Expand Down

0 comments on commit 3cf665a

Please sign in to comment.