privacy: Make security dialogs consistent
Port them to AdwWindow and AdwToolbarView, simplify the widgetry and use a consistent styling and window size.
This commit is contained in:
parent
005a1d49dd
commit
cdea4b4503
7 changed files with 116 additions and 199 deletions
|
@ -28,14 +28,14 @@
|
|||
|
||||
struct _CcFirmwareSecurityBootDialog
|
||||
{
|
||||
GtkDialog parent;
|
||||
AdwWindow parent;
|
||||
|
||||
GtkWidget *secure_boot_icon;
|
||||
GtkWidget *secure_boot_title;
|
||||
GtkWidget *secure_boot_description;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CcFirmwareSecurityBootDialog, cc_firmware_security_boot_dialog, GTK_TYPE_DIALOG)
|
||||
G_DEFINE_TYPE (CcFirmwareSecurityBootDialog, cc_firmware_security_boot_dialog, ADW_TYPE_WINDOW)
|
||||
|
||||
static void
|
||||
cc_firmware_security_boot_dialog_class_init (CcFirmwareSecurityBootDialogClass *klass)
|
||||
|
@ -63,9 +63,7 @@ cc_firmware_security_boot_dialog_new (SecureBootState secure_boot_state)
|
|||
CcFirmwareSecurityBootDialog *dialog;
|
||||
g_autofree gchar *status_description = NULL;
|
||||
|
||||
dialog = g_object_new (CC_TYPE_FIRMWARE_SECURITY_BOOT_DIALOG,
|
||||
"use-header-bar", TRUE,
|
||||
NULL);
|
||||
dialog = g_object_new (CC_TYPE_FIRMWARE_SECURITY_BOOT_DIALOG, NULL);
|
||||
|
||||
switch (secure_boot_state)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <adwaita.h>
|
||||
|
||||
#include "cc-firmware-security-utils.h"
|
||||
|
||||
|
@ -30,7 +30,7 @@ G_BEGIN_DECLS
|
|||
|
||||
#define CC_TYPE_FIRMWARE_SECURITY_BOOT_DIALOG (cc_firmware_security_boot_dialog_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (CcFirmwareSecurityBootDialog, cc_firmware_security_boot_dialog,
|
||||
CC, FIRMWARE_SECURITY_BOOT_DIALOG, GtkDialog)
|
||||
CC, FIRMWARE_SECURITY_BOOT_DIALOG, AdwWindow)
|
||||
|
||||
GtkWidget *cc_firmware_security_boot_dialog_new (SecureBootState secure_boot_state);
|
||||
|
||||
|
|
|
@ -1,63 +1,67 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="CcFirmwareSecurityBootDialog" parent="GtkDialog">
|
||||
<property name="use-header-bar">True</property>
|
||||
<property name="default-width">400</property>
|
||||
<template class="CcFirmwareSecurityBootDialog" parent="AdwWindow">
|
||||
<property name="modal">True</property>
|
||||
<child internal-child="headerbar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="show_title_buttons">True</property>
|
||||
<child type="title">
|
||||
<object class="AdwBin" />
|
||||
</child>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">32</property>
|
||||
<property name="margin-end">32</property>
|
||||
<property name="margin-bottom">32</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">16</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="secure_boot_icon">
|
||||
<property name="pixel-size">32</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="icon-name">channel-insecure</property>
|
||||
<style>
|
||||
<class name="security-level-icon"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="secure_boot_title">
|
||||
<property name="wrap">True</property>
|
||||
<style>
|
||||
<class name="title-2" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="secure_boot_description">
|
||||
<property name="wrap">True</property>
|
||||
<property name="width-chars">40</property>
|
||||
<property name="max-width-chars">40</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="label" translatable="yes">Secure boot prevents malicious software from being loaded when the device starts.
|
||||
<property name="width-request">360</property>
|
||||
<property name="height-request">200</property>
|
||||
<property name="default-width">420</property>
|
||||
|
||||
For more information, contact the hardware manufacturer or IT support.</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="content">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="show-title">False</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<property name="content">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">24</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-start">24</property>
|
||||
<property name="margin-end">24</property>
|
||||
<property name="margin-bottom">24</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkImage" id="secure_boot_icon">
|
||||
<property name="icon-size">large</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="icon-name">channel-insecure</property>
|
||||
<style>
|
||||
<class name="security-level-icon"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="secure_boot_title">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">center</property>
|
||||
<style>
|
||||
<class name="title-2" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="secure_boot_description">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="label" translatable="yes">Secure boot prevents malicious software from being loaded when the device starts.
|
||||
|
||||
For more information, contact the hardware manufacturer or IT support.</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
|
|
|
@ -1,34 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="CcFirmwareSecurityDialog" parent="AdwWindow">
|
||||
<property name="title" translatable="yes">Device Security Status</property>
|
||||
<property name="default-width">500</property>
|
||||
<property name="default-height">500</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="width-request">360</property>
|
||||
<property name="height-request">200</property>
|
||||
<property name="default-width">420</property>
|
||||
|
||||
<property name="content">
|
||||
<object class="AdwToastOverlay" id="toast_overlay">
|
||||
<property name="child">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar"/>
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="show-title">False</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<property name="content">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">24</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-start">24</property>
|
||||
<property name="margin-end">24</property>
|
||||
<property name="margin-bottom">24</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkImage" id="firmware_security_dialog_icon">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="icon-size">large</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="icon-name">dialog-question-symbolic</property>
|
||||
<style>
|
||||
<class name="security-level-icon"/>
|
||||
|
@ -38,6 +42,8 @@
|
|||
|
||||
<child>
|
||||
<object class="GtkLabel" id="firmware_security_dialog_title_label">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">center</property>
|
||||
<style>
|
||||
<class name="title-2" />
|
||||
</style>
|
||||
|
@ -63,7 +69,6 @@
|
|||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
|
||||
struct _CcFirmwareSecurityHelpDialog
|
||||
{
|
||||
GtkWindow parent;
|
||||
AdwWindow parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CcFirmwareSecurityHelpDialog, cc_firmware_security_help_dialog, GTK_TYPE_WINDOW)
|
||||
G_DEFINE_TYPE (CcFirmwareSecurityHelpDialog, cc_firmware_security_help_dialog, ADW_TYPE_WINDOW)
|
||||
|
||||
|
||||
static void
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <adwaita.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CC_TYPE_FIRMWARE_SECURITY_HELP_DIALOG (cc_firmware_security_help_dialog_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (CcFirmwareSecurityHelpDialog, cc_firmware_security_help_dialog,
|
||||
CC, FIRMWARE_SECURITY_HELP_DIALOG, GtkWindow)
|
||||
CC, FIRMWARE_SECURITY_HELP_DIALOG, AdwWindow)
|
||||
|
||||
GtkWidget * cc_firmware_security_help_dialog_new (void);
|
||||
|
||||
|
|
|
@ -1,135 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="CcFirmwareSecurityHelpDialog" parent="GtkWindow">
|
||||
<property name="default-width">500</property>
|
||||
<property name="modal">True</property>
|
||||
<template class="CcFirmwareSecurityHelpDialog" parent="AdwWindow">
|
||||
<property name="title" translatable="yes">About Device Security</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="width-request">360</property>
|
||||
<property name="height-request">200</property>
|
||||
<property name="default-width">420</property>
|
||||
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="show-title-buttons">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-top">32</property>
|
||||
<property name="margin-start">32</property>
|
||||
<property name="margin-end">32</property>
|
||||
<property name="margin-bottom">32</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="help_description_section1">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label" translatable="yes">Device security provides information about how protected your device is against security issues which target the hardware itself.</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label"> </property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="help_description_section2">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label" translatable="yes">Aspects of hardware that affect security include:</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="help_description_section3">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label" translatable="yes">• security features that are built into a hardware itself;</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="help_description_section4">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label" translatable="yes">• how the hardware is configured to protect against security issues;</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="help_description_section5">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label" translatable="yes">• the security of the software runs directly on the hardware.</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="help_description_section6">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label" translatable="yes">Security threats which affect hardware include malware and viruses that target the software that runs directly on the hardware. It also includes physical tampering, such as physical connection to the hardware to read data and implant malware.</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="help_description_section7">
|
||||
<property name="wrap">True</property>
|
||||
<property name="justify">left</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label" translatable="yes">Device security is just one aspect of security, and does not reflect the overall security status of the system and applications.</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
<property name="content">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<property name="content">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-start">24</property>
|
||||
<property name="margin-end">24</property>
|
||||
<property name="margin-bottom">24</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="label" translatable="yes">Device security provides information about how protected your device is against security issues which target the hardware itself.
|
||||
|
||||
Aspects of hardware that affect security include:
|
||||
|
||||
• security features that are built into a hardware itself;
|
||||
• how the hardware is configured to protect against security issues;
|
||||
• the security of the software runs directly on the hardware.
|
||||
|
||||
Security threats which affect hardware include malware and viruses that target the software that runs directly on the hardware. It also includes physical tampering, such as physical connection to the hardware to read data and implant malware.
|
||||
|
||||
Device security is just one aspect of security, and does not reflect the overall security status of the system and applications.</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
|
|
Loading…
Add table
Reference in a new issue