Add `transient_for` property to about dialog

This commit is contained in:
oscfdezdz 2023-04-08 17:10:05 +02:00
parent e931c6138c
commit 6dba08f496
No known key found for this signature in database
GPG Key ID: 929F7771BD54F7FE
2 changed files with 3 additions and 2 deletions

View File

@ -33,8 +33,9 @@ from gi.repository import GObject, Gtk # type: ignore # noqa: E402
# the about dialog # the about dialog
class AboutDialog(Gtk.AboutDialog): class AboutDialog(Gtk.AboutDialog):
def __init__(self) -> None: def __init__(self, parent: Gtk.Widget) -> None:
Gtk.AboutDialog.__init__(self) Gtk.AboutDialog.__init__(self)
self.set_transient_for(parent)
self.set_logo_icon_name('io.github.mightycreak.Diffuse') self.set_logo_icon_name('io.github.mightycreak.Diffuse')
self.set_program_name(constants.APP_NAME) self.set_program_name(constants.APP_NAME)
self.set_version(constants.VERSION) self.set_version(constants.VERSION)

View File

@ -1791,7 +1791,7 @@ class DiffuseWindow(Gtk.ApplicationWindow):
# callback for the about menu item # callback for the about menu item
def about_cb(self, widget, data): def about_cb(self, widget, data):
dialog = AboutDialog() dialog = AboutDialog(self.get_toplevel())
dialog.run() dialog.run()
dialog.destroy() dialog.destroy()