[lightsoff/arnaudb/wip/gtk4: 9/28] Adapt to HeaderBar API.




commit d74bc7ca88eca151c92fed6f7b1872e748b6566c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Nov 27 15:32:47 2020 +0100

    Adapt to HeaderBar API.

 data/lightsoff.ui         | 2 +-
 src/lightsoff-window.vala | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/data/lightsoff.ui b/data/lightsoff.ui
index 19c0f4b..0a55874 100644
--- a/data/lightsoff.ui
+++ b/data/lightsoff.ui
@@ -29,7 +29,7 @@
     <property name="can_focus">False</property>
     <property name="resizable">True</property>
     <child type="titlebar">
-      <object class="GtkHeaderBar" id="headerbar">
+      <object class="GtkHeaderBar">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="title" translatable="no">Puzzle X</property>
diff --git a/src/lightsoff-window.vala b/src/lightsoff-window.vala
index 120aeec..b0b2348 100644
--- a/src/lightsoff-window.vala
+++ b/src/lightsoff-window.vala
@@ -15,7 +15,6 @@ using Gtk;
 [GtkTemplate (ui = "/org/gnome/LightsOff/ui/lightsoff.ui")]
 private class LightsoffWindow : ManagedWindow
 {
-    [GtkChild] private HeaderBar                headerbar;
     [GtkChild] private MenuButton               menu_button;
     [GtkChild] private Label                    level_label;
     [GtkChild] private GameButton               game_button_1;
@@ -103,7 +102,7 @@ private class LightsoffWindow : ManagedWindow
     private void update_title ()
     {
         if (large_window_size)
-            headerbar.set_title (custom_title);
+            set_title (custom_title);
         level_label.set_label (custom_title);
         update_subtitle (0);
         notifications_revealer.hide_notification ();
@@ -181,14 +180,14 @@ private class LightsoffWindow : ManagedWindow
         if (large)
         {
             game_button_1.show ();
-            headerbar.set_title (custom_title);
+            set_title (custom_title);
             revealer.set_reveal_child (false);
             notifications_revealer.set_window_size (/* thin */ false);
         }
         else
         {
             game_button_1.hide ();
-            headerbar.set_title (null);
+            set_title (null);
             revealer.set_reveal_child (true);
             notifications_revealer.set_window_size (/* thin */ true);
         }


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