pika-first-setup/src/save_window_size.rs
2024-02-09 00:49:42 +03:00

19 lines
574 B
Rust

// GTK crates
use adw::prelude::*;
use adw::*;
use gdk::Display;
use glib::*;
/// Use all gtk4 libraries (gtk4 -> gtk because cargo)
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
use gtk::prelude::*;
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();
glib_settings.set_int("window-width", size.0);
glib_settings.set_int("window-height", size.1);
glib_settings.set_boolean("is-maximized", window.is_maximized());
}