[gnome-software: 4/5] gs-app-context-bar: Connect the storage context dialogue




commit c7ad08769a13caf351afa48c216a1cc482e63f2a
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Aug 9 17:18:24 2021 +0100

    gs-app-context-bar: Connect the storage context dialogue
    
    Now clicking on the storage tile will open its dialogue.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Fixes: #1353

 src/gs-app-context-bar.c  |   5 ++-
 src/gs-app-context-bar.ui | 105 ++++++++++++++++++++++++----------------------
 2 files changed, 60 insertions(+), 50 deletions(-)
---
diff --git a/src/gs-app-context-bar.c b/src/gs-app-context-bar.c
index 197b90a00..4873d0bba 100644
--- a/src/gs-app-context-bar.c
+++ b/src/gs-app-context-bar.c
@@ -38,6 +38,7 @@
 #include "gs-app-context-bar.h"
 #include "gs-hardware-support-context-dialog.h"
 #include "gs-safety-context-dialog.h"
+#include "gs-storage-context-dialog.h"
 
 typedef struct
 {
@@ -639,7 +640,9 @@ tile_clicked_cb (GtkWidget *widget,
        GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
 
        if (GTK_IS_WINDOW (toplevel)) {
-               if (widget == self->tiles[SAFETY_TILE].tile)
+               if (widget == self->tiles[STORAGE_TILE].tile)
+                       dialog = GTK_WINDOW (gs_storage_context_dialog_new (self->app));
+               else if (widget == self->tiles[SAFETY_TILE].tile)
                        dialog = GTK_WINDOW (gs_safety_context_dialog_new (self->app));
                else if (widget == self->tiles[HARDWARE_SUPPORT_TILE].tile)
                        dialog = GTK_WINDOW (gs_hardware_support_context_dialog_new (self->app));
diff --git a/src/gs-app-context-bar.ui b/src/gs-app-context-bar.ui
index 3d0878793..5f65cfb1a 100644
--- a/src/gs-app-context-bar.ui
+++ b/src/gs-app-context-bar.ui
@@ -13,70 +13,77 @@
     </style>
 
     <child>
-      <object class="GtkBox" id="storage_tile">
-        <property name="orientation">vertical</property>
-        <property name="spacing">8</property>
+      <object class="GtkButton" id="storage_tile">
         <property name="visible">True</property>
+        <signal name="clicked" handler="tile_clicked_cb"/>
         <style>
           <class name="context-tile"/>
+          <class name="flat"/>
         </style>
         <child>
-          <object class="GtkBox" id="storage_tile_lozenge">
-            <property name="halign">center</property>
+          <object class="GtkBox">
+            <property name="orientation">vertical</property>
+            <property name="spacing">8</property>
             <property name="visible">True</property>
-            <style>
-              <class name="context-tile-lozenge"/>
-              <class name="grey"/>
-            </style>
             <child>
-              <object class="GtkLabel" id="storage_tile_lozenge_content">
+              <object class="GtkBox" id="storage_tile_lozenge">
                 <property name="halign">center</property>
+                <property name="visible">True</property>
+                <style>
+                  <class name="context-tile-lozenge"/>
+                  <class name="grey"/>
+                </style>
+                <child>
+                  <object class="GtkLabel" id="storage_tile_lozenge_content">
+                    <property name="halign">center</property>
+                    <!-- this is a placeholder: the text is actually set in code -->
+                    <property name="label">20 MB</property>
+                    <property name="visible">True</property>
+                    <property name="xalign">0.5</property>
+                    <accessibility>
+                      <relation target="storage_tile_title" type="labelled-by"/>
+                      <relation target="storage_tile_description" type="details"/>
+                    </accessibility>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="storage_tile_title">
                 <!-- this is a placeholder: the text is actually set in code -->
-                <property name="label">20 MB</property>
+                <property name="label">Download Size</property>
                 <property name="visible">True</property>
                 <property name="xalign">0.5</property>
                 <accessibility>
-                  <relation target="storage_tile_title" type="labelled-by"/>
-                  <relation target="storage_tile_description" type="details"/>
+                  <relation target="storage_tile_lozenge_content" type="label-for"/>
                 </accessibility>
+                <style>
+                  <class name="context-tile-title"/>
+                </style>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel" id="storage_tile_description">
+                <property name="justify">center</property>
+                <!-- this is a placeholder: the text is actually set in code -->
+                <property name="label">Needs 150 MB of additional system downloads</property>
+                <property name="visible">True</property>
+                <property name="wrap">True</property>
+                <property name="xalign">0.5</property>
+                <accessibility>
+                  <relation target="storage_tile_lozenge_content" type="details-for"/>
+                </accessibility>
+                <style>
+                  <class name="context-tile-description"/>
+                </style>
               </object>
-              <packing>
-                <property name="expand">True</property>
-              </packing>
             </child>
-          </object>
-          <packing>
-            <property name="fill">False</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="storage_tile_title">
-            <!-- this is a placeholder: the text is actually set in code -->
-            <property name="label">Download Size</property>
-            <property name="visible">True</property>
-            <property name="xalign">0.5</property>
-            <accessibility>
-              <relation target="storage_tile_lozenge_content" type="label-for"/>
-            </accessibility>
-            <style>
-              <class name="context-tile-title"/>
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="storage_tile_description">
-            <property name="justify">center</property>
-            <!-- this is a placeholder: the text is actually set in code -->
-            <property name="label">Needs 150 MB of additional system downloads</property>
-            <property name="visible">True</property>
-            <property name="wrap">True</property>
-            <property name="xalign">0.5</property>
-            <accessibility>
-              <relation target="storage_tile_lozenge_content" type="details-for"/>
-            </accessibility>
-            <style>
-              <class name="context-tile-description"/>
-            </style>
           </object>
         </child>
       </object>


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