This commit is contained in:
Valeria Fadeeva 2025-02-03 11:36:32 +05:00
parent d6d44fb844
commit bba0df5abd
2 changed files with 32 additions and 38 deletions

View File

@ -71,8 +71,8 @@ button.update_system_alter:
ru_RU.UTF-8: "Обновить систему \n(Eсли обновление с осноновной кнопки приводит к ошибке)" ru_RU.UTF-8: "Обновить систему \n(Eсли обновление с осноновной кнопки приводит к ошибке)"
button.update_system_overwrite: button.update_system_overwrite:
en: "Update system \n(If there are file conflicts that you want to overwrite on top.\nAll actions are at your own risk.)" en: "Update system \n(If there are file conflicts \nthat you want to overwrite on top.\nAll actions are at your own risk)"
ru_RU.UTF-8: "Обновить систему \n(Ecли существуют конфликты файлов, которые вы хотите перезаписать поверх.\nВсе действия вы совершаете на свой страх и риск.)" ru_RU.UTF-8: "Обновить систему \n(Ecли существуют конфликты файлов, \nкоторые вы хотите перезаписать поверх.\nВсе действия вы совершаете на свой страх и риск)"
button.unlock_repo_databases: button.unlock_repo_databases:
en: Unlock repo databases en: Unlock repo databases

View File

@ -14,12 +14,12 @@ use fltk::{
image::*, image::*,
menu::*, menu::*,
prelude::*, prelude::*,
terminal::{self, RedrawStyle}, text,
window::{DoubleWindow, Window}, window::{DoubleWindow, Window},
}; };
use fltk_theme::{ use fltk_theme::{
/*color_themes, widget_themes, ColorTheme, SchemeType,*/ ThemeType, /*color_themes, widget_themes, ColorTheme, SchemeType, */ ThemeType,
/*WidgetScheme,*/ WidgetTheme, /*WidgetScheme,*/ WidgetTheme,
}; };
@ -84,7 +84,7 @@ fn main() {
let padding: i32 = 10; let padding: i32 = 10;
let title_and_panel_h: i32 = 68; let title_and_panel_h: i32 = 36 * 2;
// let (w, h) = app::screen_size(); // let (w, h) = app::screen_size();
// println!("{} {}", w, h); // println!("{} {}", w, h);
@ -105,6 +105,7 @@ fn main() {
} }
} }
width = width / 3 * 2 as i32;
height = height - title_and_panel_h; height = height - title_and_panel_h;
let application = App::default(); let application = App::default();
@ -768,48 +769,41 @@ fn main() {
// ----------------------------------------------------------- // -----------------------------------------------------------
let mut grp_about = Flex::default_fill().with_label(&t!("tab.about")).row(); let mut grp_about = Flex::default_fill().with_label(&t!("tab.about")).row();
// grp_about.set_margin(padding); grp_about.set_margin(padding);
grp_about.set_pad(padding); grp_about.set_pad(padding);
if locale == "ru_RU.UTF-8" { let about_filename = if locale == "ru_RU.UTF-8" {
let mut term = terminal::Terminal::default_fill(); "/usr/share/melawy-linux-welcome/assets/text/about_ru.txt"
term.set_color(Color::Light1); } else {
term.set_text_color(Color::Gray0); "/usr/share/melawy-linux-welcome/assets/text/about_en.txt"
term.set_redraw_style(RedrawStyle::PerWrite); };
if let Ok(lines) = read_lines("/usr/share/melawy-linux-welcome/assets/text/about_ru.txt") { let mut buf = text::TextBuffer::default();
// Получает итератор, который возвращает Option buf.set_text("");
for line in lines {
if let Ok(text_string) = line { let mut term = text::TextDisplay::default_fill();
term.append(format!("{}\n", text_string).as_str()); term.set_color(Color::Light1);
} term.set_text_color(Color::Gray0);
if let Ok(lines) = read_lines(about_filename) {
// Получает итератор, который возвращает Option
for line in lines {
if let Ok(text_string) = line {
buf.append(format!("{}\n", text_string).as_str());
} }
} }
let copyright = format!("\n(с) Валерия Фадеева, 2023 - {}\n", current_year.clone());
term.append(copyright.as_str());
} }
// -----------------------------------------------------------
else {
let mut term = terminal::Terminal::default_fill();
term.set_color(Color::Light1);
term.set_text_color(Color::Gray0);
term.set_redraw_style(RedrawStyle::PerWrite);
if let Ok(lines) = read_lines("/usr/share/melawy-linux-welcome/assets/text/about_en.txt") { let copyright = if locale == "ru_RU.UTF-8" {
// Получает итератор, который возвращает Option format!("\n(с) Валерия Фадеева, 2023 - {}\n", current_year.clone())
for line in lines { } else {
if let Ok(text_string) = line { format!("\n(с) Valeria Fadeeva, 2023 - {}\n", current_year.clone())
term.append(format!("{}\n", text_string).as_str()); };
}
}
}
let copyright = format!("\n(с) Valeria Fadeeva, 2023 - {}\n", current_year.clone()); buf.append(copyright.as_str());
term.append(copyright.as_str()); term.set_buffer(buf);
} term.wrap_mode(text::WrapMode::AtBounds, 0);
grp_about.end(); grp_about.end();