[dconf-editor] Restrict access to placeholder.



commit dcc97c0564363f0910f00c367bf1792be120b1ea
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Dec 7 14:05:28 2018 +0100

    Restrict access to placeholder.

 editor/registry-list.vala   | 5 ++++-
 editor/registry-search.vala | 3 ++-
 editor/registry-view.vala   | 3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/editor/registry-list.vala b/editor/registry-list.vala
index 989e529..ac59737 100644
--- a/editor/registry-list.vala
+++ b/editor/registry-list.vala
@@ -21,7 +21,6 @@ using Gtk;
 private abstract class RegistryList : Grid, BrowsableView, AdaptativeWidget
 {
     [GtkChild] protected ListBox key_list_box;
-    [GtkChild] protected RegistryPlaceholder placeholder;
     [GtkChild] private ScrolledWindow scrolled;
     private Adjustment adjustment;
 
@@ -35,8 +34,12 @@ private abstract class RegistryList : Grid, BrowsableView, AdaptativeWidget
 
     internal ModificationsHandler modifications_handler { protected get; set; }
 
+    [GtkChild] private RegistryPlaceholder placeholder;
+    public abstract string placeholder_label { protected get; }
+
     construct
     {
+        placeholder.label = placeholder_label;
         register_size_allocate ();
 
         adjustment = key_list_box.get_adjustment ();
diff --git a/editor/registry-search.vala b/editor/registry-search.vala
index 96bc4a0..38b96e5 100644
--- a/editor/registry-search.vala
+++ b/editor/registry-search.vala
@@ -22,10 +22,11 @@ private class RegistrySearch : RegistryList
     private string [] bookmarks;
     private SortingOptions sorting_options;
 
+    public override string placeholder_label { protected get { return _("No matches"); }}
+
     construct
     {
         search_mode = true;
-        placeholder.label = _("No matches");
         key_list_box.set_header_func (update_row_header);
     }
 
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index fa6cc50..fdca82f 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -19,10 +19,11 @@ using Gtk;
 
 private class RegistryView : RegistryList
 {
+    public override string placeholder_label { protected get { return _("No keys in this path"); }}
+
     construct
     {
         search_mode = false;
-        placeholder.label = _("No keys in this path");
         key_list_box.set_header_func (update_row_header);
     }
 


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