[gnome-control-center] applications: make storage dialog resizable and use AdwPreferences{Page, Group}



commit 65b939ad38dda09a417460b9f4d8f1204f71bdd6
Author: Christopher Davis <christopherdavis gnome org>
Date:   Sat Jan 22 12:22:36 2022 -0800

    applications: make storage dialog resizable and use AdwPreferences{Page,Group}
    
    The dialog needs to be resizeable in order to work on mobile.
    For that reason, it also needs scrolling. Because it needs
    scrolling, we can't have the flat headerbar without custom
    behavior.
    
    For now, use a regular headerbar and AdwPreferences{Group,Page}

 panels/applications/cc-applications-panel.c  |  2 --
 panels/applications/cc-applications-panel.ui | 48 ++++++++--------------------
 2 files changed, 13 insertions(+), 37 deletions(-)
---
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 6a17b6086..56090841a 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -124,7 +124,6 @@ struct _CcApplicationsPanel
   GtkWidget       *usage_section;
   CcInfoRow       *storage;
   GtkDialog       *storage_dialog;
-  GtkListBox      *storage_list;
   CcInfoRow       *app;
   CcInfoRow       *data;
   CcInfoRow       *cache;
@@ -1762,7 +1761,6 @@ cc_applications_panel_class_init (CcApplicationsPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcApplicationsPanel, stack);
   gtk_widget_class_bind_template_child (widget_class, CcApplicationsPanel, storage);
   gtk_widget_class_bind_template_child (widget_class, CcApplicationsPanel, storage_dialog);
-  gtk_widget_class_bind_template_child (widget_class, CcApplicationsPanel, storage_list);
   gtk_widget_class_bind_template_child (widget_class, CcApplicationsPanel, total);
   gtk_widget_class_bind_template_child (widget_class, CcApplicationsPanel, usage_section);
   gtk_widget_class_bind_template_child (widget_class, CcApplicationsPanel, view_details_button);
diff --git a/panels/applications/cc-applications-panel.ui b/panels/applications/cc-applications-panel.ui
index a937a3667..30c54737a 100644
--- a/panels/applications/cc-applications-panel.ui
+++ b/panels/applications/cc-applications-panel.ui
@@ -409,38 +409,15 @@
     <property name="title" translatable="yes">Storage</property>
     <property name="modal">1</property>
     <property name="use-header-bar">1</property>
-    <property name="resizable">0</property>
+    <property name="resizable">True</property>
     <property name="hide-on-close">True</property>
-    <child type="titlebar">
-      <object class="GtkHeaderBar">
-        <property name="show-title-buttons">True</property>
-        <style>
-          <class name="flat" />
-        </style>
-      </object>
-    </child>
+    <property name="default-width">420</property>
+    <property name="default-height">420</property>
     <child>
-      <object class="GtkBox">
-        <property name="margin-top">18</property>
-        <property name="margin-bottom">48</property>
-        <property name="margin-start">48</property>
-        <property name="margin-end">48</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">24</property>
-        <child>
-          <object class="GtkLabel">
-            <property name="xalign">0</property>
-            <property name="wrap">1</property>
-            <property name="max-width-chars">50</property>
-            <property name="label" translatable="yes">How much disk space this application is occupying with 
app data and caches.</property>
-          </object>
-        </child>
+      <object class="AdwPreferencesPage">
         <child>
-          <object class="GtkListBox" id="storage_list">
-            <property name="selection-mode">none</property>
-            <style>
-              <class name="boxed-list"/>
-            </style>
+          <object class="AdwPreferencesGroup">
+            <property name="description" translatable="yes">How much disk space this application is 
occupying with app data and caches.</property>
             <child>
               <object class="CcInfoRow" id="app">
                 <property name="title" translatable="yes">Application</property>
@@ -465,15 +442,16 @@
                 <property name="info">Unknown</property>
               </object>
             </child>
-            <style>
-              <class name="boxed-list"/>
-            </style>
           </object>
         </child>
         <child>
-          <object class="GtkButton" id="clear_cache_button">
-            <property name="label" translatable="yes">Clear Cache…</property>
-            <signal name="clicked" handler="clear_cache_cb" object="CcApplicationsPanel" swapped="yes"/>
+          <object class="AdwPreferencesGroup">
+            <child>
+              <object class="GtkButton" id="clear_cache_button">
+                <property name="label" translatable="yes">Clear Cache…</property>
+                <signal name="clicked" handler="clear_cache_cb" object="CcApplicationsPanel" swapped="yes"/>
+              </object>
+            </child>
           </object>
         </child>
       </object>


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