[dconf-editor] RegistryPlaceholder.



commit d9d10b6e72e7a800d46ea3f6a4475e9ad656c6df
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Nov 17 17:19:34 2017 +0100

    RegistryPlaceholder.

 editor/dconf-editor.gresource.xml |    1 +
 editor/meson.build                |    2 ++
 editor/registry-placeholder.ui    |   34 ++++++++++++++++++++++++++++++++++
 editor/registry-placeholder.vala  |   31 +++++++++++++++++++++++++++++++
 editor/registry-view.ui           |   33 +++------------------------------
 5 files changed, 71 insertions(+), 30 deletions(-)
---
diff --git a/editor/dconf-editor.gresource.xml b/editor/dconf-editor.gresource.xml
index 9c19ce1..2a65d68 100644
--- a/editor/dconf-editor.gresource.xml
+++ b/editor/dconf-editor.gresource.xml
@@ -12,6 +12,7 @@
     <file preprocess="xml-stripblanks">pathbar-item.ui</file>
     <file preprocess="xml-stripblanks">property-row.ui</file>
     <file preprocess="xml-stripblanks">registry-info.ui</file>
+    <file preprocess="xml-stripblanks">registry-placeholder.ui</file>
     <file preprocess="xml-stripblanks">registry-view.ui</file>
   </gresource>
   <gresource prefix="/ca/desrt/dconf-editor/gtk">
diff --git a/editor/meson.build b/editor/meson.build
index a067949..99c3a4c 100644
--- a/editor/meson.build
+++ b/editor/meson.build
@@ -59,6 +59,7 @@ sources = files(
   'modifications-revealer.vala',
   'pathbar.vala',
   'registry-info.vala',
+  'registry-placeholder.vala',
   'registry-view.vala'
 )
 
@@ -76,6 +77,7 @@ resource_data = files(
   'pathbar.ui',
   'property-row.ui',
   'registry-info.ui',
+  'registry-placeholder.ui',
   'registry-view.ui'
 )
 
diff --git a/editor/registry-placeholder.ui b/editor/registry-placeholder.ui
new file mode 100644
index 0000000..73cd8d3
--- /dev/null
+++ b/editor/registry-placeholder.ui
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <template class="RegistryPlaceholder" parent="GtkGrid"> <!-- see 
nautilus/src/resources/ui/nautilus-folder-is-empty.ui -->
+    <property name="visible">True</property>
+    <property name="row-spacing">12</property>
+    <property name="expand">True</property>
+    <property name="halign">center</property>
+    <property name="valign">center</property>
+    <property name="orientation">vertical</property>
+    <style>
+      <class name="dim-label"/>
+    </style>
+    <child>
+      <object class="GtkImage">
+        <property name="visible">True</property>
+        <property name="icon-name">ca.desrt.dconf-editor-symbolic</property>
+        <property name="pixel-size">72</property>
+        <style>
+          <class name="dim-label"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkLabel" id="placeholder_label">
+        <property name="visible">True</property>
+        <attributes>
+          <attribute name="weight" value="bold"/>
+          <attribute name="scale" value="1.44"/>
+        </attributes>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/editor/registry-placeholder.vala b/editor/registry-placeholder.vala
new file mode 100644
index 0000000..376706b
--- /dev/null
+++ b/editor/registry-placeholder.vala
@@ -0,0 +1,31 @@
+/*
+  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 <http://www.gnu.org/licenses/>.
+*/
+
+using Gtk;
+
+[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/registry-placeholder.ui")]
+class RegistryPlaceholder : Grid
+{
+    [GtkChild] private Label placeholder_label;
+
+    public string label { private get; construct; }
+
+    construct
+    {
+        placeholder_label.label = label;
+    }
+}
diff --git a/editor/registry-view.ui b/editor/registry-view.ui
index 378a647..a391ec9 100644
--- a/editor/registry-view.ui
+++ b/editor/registry-view.ui
@@ -134,37 +134,10 @@
                   <class name="keys-list"/>
                 </style>
                 <signal name="row-activated" handler="row_activated_cb"/>
-                <child type="placeholder">      <!-- see 
nautilus/src/resources/ui/nautilus-folder-is-empty.ui -->
-                  <object class="GtkGrid">
+                <child type="placeholder">
+                  <object class="RegistryPlaceholder">
                     <property name="visible">True</property>
-                    <property name="row-spacing">12</property>
-                    <property name="expand">True</property>
-                    <property name="halign">center</property>
-                    <property name="valign">center</property>
-                    <property name="orientation">vertical</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                    <child>
-                      <object class="GtkImage">
-                        <property name="visible">True</property>
-                        <property name="icon-name">dconf-editor-symbolic</property>
-                        <property name="pixel-size">72</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkLabel">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">No keys in this path</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                          <attribute name="scale" value="1.44"/>
-                        </attributes>
-                      </object>
-                    </child>
+                    <property name="label" translatable="yes">No keys in this path</property>
                   </object>
                 </child>
               </object>


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