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}
This commit is contained in:
Christopher Davis 2022-01-22 12:22:36 -08:00 committed by Georges Basile Stavracas Neto
parent ea7012d9a9
commit 65b939ad38
2 changed files with 13 additions and 37 deletions

View file

@ -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);

View file

@ -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>
<object class="AdwPreferencesPage">
<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>
<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>