[gnome-control-center/wip/new-design: 2/7] second




commit 0bc0800c90bc6a100f0f79a0c415aea6129c02e0
Author: Kate Hsuan <hpa redhat com>
Date:   Thu Jul 28 11:13:36 2022 +0800

    second

 .../cc-firmware-security-boot-dialog.ui            |   2 +-
 .../cc-firmware-security-dialog.c                  |  43 +++---
 .../cc-firmware-security-dialog.ui                 | 163 ++++++++++++++++++++-
 .../firmware-security/cc-firmware-security-panel.c |   2 +-
 .../cc-firmware-security-panel.ui                  |   6 +-
 panels/firmware-security/security-level.css        |  28 +++-
 6 files changed, 206 insertions(+), 38 deletions(-)
---
diff --git a/panels/firmware-security/cc-firmware-security-boot-dialog.ui 
b/panels/firmware-security/cc-firmware-security-boot-dialog.ui
index 1e46ccf28..8b8957e73 100644
--- a/panels/firmware-security/cc-firmware-security-boot-dialog.ui
+++ b/panels/firmware-security/cc-firmware-security-boot-dialog.ui
@@ -30,7 +30,7 @@
                 <property name="pixel-size">32</property>
                 <property name="halign">center</property>
                 <property name="valign">center</property>
-                <property name="icon-name">system-reboot-symbolic</property>
+                <property name="icon-name">channel-insecure</property>
                 <style>
                   <class name="security-level-icon"/>
                 </style>
diff --git a/panels/firmware-security/cc-firmware-security-dialog.c 
b/panels/firmware-security/cc-firmware-security-dialog.c
index 57d143adf..0ca209b3d 100644
--- a/panels/firmware-security/cc-firmware-security-dialog.c
+++ b/panels/firmware-security/cc-firmware-security-dialog.c
@@ -78,7 +78,7 @@ set_dialog_item_layer1 (CcFirmwareSecurityDialog *self,
 static void
 update_dialog (CcFirmwareSecurityDialog *self)
 {
-  adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row), 
"dialog-error-symbolic");
+ /* adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row), 
"dialog-error-symbolic");
   adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_basic_row), 
"dialog-error-symbolic");
   adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_extend_row), 
"dialog-error-symbolic");
 
@@ -88,62 +88,67 @@ update_dialog (CcFirmwareSecurityDialog *self)
     gtk_widget_add_css_class (self->firmware_security_dialog_basic_row, "gray-icon");
   if (self->hsi_number < 3)
     gtk_widget_add_css_class (self->firmware_security_dialog_extend_row, "gray-icon");
-
+*/
+self->hsi_number = 3;
   switch (self->hsi_number)
     {
     case 0:
       set_dialog_item_layer1 (self,
                               "dialog-warning-symbolic",
                               "error",
-                              _("No Protection"),
+                              _("Security Level 0"),
                               _("This device has no protection against hardware security issues. This could "
                                 "be because of a hardware or firmware configuration issue. It is "
                                 "recommended to contact your IT support provider."));
       break;
 
     case 1:
-      adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row),
-                                    "emblem-default-symbolic");
-      gtk_widget_add_css_class (self->firmware_security_dialog_min_row, "success-icon");
+     /* adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row),
+                                    "emblem-default-symbolic");*/
+     // gtk_widget_add_css_class (self->firmware_security_dialog_min_row, "success-icon");
       set_dialog_item_layer1 (self,
                               "security-low-symbolic",
                               "neutral",
-                              _("Minimal Protection"),
+                              _("Security Level 1"),
                               _("This device has minimal protection against hardware security issues. This "
                                 "is the lowest device security level and only provides protection against "
                                 "simple security threats."));
       break;
 
     case 2:
-      adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row),
+     /* adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row),
                                     "emblem-default-symbolic");
       adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_basic_row),
                                     "emblem-default-symbolic");
-      gtk_widget_add_css_class (self->firmware_security_dialog_min_row, "success-icon");
-      gtk_widget_add_css_class (self->firmware_security_dialog_basic_row, "success-icon");
+                                    */
+      //gtk_widget_add_css_class (self->firmware_security_dialog_min_row, "success-icon");
+      //gtk_widget_add_css_class (self->firmware_security_dialog_basic_row, "success-icon");
       set_dialog_item_layer1 (self,
                               "security-medium-symbolic",
                               "warning",
-                              _("Basic Protection"),
+                              _("Security Level 2"),
                               _("This device has basic protection against hardware security issues. This "
                                 "provides protection against some common security threats."));
       break;
 
     case 3:
     case 4:
-      adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row),
+     /* adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_min_row),
                                     "emblem-default-symbolic");
       adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_basic_row),
                                     "emblem-default-symbolic");
       adw_action_row_set_icon_name (ADW_ACTION_ROW (self->firmware_security_dialog_extend_row),
                                     "emblem-default-symbolic");
-      gtk_widget_add_css_class (self->firmware_security_dialog_min_row, "success-icon");
-      gtk_widget_add_css_class (self->firmware_security_dialog_basic_row, "success-icon");
-      gtk_widget_add_css_class (self->firmware_security_dialog_extend_row, "success-icon");
+*/
+     // gtk_widget_add_css_class (self->firmware_security_dialog_min_row, "success-icon");
+      gtk_widget_add_css_class (self->firmware_security_dialog_basic_row, "error-hsi-icon");
+      gtk_widget_add_css_class (self->firmware_security_dialog_basic_row, "error-title");
+      gtk_widget_add_css_class (self->firmware_security_dialog_extend_row, "success-hsi-icon");
+      gtk_widget_add_css_class (self->firmware_security_dialog_extend_row, "success-title");
       set_dialog_item_layer1 (self,
                               "security-high-symbolic",
                               "good",
-                              _("Extended Protection"),
+                              _("Security Level 3"),
                               _("This device has extended protection against hardware security issues. This "
                                 "is the highest device security level and provides protection against "
                                 "advanced security threats."));
@@ -297,17 +302,17 @@ on_hsi_clicked_cb (GtkWidget                *widget,
 
   if (widget == self->firmware_security_dialog_min_row)
     {
-      adw_window_title_set_title (self->second_page_title, _("Minimal Security Protections"));
+      adw_window_title_set_title (self->second_page_title, _("Security Level 1"));
       gtk_widget_set_visible (self->firmware_security_dialog_hsi1_pg, TRUE);
     }
   else if (widget == self->firmware_security_dialog_basic_row)
     {
-      adw_window_title_set_title (self->second_page_title, _("Basic Security Protections"));
+      adw_window_title_set_title (self->second_page_title, _("Security Level 2"));
       gtk_widget_set_visible (self->firmware_security_dialog_hsi2_pg, TRUE);
     }
   else if (widget == self->firmware_security_dialog_extend_row)
     {
-      adw_window_title_set_title (self->second_page_title, _("Extended Security Protections"));
+      adw_window_title_set_title (self->second_page_title, _("Security Level 3"));
       gtk_widget_set_visible (self->firmware_security_dialog_hsi3_pg, TRUE);
     }
 }
diff --git a/panels/firmware-security/cc-firmware-security-dialog.ui 
b/panels/firmware-security/cc-firmware-security-dialog.ui
index edf3317fb..08f496c8b 100644
--- a/panels/firmware-security/cc-firmware-security-dialog.ui
+++ b/panels/firmware-security/cc-firmware-security-dialog.ui
@@ -45,9 +45,59 @@
                             </style>
                           </object>
                         </child>
+
+
+                      <child>
+                        <object class="GtkBox">
+                        <property name="orientation">vertical</property>
+                        <property name="halign">center</property>
+                        <property name="valign">center</property>
+
+
+
+                         <child>
+                          <object class="GtkLabel" >
+                            <property name="halign">center</property>
+                            <property name="valign">center</property>
+                        <property name="vexpand">True</property>
+                            <property name="justify">center</property>
+
+                            <property name="label">9</property>
+                            
+                            <style>
+                               <class name="hsi-level-font"/>
+                               <class name="hsi1"/>
+                            </style>
+                          </object>
+                        </child>
+                       
+                             <style>
+                               <class name="hsi-level-box"/>
+                               <class name="level1"/>
+                            </style>
+
+                        </object>
+                        </child>
+
+
+
+
+
+
+
                       </object>
                     </child>
 
+
+
+
+
+
+
+
+
+
+
                     <child>
                       <object class="AdwPreferencesGroup">
                         <child>
@@ -77,9 +127,37 @@
                           <object class="AdwActionRow" id="firmware_security_dialog_min_row">
                             <property name="use-underline">True</property>
                             <property name="activatable">True</property>
-                            <property name="title" translatable="yes">Minimal Protection</property>
-                            <property name="icon-name">emblem-default-symbolic</property>
+                            <property name="title" translatable="yes">Level 1</property>
                             <signal name="activated" handler="on_hsi_clicked_cb" swapped="no" />
+
+
+                           <child>
+                              <object class="GtkImage" id="hsi1_icon">
+                                <property name="icon-name">process-stop</property>
+                              <style>
+                               <class name="hsi_icon"/>
+                              </style>
+                              </object>
+                            </child>
+
+                         <child>
+                          <object class="GtkLabel" id="hsi1_title">
+                            <property name="halign">start</property>
+                            <property name="valign">center</property>
+                             <property name="vexpand">True</property>
+                            <property name="justify">left</property>
+
+                            <property name="label">Failed</property>
+                            <style>
+                               <class name="hsi_label"/>
+                            </style>
+                          </object>
+                        </child>
+
+
+
+
+
                             <child>
                               <object class="GtkImage">
                                 <property name="icon-name">go-next-symbolic</property>
@@ -91,9 +169,40 @@
                           <object class="AdwActionRow" id="firmware_security_dialog_basic_row">
                             <property name="use-underline">True</property>
                             <property name="activatable">True</property>
-                            <property name="title" translatable="yes">Basic Protection</property>
-                            <property name="icon-name">emblem-default-symbolic</property>
+                            <property name="title" translatable="yes">Level 2</property>
                             <signal name="activated" handler="on_hsi_clicked_cb" swapped="no" />
+
+
+
+                           <child>
+                              <object class="GtkImage" id="hsi2_icon">
+                                <property name="icon-name">process-stop</property>
+                              <style>
+                               <class name="hsi_icon"/>
+                              </style>
+                              </object>
+                            </child>
+
+                         <child>
+                          <object class="GtkLabel" id="hsi2_title">
+                            <property name="halign">start</property>
+                            <property name="valign">center</property>
+                             <property name="vexpand">True</property>
+                            <property name="justify">left</property>
+
+                            <property name="label">Failed</property>
+                            <style>
+                               <class name="hsi_label"/>
+                            </style>
+                          </object>
+                        </child>
+
+
+
+
+
+
+
                             <child>
                               <object class="GtkImage">
                                 <property name="icon-name">go-next-symbolic</property>
@@ -105,9 +214,51 @@
                           <object class="AdwActionRow" id="firmware_security_dialog_extend_row">
                             <property name="use-underline">True</property>
                             <property name="activatable">True</property>
-                            <property name="title" translatable="yes">Extended Protection</property>
-                            <property name="icon-name">emblem-default-symbolic</property>
+                            <property name="title" translatable="yes">Level 3</property>
                             <signal name="activated" handler="on_hsi_clicked_cb" swapped="no" />
+                            
+
+
+
+                           <child>
+                              <object class="GtkImage" id="hsi3_icon">
+                                <property name="icon-name">emblem-ok</property>
+                              <style>
+                               <class name="hsi_icon"/>
+                              </style>
+                              </object>
+                            </child>
+
+                         <child>
+                          <object class="GtkLabel" id="hsi3_title">
+                            <property name="halign">start</property>
+                            <property name="valign">center</property>
+                             <property name="vexpand">True</property>
+                            <property name="justify">left</property>
+
+                            <property name="label">Passed</property>
+                            <style>
+                               <class name="hsi_label"/>
+                            </style>
+                          </object>
+                        </child>
+                       
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
                             <child>
                               <object class="GtkImage">
                                 <property name="icon-name">go-next-symbolic</property>
diff --git a/panels/firmware-security/cc-firmware-security-panel.c 
b/panels/firmware-security/cc-firmware-security-panel.c
index ce30ad40e..c9843bc8a 100644
--- a/panels/firmware-security/cc-firmware-security-panel.c
+++ b/panels/firmware-security/cc-firmware-security-panel.c
@@ -443,7 +443,7 @@ set_hsi_button_view (CcfirmwareSecurityPanel *self)
         set_hsi_button_view_contain (self, "dialog-warning-symbolic",
                                      "error",
                                      /* TRANSLATORS: in reference to firmware protection: 0/4 stars */
-                                     _("No Protection"),
+                                     _("Security "),
                                      _("Highly exposed to security threats."));
         break;
       case 1:
diff --git a/panels/firmware-security/cc-firmware-security-panel.ui 
b/panels/firmware-security/cc-firmware-security-panel.ui
index 259c2d6a8..106d7965c 100644
--- a/panels/firmware-security/cc-firmware-security-panel.ui
+++ b/panels/firmware-security/cc-firmware-security-panel.ui
@@ -51,14 +51,12 @@
 
 
                          <child>
-                          <object class="GtkLabel" >
+                          <object class="GtkLabel" id="hsi_botton_number">
                             <property name="halign">center</property>
                             <property name="valign">center</property>
                         <property name="vexpand">True</property>
                             <property name="justify">center</property>
-
-                            <property name="label">1</property>
-                            <property name="margin-bottom">6</property>
+                            <property name="label">9</property>
                             <style>
                                <class name="hsi-level-font"/>
                                <class name="hsi1"/>
diff --git a/panels/firmware-security/security-level.css b/panels/firmware-security/security-level.css
index 861bf8337..df5fd7373 100644
--- a/panels/firmware-security/security-level.css
+++ b/panels/firmware-security/security-level.css
@@ -10,16 +10,14 @@
 }
 
 .hsi-level-font {
-  font-size: 32px;
-  font-weight: bold;
+  font-size: 27px;
+  font-weight: 800;
 }
 
 .hsi-level-font.hsi1 {
   color: @success_color;
 }
 
-
-
 .security-level-icon {
   border-radius: 9999px;
   min-width: 64px;
@@ -54,18 +52,34 @@
   color: @light_4f;
 }
 
-row.success-icon image {
+row.success-icon image.icon {
   color: @success_color;
 }
 
-row.warning-icon image {
+row.warning-icon image.icon {
   color: @warning_color;
 }
 
-row.error-icon image {
+row.error-icon image.icon {
   color: @error_color;
 }
 
 row.gray-icon image {
   color: @light_4;
 }
+
+row.success-hsi-icon image.hsi_icon {
+  color: @success_color;
+}
+
+row.error-hsi-icon image.hsi_icon {
+  color: @error_color;
+}
+
+row.success-title label.hsi_label {
+  color: @success_color;
+}
+
+row.error-title label.hsi_label {
+  color: @error_color;
+}
\ No newline at end of file


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