Skip to content

Commit

Permalink
fix: missing chars, language page structure, Swedish code
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed May 24, 2023
1 parent 9e76db3 commit 4791963
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 172 deletions.
7 changes: 3 additions & 4 deletions resources/fonts/full/subset_characters.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

!
"
#
Expand Down Expand Up @@ -94,18 +94,17 @@ z
}
¡
¿
Ä
Ê
Î
Å
Ä
Ö
Ü
à
á
â
ã
å
ä
å
ç
è
é
Expand Down
Binary file modified resources/fonts/subset/sarasa-mono-sc-bold.subset.ttf
Binary file not shown.
Binary file modified resources/fonts/subset/sarasa-mono-sc-regular.subset.ttf
Binary file not shown.
46 changes: 25 additions & 21 deletions src/gui/components/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::notifications::types::sound::Sound;
use crate::translations::translations::{
ip_version_translation, sound_translation, transport_protocol_translation,
};
use crate::utils::countries::get_flag_from_language_code;
use crate::utils::countries::get_flag_from_language;
use crate::{ChartType, IpVersion, Language, StyleType, TransProtocol};

pub fn ip_version_radios(
Expand Down Expand Up @@ -83,29 +83,33 @@ pub fn language_radios(
collection: &[Language],
font: Font,
style: StyleType,
) -> Column<'static, Message> {
let mut ret_val = Column::new().spacing(10);
) -> Row<'static, Message> {
let mut ret_val = Row::new().spacing(10);
for option in collection {
ret_val = ret_val.push(
Row::new()
.align_items(Alignment::Center)
.push(
Radio::new(
format!("{} ({:?})", option.get_radio_label(), option),
*option,
Some(active),
Message::LanguageSelection,
Row::new().align_items(Alignment::Center).push(
Row::new()
.width(Length::Fixed(180.0))
.push(
Radio::new(
format!("{} ({:?})", option.get_radio_label(), option),
*option,
Some(active),
Message::LanguageSelection,
)
.spacing(7)
.font(font)
.size(15)
.style(
<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
)),
),
)
.spacing(7)
.font(font)
.size(15)
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
))),
)
.push(horizontal_space(Length::Fixed(8.0)))
.push(get_flag_from_language_code(&format!("{option:?}"))),
.push(horizontal_space(Length::Fixed(8.0)))
.push(get_flag_from_language(*option)),
),
);
}
ret_val
Expand Down
31 changes: 17 additions & 14 deletions src/gui/pages/settings_language_page.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use iced::widget::{Column, Container, Row, Text};
use iced::widget::{Column, Container, Text};
use iced::Length::Fixed;
use iced::{Alignment, Length};
use iced_native::widget::vertical_space;
Expand All @@ -18,17 +18,20 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message> {
let font = get_font(sniffer.style);

let language_active = sniffer.language;
let col_language_radio_1 =
language_radios(language_active, &Language::COL1, font, sniffer.style);
let col_language_radio_2 =
language_radios(language_active, &Language::COL2, font, sniffer.style);
let col_language_radio_3 =
language_radios(language_active, &Language::COL3, font, sniffer.style);
let row_language_radio = Row::new()
.spacing(50)
.push(col_language_radio_1)
.push(col_language_radio_2)
.push(col_language_radio_3);
let row_language_radio_1 =
language_radios(language_active, &Language::ROW1, font, sniffer.style);
let row_language_radio_2 =
language_radios(language_active, &Language::ROW2, font, sniffer.style);
let row_language_radio_3 =
language_radios(language_active, &Language::ROW3, font, sniffer.style);
let row_language_radio_4 =
language_radios(language_active, &Language::ROW4, font, sniffer.style);
let col_language_radio_all = Column::new()
.spacing(20)
.push(row_language_radio_1)
.push(row_language_radio_2)
.push(row_language_radio_3)
.push(row_language_radio_4);

let mut content = Column::new()
.align_items(Alignment::Center)
Expand Down Expand Up @@ -58,7 +61,7 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message> {
)
.push(vertical_space(Fixed(20.0)));

if ![Language::EN, Language::IT].contains(&sniffer.language) {
if ![Language::EN, Language::IT, Language::SV].contains(&sniffer.language) {
content = content
.push(
Container::new(
Expand All @@ -73,7 +76,7 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message> {
.push(vertical_space(Fixed(20.0)));
}

content = content.push(row_language_radio);
content = content.push(col_language_radio_all);

Container::new(content)
.height(Fixed(400.0))
Expand Down
Loading

0 comments on commit 4791963

Please sign in to comment.