[gnome-games] ui: Introduce CollectionEmpty



commit b61e46c22115c5f5f6659a6972e41cadd8043bdf
Author: Neville <nevilleantony98 gmail com>
Date:   Thu Jun 18 21:17:28 2020 +0530

    ui: Introduce CollectionEmpty
    
    This page will be shown when a collection is viewed and it is/becomes
    empty.

 data/org.gnome.Games.gresource.xml |  1 +
 data/ui/collection-empty.ui        | 48 ++++++++++++++++++++++++++++++++++++++
 src/meson.build                    |  1 +
 src/ui/collection-empty.vala       |  5 ++++
 4 files changed, 55 insertions(+)
---
diff --git a/data/org.gnome.Games.gresource.xml b/data/org.gnome.Games.gresource.xml
index 4d96e95e..8cf2e639 100644
--- a/data/org.gnome.Games.gresource.xml
+++ b/data/org.gnome.Games.gresource.xml
@@ -12,6 +12,7 @@
     <file preprocess="xml-stripblanks">gesture/stick-symbolic.svg</file>
     <file preprocess="xml-stripblanks">ui/application-window.ui</file>
     <file preprocess="xml-stripblanks">ui/checkmark-item.ui</file>
+    <file preprocess="xml-stripblanks">ui/collection-empty.ui</file>
     <file preprocess="xml-stripblanks">ui/collection-icon-view.ui</file>
     <file preprocess="xml-stripblanks">ui/collection-view.ui</file>
     <file preprocess="xml-stripblanks">ui/display-view.ui</file>
diff --git a/data/ui/collection-empty.ui b/data/ui/collection-empty.ui
new file mode 100644
index 00000000..056fe0e0
--- /dev/null
+++ b/data/ui/collection-empty.ui
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="3.24"/>
+  <template class="GamesCollectionEmpty" parent="GtkBox">
+    <property name="visible">True</property>
+    <property name="orientation">vertical</property>
+    <property name="halign">center</property>
+    <property name="valign">center</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkImage">
+        <property name="visible">True</property>
+        <property name="icon-name">folder-symbolic</property>
+        <property name="pixel-size">128</property>
+        <property name="margin-bottom">6</property>
+        <style>
+          <class name="dim-label"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkLabel">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">This collection is empty</property>
+        <property name="justify">center</property>
+        <property name="wrap">True</property>
+        <style>
+          <class name="dim-label"/>
+        </style>
+        <attributes>
+          <attribute name="weight" value="bold"/>
+          <attribute name="scale" value="2"/>
+        </attributes>
+      </object>
+    </child>
+    <child>
+      <object class="GtkLabel">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">Please add some games to this collection to see them 
here.</property>
+        <property name="justify">left</property>
+        <property name="wrap">true</property>
+        <style>
+          <class name="dim-label"/>
+        </style>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/src/meson.build b/src/meson.build
index 598827f8..85e88625 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -109,6 +109,7 @@ vala_sources = [
   'ui/application.vala',
   'ui/application-window.vala',
   'ui/checkmark-item.vala',
+  'ui/collection-empty.vala',
   'ui/collection-icon-view.vala',
   'ui/collection-view.vala',
   'ui/display-bin.vala',
diff --git a/src/ui/collection-empty.vala b/src/ui/collection-empty.vala
new file mode 100644
index 00000000..8deb699f
--- /dev/null
+++ b/src/ui/collection-empty.vala
@@ -0,0 +1,5 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+[GtkTemplate (ui = "/org/gnome/Games/ui/collection-empty.ui")]
+private class Games.CollectionEmpty : Gtk.Box {
+}


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