20 lines
591 B
Rust
20 lines
591 B
Rust
|
// GTK crates
|
||
|
/// 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;
|
||
|
|
||
|
// 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());
|
||
|
}
|