[dconf-editor] Introduce BaseWindow.



commit c68aa1ef2fd9b98c93aea40de19556d2ff5cba9a
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Dec 14 13:08:12 2018 +0100

    Introduce BaseWindow.

 editor/base-headerbar.ui                     |   2 +-
 editor/base-headerbar.vala                   |   2 +-
 editor/base-view.vala                        |   2 +
 editor/{browser-window.ui => base-window.ui} |   5 +-
 editor/base-window.vala                      | 232 +++++++++++++++++++++++++++
 editor/browser-view.vala                     |   4 +-
 editor/browser-window.vala                   | 200 ++---------------------
 editor/dconf-editor.gresource.xml            |   2 +-
 editor/dconf-window.vala                     |  24 +--
 editor/meson.build                           |   3 +-
 10 files changed, 274 insertions(+), 202 deletions(-)
---
diff --git a/editor/base-headerbar.ui b/editor/base-headerbar.ui
index 364d87f..6dc17fb 100644
--- a/editor/base-headerbar.ui
+++ b/editor/base-headerbar.ui
@@ -8,7 +8,7 @@
       <object class="GtkButton" id="go_back_button">
         <property name="visible">False</property>
         <property name="valign">center</property>
-        <property name="action-name">browser.show-default-panel</property>
+        <property name="action-name">base.show-default-view</property>
         <style>
           <class name="image-button"/>
         </style>
diff --git a/editor/base-headerbar.vala b/editor/base-headerbar.vala
index 2aeec35..dee77ba 100644
--- a/editor/base-headerbar.vala
+++ b/editor/base-headerbar.vala
@@ -107,7 +107,7 @@ private class BaseHeaderBar : NightTimeAwareHeaderBar, AdaptativeWidget
 
     private static inline void append_about_entry (string about_action_label, ref GLib.Menu section)
     {
-        section.append (about_action_label, "browser.about");
+        section.append (about_action_label, "base.about");
     }
 
     protected inline void hide_hamburger_menu ()
diff --git a/editor/base-view.vala b/editor/base-view.vala
index c8bda6b..bc2e16e 100644
--- a/editor/base-view.vala
+++ b/editor/base-view.vala
@@ -29,6 +29,8 @@ private class BaseView : Stack, AdaptativeWidget
         return null;
     }
 
+    internal virtual void close_popovers () {}
+
     /*\
     * * adaptative stuff
     \*/
diff --git a/editor/browser-window.ui b/editor/base-window.ui
similarity index 81%
rename from editor/browser-window.ui
rename to editor/base-window.ui
index 89ce242..c5c8d2a 100644
--- a/editor/browser-window.ui
+++ b/editor/base-window.ui
@@ -1,13 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface domain="dconf-editor">
   <!-- interface-requires gtk+ 3.0 -->
-  <template class="BrowserWindow" parent="AdaptativeWindow">
+  <template class="BaseWindow" parent="AdaptativeWindow">
     <property name="visible">False</property>
     <property name="height-request">283</property> <!-- 294 max for Purism Librem 5 landscape -->
     <property name="width-request">349</property>  <!-- 360 max for Purism Librem 5 portrait -->
     <signal name="key-press-event" handler="on_key_press_event"/>
-    <signal name="button-press-event" handler="on_button_press_event"/>
-    <signal name="destroy" handler="on_destroy"/>
+    <signal name="destroy"         handler="on_destroy"/>
     <child>
       <object class="GtkOverlay" id="main_overlay">
         <property name="visible">True</property>
diff --git a/editor/base-window.vala b/editor/base-window.vala
new file mode 100644
index 0000000..913658e
--- /dev/null
+++ b/editor/base-window.vala
@@ -0,0 +1,232 @@
+/*
+  This file is part of Dconf Editor
+
+  Dconf Editor is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  Dconf Editor is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with Dconf Editor.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+using Gtk;
+
+[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/base-window.ui")]
+private class BaseWindow : AdaptativeWindow, AdaptativeWidget
+{
+    [CCode (notify = false)] public BaseView base_view { protected get; protected construct; }
+
+    private BaseHeaderBar headerbar;
+
+    construct
+    {
+        headerbar = (BaseHeaderBar) nta_headerbar;
+
+        base_view.vexpand = true;
+        base_view.visible = true;
+        add_to_main_grid (base_view);
+
+        install_action_entries ();
+    }
+
+    /*\
+    * * main grid
+    \*/
+
+    [GtkChild] private Grid main_grid;
+
+    protected void add_to_main_grid (Widget widget)
+    {
+        main_grid.add (widget);
+    }
+
+    /*\
+    * * action entries
+    \*/
+
+    private void install_action_entries ()
+    {
+        SimpleActionGroup action_group = new SimpleActionGroup ();
+        action_group.add_action_entries (action_entries, this);
+        insert_action_group ("base", action_group);
+    }
+
+    private const GLib.ActionEntry [] action_entries =
+    {
+        { "show-default-view",  show_default_view },
+        { "about",              about }
+    };
+
+    /*\
+    * * global callbacks
+    \*/
+
+    [GtkCallback]
+    private void on_destroy ()
+    {
+        before_destroy ();
+        base.destroy ();
+    }
+
+    protected virtual void before_destroy () {}
+
+    [GtkCallback]
+    protected virtual bool on_key_press_event (Widget widget, Gdk.EventKey event)
+    {
+        uint keyval = event.keyval;
+        string name = (!) (Gdk.keyval_name (keyval) ?? "");
+
+        if (name == "F1") // TODO fix dance done with the F1 & <Primary>F1 shortcuts that show help overlay
+        {
+            headerbar.close_popovers ();
+            base_view.close_popovers ();
+            if ((event.state & Gdk.ModifierType.SHIFT_MASK) == 0)
+                return false;   // help overlay
+            about ();
+            return true;
+        }
+
+        return false;
+    }
+
+    /*\
+    * * adaptative stuff
+    \*/
+
+    private bool disable_popovers = false;
+    private void set_window_size (AdaptativeWidget.WindowSize new_size)
+    {
+        bool _disable_popovers = AdaptativeWidget.WindowSize.is_phone_size (new_size)
+                              || AdaptativeWidget.WindowSize.is_extra_thin (new_size);
+        if (disable_popovers != _disable_popovers)
+        {
+            disable_popovers = _disable_popovers;
+            if (in_window_about)
+                show_default_view ();
+        }
+
+        chain_set_window_size (new_size);
+    }
+
+    protected virtual void chain_set_window_size (AdaptativeWidget.WindowSize new_size) {}
+
+    /*\
+    * * in-window panels
+    \*/
+
+    protected virtual void close_in_window_panels ()
+    {
+        hide_notification ();
+        headerbar.close_popovers ();
+        if (in_window_about)
+            show_default_view ();
+    }
+
+    /*\
+    * * about action and dialog
+    \*/
+
+    private void about (/* SimpleAction action, Variant? path_variant */)
+    {
+        if (!AdaptativeWidget.WindowSize.is_phone_size (window_size)
+         && !AdaptativeWidget.WindowSize.is_extra_thin (window_size))
+            show_about_dialog ();       // TODO hide the dialog if visible
+        else
+            toggle_in_window_about ();
+    }
+
+    private void show_about_dialog ()
+    {
+        string [] authors = AboutDialogInfos.authors;
+        Gtk.show_about_dialog (this,
+                               "program-name",          AboutDialogInfos.program_name,
+                               "version",               AboutDialogInfos.version,
+                               "comments",              AboutDialogInfos.comments,
+                               "copyright",             AboutDialogInfos.copyright,
+                               "license-type",          AboutDialogInfos.license_type,
+                               "wrap-license", true,
+                               "authors",               authors,
+                               "translator-credits",    AboutDialogInfos.translator_credits,
+                               "logo-icon-name",        AboutDialogInfos.logo_icon_name,
+                               "website",               AboutDialogInfos.website,
+                               "website-label",         AboutDialogInfos.website_label,
+                               null);
+    }
+
+    /*\
+    * * in-window about
+    \*/
+
+    [CCode (notify = false)] protected bool in_window_about { protected get; private set; default = false; }
+
+    private void toggle_in_window_about ()
+    {
+        if (in_window_about)
+            show_default_view ();
+        else
+            show_about_view ();
+    }
+
+    private inline void show_about_view ()
+        requires (in_window_about == false)
+    {
+        close_in_window_panels ();
+
+        in_window_about = true;
+        headerbar.show_about_view ();
+        base_view.show_in_window_about ();
+    }
+
+    protected virtual void show_default_view (/* SimpleAction action, Variant? path_variant */)
+    {
+        if (in_window_about)
+        {
+            in_window_about = false;
+            headerbar.show_default_view ();
+            base_view.show_default_view ();
+        }
+        else
+            assert_not_reached ();
+    }
+
+    /*\
+    * * notifications
+    \*/
+
+    [GtkChild] private Overlay main_overlay;
+
+    private bool notifications_revealer_created = false;
+    private NotificationsRevealer notifications_revealer;
+
+    private void create_notifications_revealer ()
+    {
+        notifications_revealer = new NotificationsRevealer ();
+        add_adaptative_child (notifications_revealer);
+        notifications_revealer.set_window_size (window_size);
+        notifications_revealer.show ();
+        main_overlay.add_overlay (notifications_revealer);
+        notifications_revealer_created = true;
+    }
+
+    protected void show_notification (string notification)
+    {
+        if (!notifications_revealer_created)
+            create_notifications_revealer ();
+
+        notifications_revealer.show_notification (notification);
+    }
+
+    protected void hide_notification ()
+    {
+        if (!notifications_revealer_created)
+            return;
+
+        notifications_revealer.hide_notification ();
+    }
+}
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index c294e70..3ce29ec 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -488,8 +488,8 @@ private class BrowserView : BaseView, AdaptativeWidget
     [CCode (notify = false)] internal ViewType current_view { get { return current_child.current_view; }}
 
     // popovers invalidation and toggles hiding/revealing
-    internal void discard_row_popover () { current_child.discard_row_popover (); }
-    internal void invalidate_popovers () { current_child.invalidate_popovers (); }
+    internal override void close_popovers () { current_child.discard_row_popover (); }
+    internal void invalidate_popovers ()     { current_child.invalidate_popovers (); }
 
     internal void hide_or_show_toggles (bool show) { current_child.hide_or_show_toggles (show); }
 
diff --git a/editor/browser-window.vala b/editor/browser-window.vala
index d2dc625..e4174c4 100644
--- a/editor/browser-window.vala
+++ b/editor/browser-window.vala
@@ -17,8 +17,7 @@
 
 using Gtk;
 
-[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/browser-window.ui")]
-private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
+private abstract class BrowserWindow : BaseWindow
 {
     private const string root_path = "/";   // TODO allow changing that
 
@@ -28,19 +27,18 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
     protected string    saved_view      = "/";
     protected string    saved_selection = "";
 
-    private   BrowserHeaderBar headerbar;
-    protected BrowserView      browser_view;
+    private BrowserHeaderBar headerbar;
+    private BrowserView      browser_view;
 
     construct
     {
         headerbar = (BrowserHeaderBar) nta_headerbar;
+        browser_view = (BrowserView) base_view;
+
         headerbar.search_changed.connect (search_changed_cb);
         headerbar.search_stopped.connect (search_stopped_cb);
 
-        browser_view = new BrowserView ();
-        browser_view.vexpand = true;
-        browser_view.visible = true;
-        add_to_main_grid (browser_view);
+        this.button_press_event.connect (on_button_press_event);
 
         install_browser_action_entries ();
         install_key_action_entries ();
@@ -52,17 +50,6 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
         add_adaptative_child (this);
     }
 
-    /*\
-    * * main grid
-    \*/
-
-    [GtkChild] private Grid main_grid;
-
-    protected void add_to_main_grid (Widget widget)
-    {
-        main_grid.add (widget);
-    }
-
     /*\
     * * action entries
     \*/
@@ -109,10 +96,7 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
 
         { "hide-search",        hide_search },
         { "show-search",        show_search },
-        { "toggle-search",      toggle_search, "b", "false" },
-
-        { "show-default-panel", show_default_view },
-        { "about",              about }
+        { "toggle-search",      toggle_search, "b", "false" }
     };
 
     private void empty (/* SimpleAction action, Variant? variant */) {}
@@ -236,40 +220,6 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
             stop_search ();
     }
 
-    /*\
-    * * global callbacks
-    \*/
-
-    [GtkCallback]
-    private void on_destroy ()
-    {
-        before_destroy ();
-        base.destroy ();
-    }
-
-    protected abstract void before_destroy ();
-
-    /*\
-    * * adaptative stuff
-    \*/
-
-    private bool disable_popovers = false;
-    private void set_window_size (AdaptativeWidget.WindowSize new_size)
-    {
-        bool _disable_popovers = AdaptativeWidget.WindowSize.is_phone_size (new_size)
-                              || AdaptativeWidget.WindowSize.is_extra_thin (new_size);
-        if (disable_popovers != _disable_popovers)
-        {
-            disable_popovers = _disable_popovers;
-            if (in_window_about)
-                show_default_view ();
-        }
-
-        chain_set_window_size (new_size);
-    }
-
-    protected abstract void chain_set_window_size (AdaptativeWidget.WindowSize new_size);
-
     /*\
     * * actions and callbacks helpers
     \*/
@@ -349,15 +299,6 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
         return false;
     }
 
-    // action
-    protected virtual void close_in_window_panels ()
-    {
-        hide_notification ();
-        headerbar.close_popovers ();
-        if (in_window_about)
-            show_default_view ();
-    }
-
     /*\
     * * search callbacks
     \*/
@@ -389,7 +330,7 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
             return;
 
         headerbar.close_popovers ();        // by symmetry with go_forward()
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
 
         if (current_path == root_path)
             return;
@@ -409,7 +350,7 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
         headerbar.get_fallback_path_and_complete_path (out fallback_path, out complete_path);
 
         headerbar.close_popovers ();
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
 
         if (current_path == complete_path)  // TODO something?
             return;
@@ -508,7 +449,7 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
             }
         }
 
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
 
         _copy (get_copy_text ());
     }
@@ -518,7 +459,7 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
         if (is_in_in_window_mode ())        // TODO better
             return;
 
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
 
         _copy (get_copy_path_text ());
     }
@@ -589,7 +530,7 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
             return;
 
         headerbar.close_popovers ();    // should never be needed if headerbar.search_mode_enabled
-        browser_view.discard_row_popover ();   // could be needed if headerbar.search_mode_enabled
+        browser_view.close_popovers ();   // could be needed if headerbar.search_mode_enabled
 
         if (!headerbar.search_mode_enabled)
             request_search (true, PathEntry.SearchMode.SEARCH);
@@ -706,93 +647,22 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
         else
         {
             headerbar.toggle_hamburger_menu ();
-            browser_view.discard_row_popover ();
+            browser_view.close_popovers ();
         }
     }
 
-    /*\
-    * * about dialog or in-window panel
-    \*/
-
-    private void about (/* SimpleAction action, Variant? path_variant */)
-    {
-        if (!AdaptativeWidget.WindowSize.is_phone_size (window_size)
-         && !AdaptativeWidget.WindowSize.is_extra_thin (window_size))
-            show_about_dialog ();       // TODO hide the dialog if visible
-        else
-            toggle_in_window_about ();
-    }
-
-    private void show_about_dialog ()
-    {
-        string [] authors = AboutDialogInfos.authors;
-        Gtk.show_about_dialog (this,
-                               "program-name",          AboutDialogInfos.program_name,
-                               "version",               AboutDialogInfos.version,
-                               "comments",              AboutDialogInfos.comments,
-                               "copyright",             AboutDialogInfos.copyright,
-                               "license-type",          AboutDialogInfos.license_type,
-                               "wrap-license", true,
-                               "authors",               authors,
-                               "translator-credits",    AboutDialogInfos.translator_credits,
-                               "logo-icon-name",        AboutDialogInfos.logo_icon_name,
-                               "website",               AboutDialogInfos.website,
-                               "website-label",         AboutDialogInfos.website_label,
-                               null);
-    }
-
-    // in-window about
-    [CCode (notify = false)] protected bool in_window_about { protected get; private set; default = false; }
-
-    private void toggle_in_window_about ()
-    {
-        if (in_window_about)
-            show_default_view ();
-        else
-            show_about_view ();
-    }
-
-    private inline void show_about_view ()
-        requires (in_window_about == false)
-    {
-        close_in_window_panels ();
-
-        in_window_about = true;
-        headerbar.show_about_view ();
-        browser_view.show_in_window_about ();
-    }
-
-    protected virtual void show_default_view (/* SimpleAction action, Variant? path_variant */)
-    {
-        if (in_window_about)
-        {
-            in_window_about = false;
-            headerbar.show_default_view ();
-            browser_view.show_default_view ();
-        }
-        else
-            assert_not_reached ();
-    }
-
     /*\
     * * keyboard callback
     \*/
 
-    [GtkCallback]
-    private bool on_key_press_event (Widget widget, Gdk.EventKey event)
+    protected override bool on_key_press_event (Widget widget, Gdk.EventKey event)
     {
+        if (base.on_key_press_event (widget, event))
+            return true;
+
         uint keyval = event.keyval;
         string name = (!) (Gdk.keyval_name (keyval) ?? "");
 
-        if (name == "F1") // TODO fix dance done with the F1 & <Primary>F1 shortcuts that show help overlay
-        {
-            browser_view.discard_row_popover ();
-            if ((event.state & Gdk.ModifierType.SHIFT_MASK) == 0)
-                return false;   // help overlay
-            about ();
-            return true;
-        }
-
         /* for changing row during search; cannot use set_accels_for_action() else popovers are not handled 
anymore */
         if (name == "Down" && (event.state & Gdk.ModifierType.MOD1_MASK) == 0)  // see also <ctrl>g
             return _next_match ();
@@ -872,7 +742,6 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
                        "mouse-forward-button",    SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
     }
 
-    [GtkCallback]
     private bool on_button_press_event (Widget widget, Gdk.EventButton event)
     {
         if (!mouse_use_extra_buttons)
@@ -896,39 +765,4 @@ private abstract class BrowserWindow : AdaptativeWindow, AdaptativeWidget
         }
         return false;
     }
-
-    /*\
-    * * notifications
-    \*/
-
-    [GtkChild] private Overlay main_overlay;
-
-    private bool notifications_revealer_created = false;
-    private NotificationsRevealer notifications_revealer;
-
-    private void create_notifications_revealer ()
-    {
-        notifications_revealer = new NotificationsRevealer ();
-        add_adaptative_child (notifications_revealer);
-        notifications_revealer.set_window_size (window_size);
-        notifications_revealer.show ();
-        main_overlay.add_overlay (notifications_revealer);
-        notifications_revealer_created = true;
-    }
-
-    protected void show_notification (string notification)
-    {
-        if (!notifications_revealer_created)
-            create_notifications_revealer ();
-
-        notifications_revealer.show_notification (notification);
-    }
-
-    protected void hide_notification ()
-    {
-        if (!notifications_revealer_created)
-            return;
-
-        notifications_revealer.hide_notification ();
-    }
 }
diff --git a/editor/dconf-editor.gresource.xml b/editor/dconf-editor.gresource.xml
index 1cbd569..66651eb 100644
--- a/editor/dconf-editor.gresource.xml
+++ b/editor/dconf-editor.gresource.xml
@@ -3,12 +3,12 @@
   <gresource prefix="/ca/desrt/dconf-editor/ui">
     <file preprocess="xml-stripblanks">base-headerbar.ui</file>
     <file preprocess="xml-stripblanks">base-view.ui</file>
+    <file preprocess="xml-stripblanks">base-window.ui</file>
     <file preprocess="xml-stripblanks">bookmark.ui</file>
     <file preprocess="xml-stripblanks">bookmarks.ui</file>
     <file preprocess="xml-stripblanks">bookmarks-controller.ui</file>
     <file preprocess="xml-stripblanks">browser-infobar.ui</file>
     <file preprocess="xml-stripblanks">browser-stack.ui</file>
-    <file preprocess="xml-stripblanks">browser-window.ui</file>
     <file preprocess="xml-stripblanks">config-list-box-row.ui</file>
     <file>dconf-editor.css</file>
     <file preprocess="xml-stripblanks">delayed-setting-view.ui</file>
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 4354efa..f596c7f 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -102,6 +102,7 @@ private class DConfWindow : BrowserWindow
     private ulong bookmarks_selection_changed_handler = 0;
 
     private DConfHeaderBar headerbar;
+    private BrowserView    browser_view;
 
     private StyleContext context;
     construct
@@ -110,6 +111,9 @@ private class DConfWindow : BrowserWindow
         context = get_style_context ();
         context.add_class ("dconf-editor");
 
+        headerbar = (DConfHeaderBar) nta_headerbar;
+        browser_view = (BrowserView) base_view;
+
         create_modifications_revealer ();
 
         install_ui_action_entries ();
@@ -117,16 +121,16 @@ private class DConfWindow : BrowserWindow
         install_bmk_action_entries ();
 
         bookmarks_selection_changed_handler = browser_view.bookmarks_selection_changed.connect 
(on_bookmarks_selection_changed);
+
+          headerbar_update_bookmarks_icons_handler =    headerbar.update_bookmarks_icons.connect 
(update_bookmarks_icons_from_variant);
+        browserview_update_bookmarks_icons_handler = browser_view.update_bookmarks_icons.connect 
(update_bookmarks_icons_from_variant);
     }
 
     internal DConfWindow (bool disable_warning, string? schema, string? path, string? key_name, 
NightLightMonitor night_light_monitor)
     {
         DConfHeaderBar _headerbar = new DConfHeaderBar (night_light_monitor);
-        Object (nta_headerbar: (NightTimeAwareHeaderBar) _headerbar);
-        headerbar = _headerbar;
-
-        headerbar_update_bookmarks_icons_handler = headerbar.update_bookmarks_icons.connect 
(update_bookmarks_icons_from_variant);
-        browserview_update_bookmarks_icons_handler = browser_view.update_bookmarks_icons.connect 
(update_bookmarks_icons_from_variant);
+        BrowserView _browser_view = new BrowserView ();
+        Object (nta_headerbar: (NightTimeAwareHeaderBar) _headerbar, base_view: (BaseView) _browser_view);
 
         use_shortpaths_changed_handler = settings.changed ["use-shortpaths"].connect_after (reload_view);
         settings.bind ("use-shortpaths", model, "use-shortpaths", 
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
@@ -762,7 +766,7 @@ private class DConfWindow : BrowserWindow
 
     private void toggle_bookmark                        (/* SimpleAction action, Variant? variant */)
     {
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
         if (!AdaptativeWidget.WindowSize.is_phone_size (window_size)
          && !AdaptativeWidget.WindowSize.is_extra_thin (window_size))
         {
@@ -781,7 +785,7 @@ private class DConfWindow : BrowserWindow
         if (is_in_in_window_mode ())        // TODO better
             return;
 
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
         headerbar.bookmark_current_path ();
     }
 
@@ -790,7 +794,7 @@ private class DConfWindow : BrowserWindow
         if (is_in_in_window_mode ())        // TODO better
             return;
 
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
         headerbar.unbookmark_current_path ();
     }
 
@@ -830,7 +834,7 @@ private class DConfWindow : BrowserWindow
         if (row_action_blocked ())
             return;
 
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
         browser_view.toggle_boolean_key ();
     }
 
@@ -844,7 +848,7 @@ private class DConfWindow : BrowserWindow
             reload_view ();
             return;
         }
-        browser_view.discard_row_popover ();
+        browser_view.close_popovers ();
         string selected_row = browser_view.get_selected_row_name ();
         if (selected_row.has_suffix ("/"))
             reset_path ((!) selected_row, true);
diff --git a/editor/meson.build b/editor/meson.build
index 8475a02..a84e222 100644
--- a/editor/meson.build
+++ b/editor/meson.build
@@ -71,6 +71,7 @@ sources = files(
   'adaptative-window.vala',
   'base-headerbar.vala',
   'base-view.vala',
+  'base-window.vala',
   'bookmarks.vala',
   'bookmarks-controller.vala',
   'bookmarks-list.vala',
@@ -110,12 +111,12 @@ sources = files(
 resource_data = files(
   'base-headerbar.ui',
   'base-view.ui',
+  'base-window.ui',
   'bookmarks.ui',
   'bookmarks-controller.ui',
   'bookmark.ui',
   'browser-infobar.ui',
   'browser-stack.ui',
-  'browser-window.ui',
   'config-list-box-row.ui',
   'dconf-editor.css',
   'delayed-setting-view.ui',


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