[gnome-control-center/gbsneto/applications-panel-cleanups: 7/19] applications: Group built-in row with storage
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/applications-panel-cleanups: 7/19] applications: Group built-in row with storage
- Date: Thu, 20 Jan 2022 20:23:42 +0000 (UTC)
commit 578ccc73a6adf5017180965ff907298d23063535
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jan 20 13:27:08 2022 -0300
applications: Group built-in row with storage
As per latest mockup
panels/applications/cc-applications-panel.c | 23 +++++++++--------------
panels/applications/cc-applications-panel.ui | 16 ++++++++--------
2 files changed, 17 insertions(+), 22 deletions(-)
---
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 021192478..567186e61 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -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 --- */
diff --git a/panels/applications/cc-applications-panel.ui b/panels/applications/cc-applications-panel.ui
index 35b845600..74a22095c 100644
--- a/panels/applications/cc-applications-panel.ui
+++ b/panels/applications/cc-applications-panel.ui
@@ -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>
@@ -258,6 +250,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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]