[gnome-games/wip/exalm/views2] f



commit c3b60f95e6bf494a28e83b57a5d9e6fc82f58987
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Oct 7 18:26:51 2018 +0500

    f

 src/ui/application.vala | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 5070c4ac..8bb1f354 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -7,7 +7,6 @@ public class Games.Application : Gtk.Application {
 
        private Database database;
 
-       private PreferencesWindow preferences_window;
        private ShortcutsWindow shortcuts_window;
        private ApplicationWindow window;
        private bool game_list_loaded;
@@ -343,17 +342,20 @@ public class Games.Application : Gtk.Application {
        }
 
        private void preferences () {
-               window.show_preferences ();
-               return;
-               if (preferences_window != null) {
-                       preferences_window.present ();
-
+               int width, height;
+               window.get_size (out width, out height);
+               if (width <= 800) {
+                       window.show_preferences ();
                        return;
                }
-               preferences_window = new PreferencesWindow ();
-               preferences_window.destroy.connect (() => {
-                       preferences_window = null;
-               });
+
+               var preferences_window = new PreferencesWindow ();
+               preferences_window.type_hint = Gdk.WindowTypeHint.DIALOG;
+               preferences_window.destroy_with_parent = true;
+               preferences_window.transient_for = window;
+               preferences_window.modal = true;
+
+               preferences_window.present ();
        }
 
        private void shortcuts () {


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