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




commit be4a6135b5ec3633421c2fa9a9786477fd96023a
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 | 3 ++-
 panels/firmware-security/cc-firmware-security-panel.c  | 1 +
 panels/firmware-security/security-level.css            | 4 ++++
 3 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/panels/firmware-security/cc-firmware-security-dialog.c 
b/panels/firmware-security/cc-firmware-security-dialog.c
index 737bf7731..a5676a6a1 100644
--- a/panels/firmware-security/cc-firmware-security-dialog.c
+++ b/panels/firmware-security/cc-firmware-security-dialog.c
@@ -227,7 +227,7 @@ hsi_create_pg_row (const gchar *icon_name,
   GtkWidget *row;
   GtkWidget *status_icon;
   GtkWidget *status_label;
-  GtkWidget *actions_parent;
+  GtkWidget *actions_parent = NULL;
   const gchar *result_str = NULL;
 
   row = adw_expander_row_new ();
@@ -265,6 +265,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 28e7912d0..e730ee4e3 100644
--- a/panels/firmware-security/cc-firmware-security-panel.c
+++ b/panels/firmware-security/cc-firmware-security-panel.c
@@ -201,6 +201,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]