This commit is contained in:
Ward from fusion-voyager-3 2024-01-16 18:00:23 +03:00
parent b0faa05918
commit 89079b6de4

View File

@ -1,3 +1,4 @@
use gtk::pango::Language;
// Use libraries
/// Use all gtk4 libraries (gtk4 -> gtk because cargo)
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
@ -22,7 +23,7 @@ pub fn language_page(content_stack: &gtk::Stack) {
// the header text for the language page
let language_header_text = gtk::Label::builder()
.label("language to PikaOS")
.label("Select a language")
.halign(gtk::Align::End)
.hexpand(true)
.margin_top(15)
@ -34,7 +35,7 @@ pub fn language_page(content_stack: &gtk::Stack) {
// the header icon for the language icon
let language_header_icon = gtk::Image::builder()
.icon_name("debian-swirl")
.icon_name("locale")
.halign(gtk::Align::Start)
.hexpand(true)
.pixel_size(78)
@ -46,8 +47,7 @@ pub fn language_page(content_stack: &gtk::Stack) {
// make language selection box for choosing installation or live media
let language_selection_box = gtk::Box::builder()
.orientation(Orientation::Horizontal)
.spacing(200)
.orientation(Orientation::Vertical)
.build();
// / language_header_box appends
@ -61,11 +61,47 @@ pub fn language_page(content_stack: &gtk::Stack) {
//// Add the language selection/page content box to language main box
language_main_box.append(&language_selection_box);
// text above language selection box
let language_selection_text = gtk::Label::builder()
.label("Please select a locale for the system to use")
.halign(gtk::Align::Center)
.hexpand(true)
.margin_top(15)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.build();
language_selection_text.add_css_class("medium_sized_text");
let language_selection_expander_row = adw::ExpanderRow::builder()
.margin_top(15)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.title("Locale")
.build();
let locales = ["en_US", "russian", "en_GB"];
let null_checkbutton = gtk::CheckButton::builder()
.label("No locale selected")
.build();
language_selection_expander_row.add_row(&null_checkbutton);
for locale in locales {
let locale_label = gtk::CheckButton::builder()
.label(locale)
.build();
locale_label.set_group(Some(&null_checkbutton));
language_selection_expander_row.add_row(&locale_label);
}
// / language_selection_box appends
//// add live and install media button to language page selections
// language_selection_box.append(&live_media_button);
// language_selection_box.append(&install_media_button);
//// add text and and entry to language page selections
language_selection_box.append(&language_selection_text);
language_selection_box.append(&language_selection_expander_row);
// / language_header_box appends
//// Add the language page header text and icon