RR: Rework Rows

This commit is contained in:
Ward from fusion-voyager-3 2024-02-19 22:55:41 +03:00
parent 918c035edb
commit d07fa55060
8 changed files with 21 additions and 11 deletions

2
Cargo.lock generated
View File

@ -807,7 +807,7 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
[[package]]
name = "pika-installer-gtk4"
version = "1.0.0"
version = "1.0.1"
dependencies = [
"async-channel",
"duct",

View File

@ -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

2
debian/changelog vendored
View File

@ -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

3
debian/control vendored
View File

@ -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

View File

@ -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));

View File

@ -202,7 +202,7 @@ pub fn keyboard_page(content_stack: &gtk::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")

View File

@ -17,6 +17,8 @@ use std::process::Stdio;
use std::fs;
use std::path::Path;
use gnome_desktop::*;
pub fn language_page(content_stack: &gtk::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: &gtk::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 |_| {

View File

@ -127,9 +127,9 @@ pub fn timezone_page(content_stack: &gtk::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: &gtk::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);