applications: Group built-in row with storage

As per latest mockup
This commit is contained in:
Georges Basile Stavracas Neto 2022-01-20 13:27:08 -03:00
parent 9e38b89752
commit dc4d8e262f
2 changed files with 17 additions and 24 deletions

View file

@ -867,7 +867,7 @@ update_permission_section (CcApplicationsPanel *self,
{
g_autofree gchar *portal_app_id = get_portal_app_id (info);
gboolean disabled, allowed, set;
gboolean has_any = FALSE, has_builtin = FALSE;
gboolean has_any = FALSE;
if (portal_app_id == NULL)
{
@ -901,11 +901,6 @@ update_permission_section (CcApplicationsPanel *self,
has_any |= add_snap_permissions (self, info, portal_app_id);
#endif
remove_static_permissions (self);
has_builtin = add_static_permissions (self, info, portal_app_id);
gtk_widget_set_visible (GTK_WIDGET (self->builtin), has_builtin);
has_any |= has_builtin;
gtk_widget_set_visible (self->permission_section, has_any);
}
@ -1632,16 +1627,16 @@ update_usage_section (CcApplicationsPanel *self,
GAppInfo *info)
{
g_autofree gchar *portal_app_id = get_portal_app_id (info);
gboolean has_builtin = FALSE;
if (portal_app_id != NULL)
{
gtk_widget_show (self->usage_section);
update_app_sizes (self, portal_app_id);
}
else
{
gtk_widget_hide (self->usage_section);
}
update_app_sizes (self, portal_app_id);
remove_static_permissions (self);
has_builtin = add_static_permissions (self, info, portal_app_id);
gtk_widget_set_visible (GTK_WIDGET (self->builtin), has_builtin);
gtk_widget_set_visible (GTK_WIDGET (self->usage_section), portal_app_id || has_builtin);
}
/* --- panel setup --- */

View file

@ -98,14 +98,6 @@
<property name="info" translatable="yes">Disabled</property>
</object>
</child>
<child>
<object class="CcInfoRow" id="builtin">
<property name="title" translatable="yes">Built-in Permissions</property>
<property name="info" translatable="yes">Cannot be changed</property>
<property name="has-expander">True</property>
<property name="is-link">True</property>
</object>
</child>
<style>
<class name="boxed-list"/>
</style>
@ -249,8 +241,6 @@
<child>
<object class="AdwPreferencesGroup" id="usage_section">
<property name="title" translatable="yes">Usage</property>
<property name="description" translatable="yes">How much resources this application is using.</property>
<child>
<object class="GtkListBox" id="usage_list">
<property name="selection-mode">none</property>
@ -258,6 +248,14 @@
<style>
<class name="boxed-list"/>
</style>
<child>
<object class="CcInfoRow" id="builtin">
<property name="title" translatable="yes">Built-in Permissions</property>
<property name="info" translatable="yes">Cannot be changed</property>
<property name="has-expander">True</property>
<property name="is-link">True</property>
</object>
</child>
<child>
<object class="CcInfoRow" id="storage">
<property name="title" translatable="yes">Storage</property>