[iagno/arnaudb/wip/gtk4: 4/54] Configure event is gone.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno/arnaudb/wip/gtk4: 4/54] Configure event is gone.
- Date: Thu, 30 Apr 2020 13:17:45 +0000 (UTC)
commit 41a4d4382a4c9f73cb6dfadc1626b397f8c7ea41
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Feb 12 16:22:10 2020 +0100
Configure event is gone.
src/history-button.vala | 5 ++---
src/reversi-view.vala | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/history-button.vala b/src/history-button.vala
index 4cd3673..f71dd87 100644
--- a/src/history-button.vala
+++ b/src/history-button.vala
@@ -35,7 +35,7 @@ private class HistoryButton : MenuButton, AdaptativeWidget
construct
{
- drawing.configure_event.connect (configure_drawing);
+ drawing.size_allocate.connect (on_drawing_size_allocate);
drawing.draw.connect (update_drawing);
theme_manager.theme_changed.connect (() => {
if (!drawing_configured)
@@ -81,7 +81,7 @@ private class HistoryButton : MenuButton, AdaptativeWidget
private Gdk.Pixbuf tileset_pixbuf;
- private bool configure_drawing ()
+ private inline void on_drawing_size_allocate ()
{
int height = drawing.get_allocated_height ();
int width = drawing.get_allocated_width ();
@@ -97,7 +97,6 @@ private class HistoryButton : MenuButton, AdaptativeWidget
board_y = !vertical_fill ? (int) ((height - drawing_height) / 2.0) : 0;
drawing_configured = true;
- return true;
}
private Cairo.Pattern? tiles_pattern = null;
diff --git a/src/reversi-view.vala b/src/reversi-view.vala
index 43aaf7c..670be7d 100644
--- a/src/reversi-view.vala
+++ b/src/reversi-view.vala
@@ -177,6 +177,7 @@ private class ReversiView : Gtk.DrawingArea
| Gdk.EventMask.STRUCTURE_MASK);
init_mouse ();
init_keyboard ();
+ size_allocate.connect (on_size_allocate);
theme_manager.theme_changed.connect (() => {
tiles_pattern = null;
@@ -204,12 +205,11 @@ private class ReversiView : Gtk.DrawingArea
private int [,] tile_xs;
private int [,] tile_ys;
- protected override bool configure_event (Gdk.EventConfigure e)
+ private inline void on_size_allocate ()
requires (game_is_set)
{
configure_theme ();
configuration_done = true;
- return true;
}
private void configure_theme ()
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]