From d07fa55060304e23c68b8ec3d698839e1ba36001 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Mon, 19 Feb 2024 22:55:41 +0300 Subject: [PATCH] RR: Rework Rows --- Cargo.lock | 2 +- Cargo.toml | 2 +- debian/changelog | 2 +- debian/control | 3 ++- src/automatic_partitioning/mod.rs | 4 ++-- src/keyboard_page/mod.rs | 2 +- src/language_page/mod.rs | 3 +++ src/timezone_page/mod.rs | 14 ++++++++++---- 8 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d89316c..36efec6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -807,7 +807,7 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "pika-installer-gtk4" -version = "1.0.0" +version = "1.0.1" dependencies = [ "async-channel", "duct", diff --git a/Cargo.toml b/Cargo.toml index 120f7ad..8e7d396 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pika-installer-gtk4" -version = "1.0.0" +version = "1.0.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/debian/changelog b/debian/changelog index c7c6f1a..aba3f06 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -pika-installer-gtk4 (1.0.0-100pika15) pikauwu; urgency=low +pika-installer-gtk4 (1.0.1-100pika1) pikauwu; urgency=low * First release diff --git a/debian/control b/debian/control index 59b462c..2707521 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,8 @@ Build-Depends: build-essential, libgtk-4-dev, desktop-file-utils, make, - libvte-2.91-gtk4-dev + libvte-2.91-gtk4-dev, + libgnome-desktop-4-dev, Rules-Requires-Root: no Package: pika-installer-gtk4 diff --git a/src/automatic_partitioning/mod.rs b/src/automatic_partitioning/mod.rs index 2b1489a..df10abb 100644 --- a/src/automatic_partitioning/mod.rs +++ b/src/automatic_partitioning/mod.rs @@ -78,9 +78,9 @@ pub fn automatic_partitioning( let devices_selection_expander_row_viewport = gtk::ScrolledWindow::builder().height_request(200).build(); - let devices_selection_expander_row_viewport_box = gtk::Box::builder() - .orientation(Orientation::Vertical) + let devices_selection_expander_row_viewport_box = gtk::ListBox::builder() .build(); + devices_selection_expander_row_viewport_box.add_css_class("boxed-list"); devices_selection_expander_row_viewport .set_child(Some(&devices_selection_expander_row_viewport_box)); diff --git a/src/keyboard_page/mod.rs b/src/keyboard_page/mod.rs index 64edd9a..899e5bb 100644 --- a/src/keyboard_page/mod.rs +++ b/src/keyboard_page/mod.rs @@ -202,7 +202,7 @@ pub fn keyboard_page(content_stack: >k::Stack) { keyboard_selection_expander_row_viewport_box.append(&keyboard_layout_row); keyboard_layout_checkbutton.connect_toggled(clone!(@weak keyboard_layout_checkbutton, @weak keyboard_selection_expander_row, @weak bottom_next_button, @weak keyboard_data_buffer => move |_| { if keyboard_layout_checkbutton.is_active() == true { - keyboard_selection_expander_row.set_title(&keyboard_layout); + keyboard_selection_expander_row.set_title(&keyboard_layout_row.title()); bottom_next_button.set_sensitive(true); keyboard_data_buffer.set_text(&keyboard_layout); Command::new("setxkbmap") diff --git a/src/language_page/mod.rs b/src/language_page/mod.rs index e862639..54673e8 100644 --- a/src/language_page/mod.rs +++ b/src/language_page/mod.rs @@ -17,6 +17,8 @@ use std::process::Stdio; use std::fs; use std::path::Path; +use gnome_desktop::*; + pub fn language_page(content_stack: >k::Stack) { // create the bottom box for next and back buttons let bottom_box = gtk::Box::builder() @@ -179,6 +181,7 @@ pub fn language_page(content_stack: >k::Stack) { let locale = locale.unwrap(); let locale_clone = locale.clone(); let locale_checkbutton = gtk::CheckButton::builder().label(locale.clone()).build(); + println!("{}", gnome_desktop::XkbInfo::new().languages_for_layout(&locale)); locale_checkbutton.set_group(Some(&null_checkbutton)); language_selection_expander_row_viewport_box.append(&locale_checkbutton); locale_checkbutton.connect_toggled(clone!(@weak locale_checkbutton, @weak language_selection_expander_row, @weak bottom_next_button, @weak lang_data_buffer => move |_| { diff --git a/src/timezone_page/mod.rs b/src/timezone_page/mod.rs index 697e620..abf69c0 100644 --- a/src/timezone_page/mod.rs +++ b/src/timezone_page/mod.rs @@ -127,9 +127,9 @@ pub fn timezone_page(content_stack: >k::Stack) { let timezone_selection_expander_row_viewport = gtk::ScrolledWindow::builder().height_request(200).build(); - let timezone_selection_expander_row_viewport_box = gtk::Box::builder() - .orientation(Orientation::Vertical) + let timezone_selection_expander_row_viewport_box = gtk::ListBox::builder() .build(); + timezone_selection_expander_row_viewport_box.add_css_class("boxed-list"); let timezone_selection_expander_row_viewport_listbox = gtk::ListBox::builder() .selection_mode(SelectionMode::None) @@ -177,10 +177,16 @@ pub fn timezone_page(content_stack: >k::Stack) { let timezone_layout = timezone_layout.unwrap(); let timezone_layout_clone = timezone_layout.clone(); let timezone_layout_checkbutton = gtk::CheckButton::builder() - .label(timezone_layout.clone()) + .valign(Align::Center) + .can_focus(false) .build(); + let timezone_layout_row = adw::ActionRow::builder() + .activatable_widget(&timezone_layout_checkbutton) + .title(timezone_layout.clone()) + .build(); + timezone_layout_row.add_prefix(&timezone_layout_checkbutton); timezone_layout_checkbutton.set_group(Some(&null_checkbutton)); - timezone_selection_expander_row_viewport_box.append(&timezone_layout_checkbutton); + timezone_selection_expander_row_viewport_box.append(&timezone_layout_row); timezone_layout_checkbutton.connect_toggled(clone!(@weak timezone_layout_checkbutton, @weak timezone_selection_expander_row, @weak bottom_next_button, @weak timezone_data_buffer => move |_| { if timezone_layout_checkbutton.is_active() == true { timezone_selection_expander_row.set_title(&timezone_layout);