[gnome-software] Show a placeholder when an application has no screenshots



commit dff34ddc2ece929c7e46dc92c3031935a9e4f845
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jul 12 20:02:26 2016 +0100

    Show a placeholder when an application has no screenshots
    
    Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=768581

 src/gs-shell-details.c  |    5 +++-
 src/gs-shell-details.ui |   69 +++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 62 insertions(+), 12 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 5d7758e..83b710b 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -112,6 +112,7 @@ struct _GsShellDetails
        GtkWidget               *label_licenses_intro;
        GtkWidget               *list_box_addons;
        GtkWidget               *box_reviews;
+       GtkWidget               *box_details_screenshot_fallback;
        GtkWidget               *histogram;
        GtkWidget               *button_review;
        GtkWidget               *list_box_reviews;
@@ -573,7 +574,8 @@ gs_shell_details_refresh_screenshots (GsShellDetails *self)
        /* set screenshots */
        gs_container_remove_all (GTK_CONTAINER (self->box_details_screenshot_main));
        screenshots = gs_app_get_screenshots (self->app);
-       gtk_widget_set_visible (self->box_details_screenshot, screenshots->len > 0);
+       gtk_widget_set_visible (self->box_details_screenshot_fallback,
+                               screenshots->len == 0);
        if (screenshots->len == 0) {
                gs_container_remove_all (GTK_CONTAINER (self->box_details_screenshot_thumbnails));
                return;
@@ -1968,6 +1970,7 @@ gs_shell_details_class_init (GsShellDetailsClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_webapp);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, list_box_addons);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_reviews);
+       gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details_screenshot_fallback);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, histogram);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_review);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, list_box_reviews);
diff --git a/src/gs-shell-details.ui b/src/gs-shell-details.ui
index 0b820e3..34fd206 100644
--- a/src/gs-shell-details.ui
+++ b/src/gs-shell-details.ui
@@ -428,6 +428,53 @@
                           </packing>
                         </child>
                         <child>
+                          <object class="GtkBox" id="box_details_screenshot_fallback">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <property name="spacing">6</property>
+                            <property name="width_request">752</property>
+                            <property name="height_request">423</property>
+                            <property name="hexpand">True</property>
+                            <property name="halign">fill</property>
+                            <style>
+                              <class name="screenshot-image"/>
+                            </style>
+                            <child>
+                              <object class="GtkImage">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="pixel_size">64</property>
+                                <property name="icon_name">camera-photo-symbolic</property>
+                                <property name="icon_size">6</property>
+                                <property name="valign">end</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="halign">center</property>
+                                <property name="valign">start</property>
+                                <property name="label" translatable="yes">No screenshot provided</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                        <child>
                           <object class="GtkBox" id="box_details_description">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
@@ -441,7 +488,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">3</property>
+                            <property name="position">4</property>
                           </packing>
                         </child>
 
@@ -461,7 +508,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">4</property>
+                            <property name="position">5</property>
                           </packing>
                         </child>
 
@@ -476,7 +523,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">5</property>
+                            <property name="position">6</property>
                           </packing>
                         </child>
                         <child>
@@ -490,7 +537,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">6</property>
+                            <property name="position">7</property>
                           </packing>
                         </child>
                         <child>
@@ -504,7 +551,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">7</property>
+                            <property name="position">8</property>
                           </packing>
                         </child>
                         <child>
@@ -519,7 +566,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">8</property>
+                            <property name="position">9</property>
                           </packing>
                         </child>
                         <child>
@@ -547,7 +594,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">9</property>
+                            <property name="position">10</property>
                           </packing>
                         </child>
                         <child>
@@ -566,7 +613,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">10</property>
+                            <property name="position">11</property>
                           </packing>
                         </child>
                         <child>
@@ -1065,7 +1112,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">11</property>
+                            <property name="position">12</property>
                           </packing>
                         </child>
                         <child>
@@ -1127,7 +1174,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">12</property>
+                            <property name="position">13</property>
                           </packing>
                         </child>
                         <child>
@@ -1193,7 +1240,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">13</property>
+                            <property name="position">14</property>
                           </packing>
                         </child>
                       </object>


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