From ca9b4a780da2a4308e932a90db7217ebe643ec24 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sat, 19 Dec 2020 12:36:42 +0300 Subject: [PATCH] storing app window size on close --- app/ui/main_app_window.py | 9 ++++----- app/ui/main_window.glade | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index ed3016f9..7a85a873 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -81,7 +81,6 @@ class Application(Gtk.Application): self.add_main_option("debug", ord("d"), GLib.OptionFlags.NONE, GLib.OptionArg.STRING, "", None) self._handlers = {"on_close_app": self.on_close_app, - "on_resize": self.on_resize, "on_about_app": self.on_about_app, "on_settings": self.on_settings, "on_profile_changed": self.on_profile_changed, @@ -608,6 +607,10 @@ class Application(Gtk.Application): event.state |= MOD_MASK def on_close_app(self, *args): + """ Performing operations before closing the application. """ + # Saving the current size of the application window. + self._settings.add("window_size", self._main_window.get_size()) + if self._recorder: if self._recorder.is_record(): msg = "{}\n\n\t{}".format(get_message("Recording in progress!"), get_message("Are you sure?")) @@ -622,10 +625,6 @@ class Application(Gtk.Application): else: GLib.idle_add(self.quit) - def on_resize(self, window): - """ Stores new size properties for app window after resize """ - self._settings.add("window_size", window.get_size()) - @run_idle def on_about_app(self, action, value=None): show_dialog(DialogType.ABOUT, self._main_window) diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 86292bc3..f6afde0e 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -947,7 +947,6 @@ Author: Dmitriy Yefremov demon-editor center DemonEditor -