pika-installer-gtk4/src/main.rs

59 lines
1.8 KiB
Rust
Raw Normal View History

2024-01-14 22:31:40 +01:00
// Use libraries
/// Use all gtk4 libraries (gtk4 -> gtk because cargo)
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
use gtk::prelude::*;
use gtk::*;
use adw::prelude::*;
use adw::*;
use glib::*;
use gdk::Display;
use gtk::subclass::layout_child;
mod build_ui;
use crate::build_ui::build_ui;
mod save_window_size;
mod welcome_page;
2024-01-20 18:48:32 +01:00
mod efi_error_page;
mod language_page;
2024-01-17 14:50:32 +01:00
mod eula_page;
2024-01-19 14:16:15 +01:00
mod timezone_page;
mod keyboard_page;
2024-01-17 20:25:36 +01:00
mod partitioning_page;
2024-01-20 20:01:20 +01:00
mod install_page;
2024-01-22 16:07:38 +01:00
mod done_page;
2024-02-10 19:03:19 +01:00
mod automatic_paritioning;
mod manual_partitioning;
2024-01-14 22:31:40 +01:00
use crate::save_window_size::save_window_size;
use crate::welcome_page::welcome_page;
2024-01-20 18:48:32 +01:00
use crate::efi_error_page::efi_error_page;
use crate::language_page::language_page;
2024-01-17 14:50:32 +01:00
use crate::eula_page::eula_page;
2024-01-19 14:16:15 +01:00
use crate::timezone_page::timezone_page;
use crate::keyboard_page::keyboard_page;
2024-01-17 20:25:36 +01:00
use crate::partitioning_page::partitioning_page;
2024-02-10 19:03:19 +01:00
use crate::automatic_paritioning::automatic_partitioning;
use crate::manual_partitioning::manual_partitioning;
2024-01-20 20:01:20 +01:00
use crate::install_page::install_page;
2024-01-22 16:07:38 +01:00
use crate::done_page::done_page;
2024-01-14 22:31:40 +01:00
/// main function
fn main() {
let application = adw::Application::new(Some("com.github.pikaos-linux.pikainstallergtk4"), Default::default());
application.connect_startup(|app| {
// The CSS "magic" happens here.
let provider = CssProvider::new();
provider.load_from_string(include_str!("style.css"));
2024-01-14 22:31:40 +01:00
// We give the CssProvided to the default screen so the CSS rules we added
// can be applied to our window.
gtk::style_context_add_provider_for_display(
&Display::default().expect("Could not connect to a display."),
&provider,
STYLE_PROVIDER_PRIORITY_APPLICATION,
);
app.connect_activate(build_ui);
});
application.run();
}