[gnome-control-center/wip/kate/non-functional-arrows: 23/23] firmware-security: hide expander arrow when event description is unavailable




commit ac74cf695c2cba2fb741a353bdcac0b18c42bf64
Author: Kate Hsuan <hpa redhat com>
Date:   Fri Aug 26 13:24:00 2022 +0800

    firmware-security: hide expander arrow when event description is unavailable
    
    Showing an arrow for an empty expander row for the event confuses the user.
    The user may misunderstand there is the information behind the arrow and then
    the user will click it but will not get any response from the panel.
    Therefore, to prevent confusing the user, the expander will be hidden for a
    event with an empty description.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2031
    
    Signed-off-by: Kate Hsuan <hpa redhat com>

 panels/firmware-security/cc-firmware-security-dialog.c | 1 +
 panels/firmware-security/cc-firmware-security-panel.c  | 1 +
 panels/firmware-security/security-level.css            | 4 ++++
 3 files changed, 6 insertions(+)
---
diff --git a/panels/firmware-security/cc-firmware-security-dialog.c 
b/panels/firmware-security/cc-firmware-security-dialog.c
index ab58dcd59..e5113dbcd 100644
--- a/panels/firmware-security/cc-firmware-security-dialog.c
+++ b/panels/firmware-security/cc-firmware-security-dialog.c
@@ -278,6 +278,7 @@ hsi_create_pg_row (const gchar *icon_name,
   else
     {
       adw_expander_row_set_enable_expansion (ADW_EXPANDER_ROW (row), FALSE);
+      gtk_widget_add_css_class (row, "hide-arrow");
     }
 
   return row;
diff --git a/panels/firmware-security/cc-firmware-security-panel.c 
b/panels/firmware-security/cc-firmware-security-panel.c
index 8a5bb5e9a..bf0ba70bf 100644
--- a/panels/firmware-security/cc-firmware-security-panel.c
+++ b/panels/firmware-security/cc-firmware-security-panel.c
@@ -209,6 +209,7 @@ parse_event_variant_iter (CcfirmwareSecurityPanel *self,
   else
     {
       adw_expander_row_set_enable_expansion (ADW_EXPANDER_ROW (row), FALSE);
+      gtk_widget_add_css_class (row, "hide-arrow");
     }
 
   adw_preferences_row_set_title (ADW_PREFERENCES_ROW (row), attr->title);
diff --git a/panels/firmware-security/security-level.css b/panels/firmware-security/security-level.css
index 1535b4544..64d724f60 100644
--- a/panels/firmware-security/security-level.css
+++ b/panels/firmware-security/security-level.css
@@ -113,3 +113,7 @@ row.error-title label.hsi_label {
 row.security-description-row label.subtitle {
   padding: 12px 0;
 }
+
+row.hide-arrow image.expander-row-arrow {
+  opacity: 0;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]