pika-installer-gtk4/src2/save_window_size/mod.rs
Ward from fusion-voyager-3 6eec9cdc04 Start UI Rewrite
2024-08-04 23:56:30 +03:00

19 lines
620 B
Rust

// Use libraries
use adw::prelude::*;
use adw::*;
/// Use all gtk4 libraries (gtk4 -> gtk because cargo)
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
#[allow(unused_imports)]
use gtk::prelude::*;
#[allow(unused_imports)]
use gtk::*;
// Save current window size to glib
pub fn save_window_size(window: &adw::ApplicationWindow, glib_settings: &gio::Settings) {
let size = window.default_size();
let _ = glib_settings.set_int("window-width", size.0);
let _ = glib_settings.set_int("window-height", size.1);
let _ = glib_settings.set_boolean("is-maximized", window.is_maximized());
}