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



commit e7febb1416851f8c601b59882974b1f422645df5
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 186f3dc..54cf5ed 100644
--- a/data/gnome-sudoku.ui
+++ b/data/gnome-sudoku.ui
@@ -3,7 +3,6 @@
   <requires lib="gtk+" version="3.98"/>
   <object class="GtkHeaderBar" id="headerbar">
     <property name="can-focus">False</property>
-    <property name="title" translatable="yes">Sudoku</property>
     <property name="show-title-buttons">True</property>
     <child type="start">
       <object class="GtkBox" id="undo_redo_box">
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 86dd159..692d75b 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -444,7 +444,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 ();
@@ -545,9 +545,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]