[gnome-music/wip/exalm/about] application: Set modal programmatically



commit ba6d8287ef397eed20b22db093994e70e2a6d49e
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sat Feb 23 15:35:12 2019 +0500

    application: Set modal programmatically
    
    Modal property has to be set after transient_for, otherwise the latter has
    no effect. Hence it cannot be done in ui file.
    
    Fixes #261

 data/ui/AboutDialog.ui.in | 1 -
 gnomemusic/application.py | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/data/ui/AboutDialog.ui.in b/data/ui/AboutDialog.ui.in
index b5237b06..8ae33fa2 100644
--- a/data/ui/AboutDialog.ui.in
+++ b/data/ui/AboutDialog.ui.in
@@ -3,7 +3,6 @@
   <!-- interface-requires gtk+ 3.0 -->
   <template class="AboutDialog" parent="GtkAboutDialog">
     <property name="can_focus">False</property>
-    <property name="modal">True</property>
     <property name="program_name">@PROGRAM_NAME@</property>
     <property name="version">@PACKAGE_VERSION@</property>
     <property name="copyright" translatable="yes">Copyright © 2018 GNOME Music Developers</property>
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 9a496093..92c4d94b 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -91,6 +91,8 @@ class Application(Gtk.Application):
     def _about(self, action, param):
         about = AboutDialog()
         about.props.transient_for = self._window
+        # This has to be set after transient_for
+        about.props.modal = True
 
     @log
     def do_startup(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]