pika-first-setup/src/build_ui.rs

41 lines
1.2 KiB
Rust
Raw Normal View History

2024-01-30 21:33:07 +01:00
// GTK crates
2024-02-08 22:49:42 +01:00
use adw::prelude::*;
use adw::*;
2024-02-09 23:09:54 +01:00
/// Use all gtk4 libraries (gtk4 -> gtk because cargo)
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
2024-01-30 21:33:07 +01:00
// application crates
2024-01-31 19:48:55 +01:00
/// first setup crates
use crate::first_setup::first_setup::first_setup;
2024-01-30 21:33:07 +01:00
pub fn build_ui(app: &adw::Application) {
// setup glib
2024-01-30 21:47:31 +01:00
gtk::glib::set_prgname(Some("PikaOS First Setup"));
glib::set_application_name("PikaOS First Setup");
2024-01-30 21:33:07 +01:00
// create the main Application window
let window = adw::ApplicationWindow::builder()
// The text on the titlebar
2024-01-30 21:47:31 +01:00
.title("PikaOS First Setup")
2024-01-30 21:33:07 +01:00
// link it to the application "app"
.application(app)
2024-01-31 19:48:55 +01:00
// Add the box called "window_box" to it
2024-01-30 21:33:07 +01:00
// Application icon
2024-01-30 21:47:31 +01:00
.icon_name("com.github.pikaos-linux.pikafirstsetup")
2024-01-30 21:33:07 +01:00
// Minimum Size/Default
.width_request(700)
.height_request(500)
// Hide window instead of destroy
.hide_on_close(true)
2024-01-30 21:47:31 +01:00
.deletable(false)
2024-01-30 21:33:07 +01:00
// Startup
2024-01-30 21:47:31 +01:00
.startup_id("com.github.pikaos-linux.pikafirstsetup")
2024-01-30 21:33:07 +01:00
// build the window
.build();
2024-01-31 19:48:55 +01:00
first_setup(&window);
2024-01-30 21:33:07 +01:00
// show the window
window.present()
2024-02-08 22:49:42 +01:00
}