Skip to content

Commit

Permalink
UpdatesView: add OS updates (#224)
Browse files Browse the repository at this point in the history
* UpdatesView: add OS updates

* rm unnecessary halign

* Rework paid/unpaid apps copy

* Fix screen reader
  • Loading branch information
danirabbit authored Feb 9, 2024
1 parent 8e06c64 commit 421cb87
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 14 deletions.
12 changes: 12 additions & 0 deletions data/Application.css
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions data/io.elementary.onboarding.gresource.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/io/elementary/onboarding">
<file compressed="true">Application.css</file>
<file compressed="true">StyleView.css</file>
<file compressed="true">WelcomeView.css</file>
<file compressed="true" preprocess="xml-stripblanks">appearance-default.svg</file>
Expand Down
8 changes: 4 additions & 4 deletions src/Views/HouseKeepingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand All @@ -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")) {
Expand All @@ -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")) {
Expand All @@ -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")) {
Expand Down
36 changes: 26 additions & 10 deletions src/Views/UpdatesView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 421cb87

Please sign in to comment.