[gnome-2048] Use GtkBuilder for ClutterEmbed.



commit e0f7dc8d6d0c700c8922c59e980384b215496a84
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Feb 7 17:23:57 2019 +0100

    Use GtkBuilder for ClutterEmbed.

 data/mainwindow.ui   |  7 ++++++-
 src/game-window.vala | 13 +++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/data/mainwindow.ui b/data/mainwindow.ui
index 4dfe4c8..6fe7fd4 100644
--- a/data/mainwindow.ui
+++ b/data/mainwindow.ui
@@ -84,11 +84,16 @@
         <property name="visible">True</property>
         <property name="can-focus">False</property>
         <child>
-          <object class="GtkAspectFrame" id="_frame">
+          <object class="GtkAspectFrame">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
             <property name="label-xalign">0</property>
             <property name="shadow-type">none</property>
+            <child>
+              <object class="GtkClutterEmbed" id="_embed">
+                <property name="visible">True</property>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="left-attach">1</property>
diff --git a/src/game-window.vala b/src/game-window.vala
index ff636f0..b0eb751 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -33,12 +33,11 @@ private class GameWindow : ApplicationWindow
     private bool _window_maximized;
     private bool _window_is_tiled;
 
-    [GtkChild] private HeaderBar    _header_bar;
-    [GtkChild] private Label        _score;
-    [GtkChild] private MenuButton   _new_game_button;
-    [GtkChild] private MenuButton   _hamburger_button;
-    [GtkChild] private AspectFrame  _frame;
-    private GtkClutter.Embed _embed;
+    [GtkChild] private HeaderBar        _header_bar;
+    [GtkChild] private Label            _score;
+    [GtkChild] private MenuButton       _new_game_button;
+    [GtkChild] private MenuButton       _hamburger_button;
+    [GtkChild] private GtkClutter.Embed _embed;
 
     private Game _game;
     private bool _game_restored;
@@ -156,8 +155,6 @@ private class GameWindow : ApplicationWindow
         _update_hamburger_menu ();
         _game.load_settings (ref _settings);
 
-        _embed = new GtkClutter.Embed ();
-        _frame.add (_embed);
         _game.view = _embed.get_stage ();
 
         set_events (get_events () | Gdk.EventMask.STRUCTURE_MASK | Gdk.EventMask.KEY_PRESS_MASK | 
Gdk.EventMask.KEY_RELEASE_MASK);


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