[libgnome-games-support/arnaudb/wip/gtk4: 11/12] Comment size_allocate stuff.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgnome-games-support/arnaudb/wip/gtk4: 11/12] Comment size_allocate stuff.
- Date: Mon, 13 Jul 2020 15:58:18 +0000 (UTC)
commit 0e358d8bf5f977cc3d04c904afbdcadb255add0c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sun May 10 23:43:20 2020 +0200
Comment size_allocate stuff.
games/gridframe.vala | 62 ++++++++++++++++++++++++++--------------------------
1 file changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/games/gridframe.vala b/games/gridframe.vala
index b58c8bc..519446e 100644
--- a/games/gridframe.vala
+++ b/games/gridframe.vala
@@ -117,10 +117,10 @@ public class GridFrame : Gtk.Widget
Object (width: width, height: height);
}
- construct
- {
- size_allocate.connect (on_size_allocate);
- }
+// construct
+// {
+// size_allocate.connect (on_size_allocate);
+// }
public new void @set (int width, int height)
{
@@ -140,33 +140,33 @@ public class GridFrame : Gtk.Widget
this.yalign = yalign;
}
- private void on_size_allocate (int width, int height)
- {
- int xsize = int.max (1, (width - _xpadding) / _xmult);
- int ysize = int.max (1, (height - _ypadding) / _ymult);
- int size = int.min (xsize, ysize);
-
- Gtk.Allocation child_allocation = { 0, 0, 0, 0 };
- child_allocation.width = size * _xmult + _xpadding;
- child_allocation.height = size * _ymult + _ypadding;
- child_allocation.x = (int) ((width - child_allocation.width) * _xalign + xsize);
- child_allocation.y = (int) ((height - child_allocation.height) * _yalign + ysize);
-
- if (get_mapped () &&
- (child_allocation.x != old_allocation.x ||
- child_allocation.y != old_allocation.y ||
- child_allocation.width != old_allocation.width ||
- child_allocation.height != old_allocation.height))
- {
- queue_resize ();
- }
-
- Gtk.Widget child = get_first_child ();
- if (child != null && child.get_visible ())
- child.size_allocate (child_allocation.width, child_allocation.height, /* baseline default */ -1);
-
- old_allocation = child_allocation;
- }
+// private void on_size_allocate (int width, int height)
+// {
+// int xsize = int.max (1, (width - _xpadding) / _xmult);
+// int ysize = int.max (1, (height - _ypadding) / _ymult);
+// int size = int.min (xsize, ysize);
+
+// Gtk.Allocation child_allocation = { 0, 0, 0, 0 };
+// child_allocation.width = size * _xmult + _xpadding;
+// child_allocation.height = size * _ymult + _ypadding;
+// child_allocation.x = (int) ((width - child_allocation.width) * _xalign + xsize);
+// child_allocation.y = (int) ((height - child_allocation.height) * _yalign + ysize);
+
+// if (get_mapped () &&
+// (child_allocation.x != old_allocation.x ||
+// child_allocation.y != old_allocation.y ||
+// child_allocation.width != old_allocation.width ||
+// child_allocation.height != old_allocation.height))
+// {
+// queue_resize ();
+// }
+
+// Gtk.Widget child = get_first_child ();
+// if (child != null && child.get_visible ())
+// child.size_allocate (child_allocation.width, child_allocation.height, /* baseline default */
-1);
+
+// old_allocation = child_allocation;
+// }
}
} // namespace Games
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]