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-16 11:28:13 +01:00
|
|
|
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-14 22:31:40 +01:00
|
|
|
use crate::save_window_size::save_window_size;
|
|
|
|
use crate::welcome_page::welcome_page;
|
2024-01-16 11:28:13 +01:00
|
|
|
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-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();
|
2024-01-19 12:37:40 +01:00
|
|
|
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();
|
|
|
|
}
|