[geary/wip/794700-lazy-load-conversations: 14/19] Make EmptyPlaceholder more generally useful and rename to fit style



commit bd960dcaf5c70aa0ad6a13181766589ad3987c6b
Author: Michael Gratton <mike vee net>
Date:   Sun Jan 20 18:18:19 2019 +1030

    Make EmptyPlaceholder more generally useful and rename to fit style

 po/POTFILES.in                                     |  2 +-
 ...older.vala => components-placeholder-pane.vala} |  9 ++++---
 .../conversation-viewer/conversation-viewer.vala   | 28 ++++++++++++++++++----
 src/client/meson.build                             |  2 +-
 ...aceholder.ui => components-placeholder-pane.ui} |  8 +++----
 ui/geary.css                                       |  6 ++---
 ui/org.gnome.Geary.gresource.xml                   |  2 +-
 7 files changed, 40 insertions(+), 17 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ca8fcc94..bcbbb01f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -25,9 +25,9 @@ src/client/application/goa-mediator.vala
 src/client/application/main.vala
 src/client/application/secret-mediator.vala
 src/client/components/client-web-view.vala
+src/client/components/components-placeholder-pane.vala
 src/client/components/components-validator.vala
 src/client/components/count-badge.vala
-src/client/components/empty-placeholder.vala
 src/client/components/folder-popover.vala
 src/client/components/icon-factory.vala
 src/client/components/main-toolbar.vala
diff --git a/src/client/components/empty-placeholder.vala 
b/src/client/components/components-placeholder-pane.vala
similarity index 73%
rename from src/client/components/empty-placeholder.vala
rename to src/client/components/components-placeholder-pane.vala
index 8331c080..ec8926f9 100644
--- a/src/client/components/empty-placeholder.vala
+++ b/src/client/components/components-placeholder-pane.vala
@@ -8,19 +8,22 @@
 /**
  * A placeholder image and message for empty views.
  */
-[GtkTemplate (ui = "/org/gnome/Geary/empty-placeholder.ui")]
-public class EmptyPlaceholder : Gtk.Grid {
+[GtkTemplate (ui = "/org/gnome/Geary/components-placeholder-pane.ui")]
+public class Components.PlaceholderPane : Gtk.Grid {
 
-    public string image_name {
+    /** The icon name of the pane's image. */
+    public string icon_name {
         owned get { return this.placeholder_image.icon_name; }
         set { this.placeholder_image.icon_name = value; }
     }
 
+    /** The text of the pane's title label. */
     public string title {
         get { return this.title_label.get_text(); }
         set { this.title_label.set_text(value); }
     }
 
+    /** The text of the pane's sub-title label. */
     public string subtitle {
         get { return this.subtitle_label.get_text(); }
         set { this.subtitle_label.set_text(value); }
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index 4a542fcc..7ded5f14 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -73,29 +73,49 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
         base_ref();
         this.config = config;
 
-        EmptyPlaceholder no_conversations = new EmptyPlaceholder();
+        Components.PlaceholderPane no_conversations = new Components.PlaceholderPane();
+        no_conversations.icon_name = "folder-symbolic";
+        // Translators: Title label for placeholder when no
+        // conversations have been selected.
         no_conversations.title = _("No conversations selected");
+        // Translators: Sub-title label for placeholder when no
+        // conversations have been selected.
         no_conversations.subtitle = _(
             "Selecting a conversation from the list will display it here"
         );
         this.no_conversations_page.add(no_conversations);
 
-        EmptyPlaceholder multi_conversations = new EmptyPlaceholder();
+        Components.PlaceholderPane multi_conversations = new Components.PlaceholderPane();
+        no_conversations.icon_name = "folder-symbolic";
+        // Translators: Title label for placeholder when multiple
+        // conversations have been selected.
         multi_conversations.title = _("Multiple conversations selected");
+        // Translators: Sub-title label for placeholder when multiple
+        // conversations have been selected.
         multi_conversations.subtitle = _(
             "Choosing an action will apply to all selected conversations"
         );
         this.multiple_conversations_page.add(multi_conversations);
 
-        EmptyPlaceholder empty_folder = new EmptyPlaceholder();
+        Components.PlaceholderPane empty_folder = new Components.PlaceholderPane();
+        no_conversations.icon_name = "folder-symbolic";
+        // Translators: Title label for placeholder when no
+        // conversations have exist in a folder.
         empty_folder.title = _("No conversations found");
+        // Translators: Sub-title label for placeholder when no
+        // conversations have exist in a folder.
         empty_folder.subtitle = _(
             "This folder does not contain any conversations"
         );
         this.empty_folder_page.add(empty_folder);
 
-        EmptyPlaceholder empty_search = new EmptyPlaceholder();
+        Components.PlaceholderPane empty_search = new Components.PlaceholderPane();
+        no_conversations.icon_name = "folder-symbolic";
+        // Translators: Title label for placeholder when no
+        // conversations have been found in a search.
         empty_search.title = _("No conversations found");
+        // Translators: Sub-title label for placeholder when no
+        // conversations have been found in a search.
         empty_search.subtitle = _(
             "Your search returned no results, try refining your search terms"
         );
diff --git a/src/client/meson.build b/src/client/meson.build
index a037366e..424ae473 100644
--- a/src/client/meson.build
+++ b/src/client/meson.build
@@ -21,9 +21,9 @@ geary_client_vala_sources = files(
   'accounts/accounts-manager.vala',
 
   'components/client-web-view.vala',
+  'components/components-placeholder-pane.vala',
   'components/components-validator.vala',
   'components/count-badge.vala',
-  'components/empty-placeholder.vala',
   'components/folder-popover.vala',
   'components/icon-factory.vala',
   'components/main-toolbar.vala',
diff --git a/ui/empty-placeholder.ui b/ui/components-placeholder-pane.ui
similarity index 89%
rename from ui/empty-placeholder.ui
rename to ui/components-placeholder-pane.ui
index 1de05f16..ee2e8241 100644
--- a/ui/empty-placeholder.ui
+++ b/ui/components-placeholder-pane.ui
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface>
   <requires lib="gtk+" version="3.14"/>
-  <template class="EmptyPlaceholder" parent="GtkGrid">
+  <template class="ComponentsPlaceholderPane" parent="GtkGrid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="halign">center</property>
@@ -14,7 +14,7 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="pixel_size">72</property>
-        <property name="icon_name">folder-symbolic</property>
+        <property name="icon_name">image-x-generic-symbolic</property>
         <property name="icon_size">6</property>
       </object>
       <packing>
@@ -52,7 +52,7 @@
     </child>
     <style>
       <class name="dim-label"/>
-      <class name="geary-empty-placeholder"/>
+      <class name="geary-placeholder-pane"/>
     </style>
   </template>
 </interface>
diff --git a/ui/geary.css b/ui/geary.css
index 665a8947..4546bab5 100644
--- a/ui/geary.css
+++ b/ui/geary.css
@@ -178,12 +178,12 @@ grid.geary-message-summary {
   border-radius: 0px;
 }
 
-/* EmptyPlaceholder */
+/* PlaceholderPane  */
 
-.geary-empty-placeholder > image {
+.geary-placeholder-pane > image {
   margin-bottom: 12px;
 }
-.geary-empty-placeholder > .title {
+.geary-placeholder-pane > .title {
   font-weight: bold;
 }
 
diff --git a/ui/org.gnome.Geary.gresource.xml b/ui/org.gnome.Geary.gresource.xml
index 9aa268bb..2f8190de 100644
--- a/ui/org.gnome.Geary.gresource.xml
+++ b/ui/org.gnome.Geary.gresource.xml
@@ -10,6 +10,7 @@
     <file compressed="true" preprocess="xml-stripblanks">certificate_warning_dialog.glade</file>
     <file compressed="true">client-web-view.js</file>
     <file compressed="true">client-web-view-allow-remote-images.js</file>
+    <file compressed="true" preprocess="xml-stripblanks">components-placeholder-pane.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">composer-headerbar.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">composer-link-popover.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">composer-menus.ui</file>
@@ -24,7 +25,6 @@
     <file compressed="true" preprocess="xml-stripblanks">conversation-viewer.ui</file>
     <file compressed="true">conversation-web-view.css</file>
     <file compressed="true">conversation-web-view.js</file>
-    <file compressed="true" preprocess="xml-stripblanks">empty-placeholder.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">find_bar.glade</file>
     <file compressed="true" preprocess="xml-stripblanks">folder-popover.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">gtk/help-overlay.ui</file>


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