[dconf-editor: 4/5] Remove NightTimeAwareHeaderBar




commit 5ea26c8658aeaebe049316e2edc8e45d7dd7bf4c
Author: Maximiliano Sandoval R <msandova gnome org>
Date:   Wed Jul 27 17:35:10 2022 +0200

    Remove NightTimeAwareHeaderBar
    
    Following the previous commit this class became useless.

 editor/adaptative-window.vala | 31 ++++---------------------------
 editor/base-headerbar.ui      |  2 +-
 editor/base-headerbar.vala    |  4 ++--
 editor/dconf-window.vala      |  2 +-
 4 files changed, 8 insertions(+), 31 deletions(-)
---
diff --git a/editor/adaptative-window.vala b/editor/adaptative-window.vala
index 01acf968..88df4056 100644
--- a/editor/adaptative-window.vala
+++ b/editor/adaptative-window.vala
@@ -68,41 +68,18 @@ private interface AdaptativeWidget : Object
     internal abstract void set_window_size (WindowSize new_size);
 }
 
-private abstract class NightTimeAwareHeaderBar : HeaderBar
-{
-    /*\
-    * * high-contrast state
-    \*/
-
-    private bool highcontrast_state = false;
-
-    internal void set_highcontrast_state (bool highcontrast_new_state)
-    {
-        if (highcontrast_state == highcontrast_new_state)
-            return;
-        highcontrast_state = highcontrast_new_state;
-        update_hamburger_menu ();
-    }
-
-    /*\
-    * * hamburger menu
-    \*/
-
-    protected abstract void update_hamburger_menu ();
-}
-
 private const int LARGE_WINDOW_SIZE = 1042;
 
 [GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/adaptative-window.ui")]
 private abstract class AdaptativeWindow : ApplicationWindow
 {
-    private NightTimeAwareHeaderBar headerbar;
-    [CCode (notify = false)] public NightTimeAwareHeaderBar nta_headerbar
+    private BaseHeaderBar headerbar;
+    [CCode (notify = false)] public BaseHeaderBar nta_headerbar
     {
         protected get { return headerbar; }
         protected construct
         {
-            NightTimeAwareHeaderBar? _value = value;
+            BaseHeaderBar? _value = value;
             if (_value == null)
                 assert_not_reached ();
 
@@ -371,7 +348,7 @@ private abstract class AdaptativeWindow : ApplicationWindow
         if (highcontrast_new_state == highcontrast_state)
             return;
         highcontrast_state = highcontrast_new_state;
-        headerbar.set_highcontrast_state (highcontrast_new_state);
+        headerbar.update_hamburger_menu ();
 
         if (highcontrast_new_state)
             window_style_context.add_class ("hc-theme");
diff --git a/editor/base-headerbar.ui b/editor/base-headerbar.ui
index b18f6263..528ef995 100644
--- a/editor/base-headerbar.ui
+++ b/editor/base-headerbar.ui
@@ -17,7 +17,7 @@
 -->
 <interface>
   <requires lib="gtk+" version="3.12"/>
-  <template class="BaseHeaderBar" parent="NightTimeAwareHeaderBar">
+  <template class="BaseHeaderBar" parent="GtkHeaderBar">
     <property name="show-close-button">True</property>
     <property name="has-subtitle">False</property>
     <child>
diff --git a/editor/base-headerbar.vala b/editor/base-headerbar.vala
index 505161d8..20883aa5 100644
--- a/editor/base-headerbar.vala
+++ b/editor/base-headerbar.vala
@@ -18,7 +18,7 @@
 using Gtk;
 
 [GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/base-headerbar.ui")]
-private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
+private class BaseHeaderBar : HeaderBar, AdaptativeWidget
 {
     [GtkChild] protected unowned Box center_box;
 
@@ -72,7 +72,7 @@ private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
     [CCode (notify = false)] public bool   has_help               { private  get; protected construct; 
default = false; }
     [CCode (notify = false)] public bool   has_keyboard_shortcuts { private  get; protected construct; 
default = false; }
 
-    protected override void update_hamburger_menu ()
+    public void update_hamburger_menu ()
     {
         GLib.Menu menu = new GLib.Menu ();
 
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 1c28e0e8..9604f71b 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -48,7 +48,7 @@ private class DConfWindow : BookmarksWindow, AdaptativeWidget
         DConfHeaderBar _headerbar = new DConfHeaderBar ();
         DConfView _main_view = new DConfView (_modifications_handler);
 
-        Object (nta_headerbar               : (NightTimeAwareHeaderBar) _headerbar,
+        Object (nta_headerbar               : (BaseHeaderBar) _headerbar,
                 base_view                   : (BaseView) _main_view,
                 window_title                : ConfigurationEditor.PROGRAM_NAME,
                 specific_css_class_or_empty : "dconf-editor",


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