[gnome-chess/mcatanzaro/gtk4: 3/3] progress




commit 9bd770df4a83a764df5ea848b3ea5d5a74f5949a
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Dec 22 15:30:12 2020 -0600

    progress

 data/gnome-chess.ui  |  2 +-
 src/chess-view.vala  | 17 +++++++----------
 src/gnome-chess.vala |  2 ++
 3 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/data/gnome-chess.ui b/data/gnome-chess.ui
index 38f7011..d353ae4 100644
--- a/data/gnome-chess.ui
+++ b/data/gnome-chess.ui
@@ -239,7 +239,7 @@
                     <property name="hexpand">1</property>
                     <property name="can-focus">0</property>
                     <property name="model">history-model</property>
-                    <signal name="changed" handler="history_combo_changed_cb" swapped="no"/>
+<!--                    <signal name="changed" handler="history_combo_changed_cb" swapped="no"/> -->
                     <child>
                       <object class="GtkCellRendererText">
                         <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
diff --git a/src/chess-view.vala b/src/chess-view.vala
index b8a3603..3e94704 100644
--- a/src/chess-view.vala
+++ b/src/chess-view.vala
@@ -41,9 +41,13 @@ public class ChessView : Gtk.DrawingArea
     construct
     {
         init_mouse ();
+        set_draw_func (draw);
+
+        hexpand = true;
+        vexpand = true;
     }
 
-    public override void size_allocate (int width, int height, int baseline)
+    public override void resize (int width, int height)
     {
         int short_edge = int.min (width, height);
 
@@ -52,8 +56,6 @@ public class ChessView : Gtk.DrawingArea
         if (extra < 3)
             extra = 3;
         selected_square_size = square_size + 2 * (int) (extra + 0.5);
-
-        base.size_allocate (width, height, baseline);
     }
 
     private void render_piece (Cairo.Context c1, Cairo.Context c2, string name, int offset)
@@ -107,13 +109,11 @@ public class ChessView : Gtk.DrawingArea
         loaded_theme_name = scene.theme_name;
     }
 
-#if 0
-    public override bool draw (Cairo.Context c)
+    public void draw (Gtk.DrawingArea self, Cairo.Context c, int width, int height)
     {
         load_theme (c);
 
         c.translate (get_allocated_width () / 2, get_allocated_height () / 2);
-        //c.scale (s, s);
         c.rotate (Math.PI * scene.board_angle / 180.0);
 
         int board_size = (int) Math.ceil (square_size * 4 + border_size);
@@ -219,7 +219,7 @@ public class ChessView : Gtk.DrawingArea
         {
             c.rotate (Math.PI * scene.board_angle / 180.0);
             draw_paused_overlay (c);
-            return true;
+            return;
         }
 
         /* Draw the pieces */
@@ -256,10 +256,7 @@ public class ChessView : Gtk.DrawingArea
                 }
             }
         }
-
-        return true;
     }
-#endif
 
     private void draw_piece (Cairo.Context c, Cairo.Surface surface, int size, ChessPiece piece, double 
alpha)
     {
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 086dc94..7c8a517 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1741,6 +1741,7 @@ return null;
     [CCode (cname = "history_combo_changed_cb", instance_pos = -1)]
     public void history_combo_changed_cb (ComboBox combo)
     {
+#if 0
         TreeIter iter;
         if (!combo.get_active_iter (out iter))
             return;
@@ -1749,6 +1750,7 @@ return null;
         if (game == null || move_number == game.n_moves)
             move_number = -1;
         scene.move_number = move_number;
+#endif
     }
 
     [CCode (cname = "history_latest_clicked_cb", instance_pos = -1)]


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