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
This commit is contained in:
parent
542cd4e0a6
commit
2094d7bb73
2 changed files with 8 additions and 9 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include "cc-applications-panel.h"
|
#include "cc-applications-panel.h"
|
||||||
#include "cc-applications-row.h"
|
#include "cc-applications-row.h"
|
||||||
#include "cc-info-row.h"
|
#include "cc-info-row.h"
|
||||||
|
#include "cc-list-row.h"
|
||||||
#include "cc-default-apps-page.h"
|
#include "cc-default-apps-page.h"
|
||||||
#include "cc-removable-media-settings.h"
|
#include "cc-removable-media-settings.h"
|
||||||
#include "cc-applications-resources.h"
|
#include "cc-applications-resources.h"
|
||||||
|
@ -134,7 +135,7 @@ struct _CcApplicationsPanel
|
||||||
GList *link_handler_rows;
|
GList *link_handler_rows;
|
||||||
|
|
||||||
GtkWidget *usage_section;
|
GtkWidget *usage_section;
|
||||||
CcInfoRow *storage;
|
CcListRow *storage;
|
||||||
GtkWindow *storage_dialog;
|
GtkWindow *storage_dialog;
|
||||||
CcInfoRow *app;
|
CcInfoRow *app;
|
||||||
CcInfoRow *data;
|
CcInfoRow *data;
|
||||||
|
@ -1250,16 +1251,13 @@ static void
|
||||||
update_total_size (CcApplicationsPanel *self)
|
update_total_size (CcApplicationsPanel *self)
|
||||||
{
|
{
|
||||||
g_autofree gchar *formatted_size = NULL;
|
g_autofree gchar *formatted_size = NULL;
|
||||||
g_autofree gchar *subtitle = NULL;
|
|
||||||
guint64 total;
|
guint64 total;
|
||||||
|
|
||||||
total = self->app_size + self->data_size + self->cache_size;
|
total = self->app_size + self->data_size + self->cache_size;
|
||||||
formatted_size = g_format_size (total);
|
formatted_size = g_format_size (total);
|
||||||
g_object_set (self->total, "info", formatted_size, NULL);
|
g_object_set (self->total, "info", formatted_size, NULL);
|
||||||
|
|
||||||
/* Translators: '%s' is the formatted size, e.g. "26.2 MB" */
|
cc_list_row_set_secondary_label (self->storage, formatted_size);
|
||||||
subtitle = g_strdup_printf (_("%s of disk space used"), formatted_size);
|
|
||||||
g_object_set (self->storage, "subtitle", subtitle, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1864,7 +1862,8 @@ cc_applications_panel_init (CcApplicationsPanel *self)
|
||||||
|
|
||||||
g_resources_register (cc_applications_get_resource ());
|
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));
|
gtk_widget_init_template (GTK_WIDGET (self));
|
||||||
|
|
||||||
|
|
|
@ -378,10 +378,10 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="CcInfoRow" id="storage">
|
<object class="CcListRow" id="storage">
|
||||||
<property name="title" translatable="yes">S_torage</property>
|
<property name="title" translatable="yes">S_torage</property>
|
||||||
<property name="has-expander">1</property>
|
<property name="subtitle" translatable="yes">Disk space being used</property>
|
||||||
<property name="is-link">1</property>
|
<property name="show-arrow">True</property>
|
||||||
<signal name="activated" handler="on_storage_row_activated_cb" object="CcApplicationsPanel" swapped="yes" />
|
<signal name="activated" handler="on_storage_row_activated_cb" object="CcApplicationsPanel" swapped="yes" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
Loading…
Add table
Reference in a new issue