From 2094d7bb739825c05cf8008d934d87c773a99858 Mon Sep 17 00:00:00 2001 From: Automeris naranja Date: Thu, 15 Feb 2024 05:32:22 -0300 Subject: [PATCH] apps: Fix inconsistent "Storage" row subtitle Unlike other rows from the app page, the "Storage" row subtitle states a value instead of showing the row description. Also, the description ends with a period, which isn't necessary acc. to HIG. Show the disk space as a secondary label, so the "Storage" row can have a consistent subtitle like other rows. Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2777 --- panels/applications/cc-applications-panel.c | 11 +++++------ panels/applications/cc-applications-panel.ui | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c index cc7c43d39..81fee75dc 100644 --- a/panels/applications/cc-applications-panel.c +++ b/panels/applications/cc-applications-panel.c @@ -32,6 +32,7 @@ #include "cc-applications-panel.h" #include "cc-applications-row.h" #include "cc-info-row.h" +#include "cc-list-row.h" #include "cc-default-apps-page.h" #include "cc-removable-media-settings.h" #include "cc-applications-resources.h" @@ -134,7 +135,7 @@ struct _CcApplicationsPanel GList *link_handler_rows; GtkWidget *usage_section; - CcInfoRow *storage; + CcListRow *storage; GtkWindow *storage_dialog; CcInfoRow *app; CcInfoRow *data; @@ -1250,16 +1251,13 @@ static void update_total_size (CcApplicationsPanel *self) { g_autofree gchar *formatted_size = NULL; - g_autofree gchar *subtitle = NULL; guint64 total; total = self->app_size + self->data_size + self->cache_size; formatted_size = g_format_size (total); g_object_set (self->total, "info", formatted_size, NULL); - /* Translators: '%s' is the formatted size, e.g. "26.2 MB" */ - subtitle = g_strdup_printf (_("%s of disk space used"), formatted_size); - g_object_set (self->storage, "subtitle", subtitle, NULL); + cc_list_row_set_secondary_label (self->storage, formatted_size); } static void @@ -1864,7 +1862,8 @@ cc_applications_panel_init (CcApplicationsPanel *self) g_resources_register (cc_applications_get_resource ()); - g_type_ensure(CC_TYPE_INFO_ROW); + g_type_ensure (CC_TYPE_INFO_ROW); + g_type_ensure (CC_TYPE_LIST_ROW); gtk_widget_init_template (GTK_WIDGET (self)); diff --git a/panels/applications/cc-applications-panel.ui b/panels/applications/cc-applications-panel.ui index 0f5a8b193..4b0da44dd 100644 --- a/panels/applications/cc-applications-panel.ui +++ b/panels/applications/cc-applications-panel.ui @@ -378,10 +378,10 @@ - + S_torage - 1 - 1 + Disk space being used + True