diff options
author | Sayan Bhattacharjee <bsayan8086@gmail.com> | 2023-03-14 22:22:23 +0530 |
---|---|---|
committer | Felipe Borges <felipeborges@gnome.org> | 2023-04-11 11:20:28 +0000 |
commit | 0524a6eee6e30fa9a32b299549a5faf7dd3888cc (patch) | |
tree | e31cfdaef8f07573a282514839ef028a12853b72 | |
parent | 980829a168a3ae4f06695a6fa86a000ea405f16e (diff) | |
download | gnome-control-center-0524a6eee6e30fa9a32b299549a5faf7dd3888cc.tar.gz |
info-overview: Show each GPU in it's own line
When having multiple GPUs, each GPUs are now seperated by a newline
instead of the previously used seperator: " / ".
This particular fix works ONLY for systems that use switcheroo-control.
Also, this commit allows the 'secondary_label' of 'CcListRow' to have
'lines' set to '4' and 'wrap' to 'True', along with 'hexpand'
and 'halign' set to 'True' to accommodate long strings on all labels
which previously suffered from a issue of getting truncated if
the strings are too long.
Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2125
-rw-r--r-- | panels/common/cc-list-row.ui | 4 | ||||
-rw-r--r-- | panels/info-overview/cc-info-overview-panel.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/panels/common/cc-list-row.ui b/panels/common/cc-list-row.ui index f668a10e0..7dfb6e449 100644 --- a/panels/common/cc-list-row.ui +++ b/panels/common/cc-list-row.ui @@ -7,7 +7,11 @@ <child type="suffix"> <object class="GtkLabel" id="secondary_label"> <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="halign">end</property> <property name="ellipsize">end</property> + <property name="wrap">True</property> + <property name="lines">4</property> <property name="selectable" bind-source="CcListRow" bind-property="activatable" bind-flags="sync-create|invert-boolean" /> <style> <class name="dim-label"/> diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c index 609042bb2..703edea0e 100644 --- a/panels/info-overview/cc-info-overview-panel.c +++ b/panels/info-overview/cc-info-overview-panel.c @@ -265,7 +265,10 @@ get_renderer_from_switcheroo (void) { GpuData *data = l->data; if (renderers_string->len > 0) - g_string_append (renderers_string, " / "); + { + /* Show each GPU in its own line */ + g_string_append_c (renderers_string, '\n'); + } g_string_append (renderers_string, data->name); } g_slist_free_full (renderers, (GDestroyNotify) gpu_data_free); |