begin auto parting work

This commit is contained in:
Ward from fusion-voyager-3 2024-08-08 18:56:02 +03:00
parent ceac6592bd
commit ceb4fc3a50
3 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,37 @@
use adw::gio;
use crate::installer_stack_page;
use gtk::{prelude::*, glib as glib};
use glib::{clone, closure_local};
pub fn automatic_partitioning_page(
main_carousel: &adw::Carousel,
language_changed_action: &gio::SimpleAction
) {
let automatic_partitioning_page = installer_stack_page::InstallerStackPage::new();
automatic_partitioning_page.set_page_icon("builder");
automatic_partitioning_page.set_back_visible(true);
automatic_partitioning_page.set_next_visible(true);
automatic_partitioning_page.set_back_sensitive(true);
automatic_partitioning_page.set_next_sensitive(false);
let content_box = gtk::Box::builder()
.orientation(gtk::Orientation::Vertical)
.hexpand(true)
.vexpand(true)
.build();
automatic_partitioning_page.connect_closure(
"back-button-pressed",
false,
closure_local!(
#[weak]
main_carousel,
move |_automatic_partitioning_page: installer_stack_page::InstallerStackPage|
{
main_carousel.scroll_to(&main_carousel.nth_page(0), true)
}
)
);
main_carousel.append(&automatic_partitioning_page);
}

View File

@ -14,6 +14,7 @@ mod eula_page;
mod keyboard_page; mod keyboard_page;
mod timezone_page; mod timezone_page;
mod partitioning_page; mod partitioning_page;
mod automatic_partitioning_page;
#[macro_use] #[macro_use]
extern crate rust_i18n; extern crate rust_i18n;

View File

@ -1,6 +1,8 @@
use crate::installer_stack_page; use crate::installer_stack_page;
use gtk::{prelude::*, glib as glib, gio as gio}; use gtk::{prelude::*, glib as glib, gio as gio};
use glib::{clone, closure_local}; use glib::{clone, closure_local};
use crate::{automatic_partitioning_page};
pub fn partitioning_page( pub fn partitioning_page(
main_carousel: &adw::Carousel, main_carousel: &adw::Carousel,
language_changed_action: &gio::SimpleAction language_changed_action: &gio::SimpleAction
@ -82,6 +84,7 @@ pub fn partitioning_page(
// //
partitioning_carousel.append(&partitioning_page); partitioning_carousel.append(&partitioning_page);
automatic_partitioning_page::automatic_partitioning_page(&partitioning_carousel, &language_changed_action);
partitioning_page.connect_closure( partitioning_page.connect_closure(
"back-button-pressed", "back-button-pressed",