~fabrixxm/confy

fa67f5fd2abf3128b683b7ab0ece07ac5e77c6e8 — fabrixxm 8 months ago 2112b17 wip/gtk4
destroy old window when new window shows up
1 files changed, 6 insertions(+), 6 deletions(-)

M src/main.py
M src/main.py => src/main.py +6 -6
@@ 104,17 104,17 @@ class Application(Gtk.Application):
        return True

    def open_conf(self, conf):
        win = self.props.active_window
        if win:
            win.destroy()
        a_win = self.props.active_window
        win = MainWindow(conf, application=self)
        if isinstance(a_win, StartWindow):
            win.connect("show", lambda *_: a_win.destroy())
        win.present()

    def start_window(self):
        win = self.props.active_window
        if win:
            win.destroy()
        a_win = self.props.active_window
        win = StartWindow(application=self)
        if isinstance(a_win, MainWindow):
            win.connect("show", lambda *_: a_win.destroy())
        win.present()

    def on_activate(self, *_):