[gnome-sudoku/arnaudb/wip/gtk4: 45/47] Adapt to HeaderBar API.




commit 02f1bb22706d576a86b4821c7ea40e2e780d1ae0
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon May 4 16:34:50 2020 +0200

    Adapt to HeaderBar API.

 data/gnome-sudoku.ui  | 1 -
 src/gnome-sudoku.vala | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/data/gnome-sudoku.ui b/data/gnome-sudoku.ui
index 3d51b8a..cc4d2ec 100644
--- a/data/gnome-sudoku.ui
+++ b/data/gnome-sudoku.ui
@@ -4,7 +4,6 @@
   <object class="GtkHeaderBar" id="headerbar">
     <property name="visible">True</property>
     <property name="can-focus">False</property>
-    <property name="title" translatable="yes">Sudoku</property>
     <property name="show-close-button">True</property>
     <child>
       <object class="GtkBox" id="undo_redo_box">
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index ac22c09..ab4b87d 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -439,7 +439,7 @@ public class Sudoku : Gtk.Application
         main_stack.set_visible_child_name ("start_box");
         back_button.visible = game != null;
         undo_redo_box.visible = false;
-        headerbar.title = _("Select Difficulty");
+        window.set_title (_("Select Difficulty"));
         print_action.set_enabled (false);
         clock_label.hide ();
         clock_image.hide ();
@@ -540,9 +540,9 @@ public class Sudoku : Gtk.Application
     private void set_headerbar_title ()
     {
         if (current_game_mode == GameMode.PLAY)
-            headerbar.title = game.board.difficulty_category.to_string ();
+            window.set_title (game.board.difficulty_category.to_string ());
         else
-            headerbar.title = _("Create Puzzle");
+            window.set_title (_("Create Puzzle"));
     }
 
     private void back_cb ()


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