From 421cb87933825aa2ec623d167158b3089b7326cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 9 Feb 2024 04:30:13 -0800 Subject: [PATCH] UpdatesView: add OS updates (#224) * UpdatesView: add OS updates * rm unnecessary halign * Rework paid/unpaid apps copy * Fix screen reader --- data/Application.css | 12 +++++++ data/io.elementary.onboarding.gresource.xml | 1 + src/Views/HouseKeepingView.vala | 8 ++--- src/Views/UpdatesView.vala | 36 +++++++++++++++------ 4 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 data/Application.css diff --git a/data/Application.css b/data/Application.css new file mode 100644 index 00000000..d40df665 --- /dev/null +++ b/data/Application.css @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2024 elementary, Inc. (https://elementary.io) + */ + +checkbutton > box { + border-spacing: 0.5rem; +} + +checkbutton header { + margin-top: 0; +} diff --git a/data/io.elementary.onboarding.gresource.xml b/data/io.elementary.onboarding.gresource.xml index 524a8a40..49200bfa 100644 --- a/data/io.elementary.onboarding.gresource.xml +++ b/data/io.elementary.onboarding.gresource.xml @@ -1,6 +1,7 @@ + Application.css StyleView.css WelcomeView.css appearance-default.svg diff --git a/src/Views/HouseKeepingView.vala b/src/Views/HouseKeepingView.vala index d393db4d..f2f7486d 100644 --- a/src/Views/HouseKeepingView.vala +++ b/src/Views/HouseKeepingView.vala @@ -42,7 +42,7 @@ public class Onboarding.HouseKeepingView : AbstractOnboardingView { margin_start = 6 }; - var temp_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); + var temp_box = new Gtk.Box (HORIZONTAL, 0); temp_box.append (new Gtk.Image.from_icon_name ("folder") { pixel_size = 24 }); temp_box.append ( new Gtk.Label (_("Old temporary files")) { @@ -56,7 +56,7 @@ public class Onboarding.HouseKeepingView : AbstractOnboardingView { margin_start = 6 }; - var download_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); + var download_box = new Gtk.Box (HORIZONTAL, 0); download_box.append (new Gtk.Image.from_icon_name ("folder-download") { pixel_size = 24 }); download_box.append ( new Gtk.Label (_("Downloaded files")) { @@ -70,7 +70,7 @@ public class Onboarding.HouseKeepingView : AbstractOnboardingView { margin_start = 6 }; - var screenshots_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); + var screenshots_box = new Gtk.Box (HORIZONTAL, 0); screenshots_box.append (new Gtk.Image.from_icon_name ("folder-screenshots-icon") { pixel_size = 24 }); screenshots_box.append ( new Gtk.Label (_("Screenshot files")) { @@ -84,7 +84,7 @@ public class Onboarding.HouseKeepingView : AbstractOnboardingView { margin_start = 6 }; - var trash_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); + var trash_box = new Gtk.Box (HORIZONTAL, 0); trash_box.append (new Gtk.Image.from_icon_name ("user-trash-full") { pixel_size = 24 }); trash_box.append ( new Gtk.Label (_("Trashed files")) { diff --git a/src/Views/UpdatesView.vala b/src/Views/UpdatesView.vala index fdcfe49b..8e528078 100644 --- a/src/Views/UpdatesView.vala +++ b/src/Views/UpdatesView.vala @@ -14,21 +14,37 @@ public class Onboarding.UpdatesView : AbstractOnboardingView { } construct { - var switch_label = new Gtk.Label (_("Free & Paid Apps:")) { - halign = Gtk.Align.END + var appcenter_check = new Gtk.CheckButton (); + + var appcenter_label = new Granite.HeaderLabel (_("Free & Purchased Apps")) { + mnemonic_widget = appcenter_check, + secondary_text = _("Apps being tried for free will not update automatically") }; - var switch = new Gtk.Switch () { - halign = Gtk.Align.START + var appcenter_box = new Gtk.Box (HORIZONTAL, 0); + appcenter_box.append (new Gtk.Image.from_icon_name ("io.elementary.appcenter") { icon_size = LARGE }); + appcenter_box.append (appcenter_label); + appcenter_box.set_parent (appcenter_check); + + var system_check = new Gtk.CheckButton (); + + var system_label = new Granite.HeaderLabel (_("Operating System")) { + mnemonic_widget = system_check, + secondary_text = _("Will be installed when you choose to restart this device") }; - var settings = new GLib.Settings ("io.elementary.appcenter.settings"); - settings.bind ("automatic-updates", switch, "active", GLib.SettingsBindFlags.DEFAULT); + var system_box = new Gtk.Box (HORIZONTAL, 0); + system_box.append (new Gtk.Image.from_icon_name ("io.elementary.settings") { icon_size = LARGE }); + system_box.append (system_label); + system_box.set_parent (system_check); + + custom_bin.append (appcenter_check); + custom_bin.append (system_check); - var box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); - box.append (switch_label); - box.append (switch); + var appcenter_settings = new Settings ("io.elementary.appcenter.settings"); + appcenter_settings.bind ("automatic-updates", appcenter_check, "active", DEFAULT); - custom_bin.append (box); + var system_settings = new Settings ("io.elementary.settings-daemon.system-update"); + system_settings.bind ("automatic-updates", system_check, "active", DEFAULT); } }