[gnome-sudoku/arnaudb/wip/gtk4: 34/43] Make keyboard start to work.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku/arnaudb/wip/gtk4: 34/43] Make keyboard start to work.
- Date: Wed, 5 Aug 2020 17:40:59 +0000 (UTC)
commit 5c7d1a4f01d8090f7f824377a670e688e5fb5f33
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Apr 17 22:42:34 2020 +0200
Make keyboard start to work.
src/sudoku-view.vala | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index 80e635f..4e826f2 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -22,7 +22,7 @@
using Gtk;
using Gdk;
-private class SudokuCellView : DrawingArea
+private class SudokuCellView : Widget
{
private double size_ratio = 2;
@@ -96,10 +96,15 @@ private class SudokuCellView : DrawingArea
private EventControllerKey key_controller; // for keeping in memory
private GestureClick click_controller; // for keeping in memory
+ private DrawingArea drawing;
+
construct
{
BinLayout layout = new BinLayout ();
set_layout_manager (layout);
+
+ drawing = new DrawingArea ();
+ drawing.insert_after (this, /* insert first */ null);
}
public SudokuCellView (int row, int col, ref SudokuGame game)
@@ -110,14 +115,12 @@ private class SudokuCellView : DrawingArea
init_mouse ();
init_keyboard ();
- set_draw_func (draw);
+ drawing.set_draw_func (draw);
value = game.board [row, col];
// background_color is set in the SudokuView, as it manages the color of the cells
- can_focus = true;
-
if (is_fixed && game.mode == GameMode.PLAY)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]