From 6875bf4b5e8c617d39b419127cc86e3377816684 Mon Sep 17 00:00:00 2001 From: lenemter Date: Tue, 28 Oct 2025 19:55:29 +0300 Subject: [PATCH] Use new CssClass constants from new Granite --- daemon/DistinstBackend.vala | 2 ++ src/Views/AbstractInstallerView.vala | 2 +- src/Views/CheckView.vala | 4 +--- src/Views/DiskView.vala | 2 +- src/Views/DriversView.vala | 2 +- src/Views/EncryptView.vala | 8 ++++---- src/Views/ErrorView.vala | 2 +- src/Views/KeyboardLayoutView.vala | 2 +- src/Views/LanguageView.vala | 2 +- src/Views/PartitioningView.vala | 4 +++- src/Views/ProgressView.vala | 7 ++++--- src/Views/SuccessView.vala | 2 +- src/Views/TryInstallView.vala | 2 +- src/Widgets/DecryptMenu.vala | 2 +- src/Widgets/DescriptionRow.vala | 2 +- src/Widgets/DiskBar.vala | 4 ++-- 16 files changed, 26 insertions(+), 23 deletions(-) diff --git a/daemon/DistinstBackend.vala b/daemon/DistinstBackend.vala index b356ba868..31837378e 100644 --- a/daemon/DistinstBackend.vala +++ b/daemon/DistinstBackend.vala @@ -376,6 +376,8 @@ public class InstallerDaemon.DistinstBackend : GLib.Object { start = disk.get_sector (ref efi_sector); } + break; + case Distinst.PartitionTable.NONE: break; } diff --git a/src/Views/AbstractInstallerView.vala b/src/Views/AbstractInstallerView.vala index f0381f460..42ce176d0 100644 --- a/src/Views/AbstractInstallerView.vala +++ b/src/Views/AbstractInstallerView.vala @@ -53,7 +53,7 @@ public abstract class AbstractInstallerView : Adw.NavigationPage { if (Installer.App.test_mode) { var test_label = new Gtk.Label (_("Test Mode")); - test_label.add_css_class (Granite.STYLE_CLASS_ERROR); + test_label.add_css_class (Granite.CssClass.ERROR); action_area.append (test_label); } diff --git a/src/Views/CheckView.vala b/src/Views/CheckView.vala index 90c9bd2cf..76d7136cd 100644 --- a/src/Views/CheckView.vala +++ b/src/Views/CheckView.vala @@ -84,7 +84,7 @@ public class Installer.CheckView : AbstractInstallerView { content_area.append (message_box); var ignore_button = new Gtk.Button.with_label (_("Install Anyway")); - ignore_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION); + ignore_button.add_css_class (Granite.CssClass.DESTRUCTIVE); ignore_button.clicked.connect (() => next_step ()); action_box_end.append (ignore_button); @@ -180,8 +180,6 @@ public class Installer.CheckView : AbstractInstallerView { public string description { get; construct; } public string icon_name { get; construct; } - private Gtk.Grid grid; - public CheckView (string title, string description, string icon_name) { Object ( title: title, diff --git a/src/Views/DiskView.vala b/src/Views/DiskView.vala index 9ee4af95c..41579380a 100644 --- a/src/Views/DiskView.vala +++ b/src/Views/DiskView.vala @@ -97,7 +97,7 @@ public class Installer.DiskView : AbstractInstallerView { // Make sure we can skip this view in Test Mode sensitive = Installer.App.test_mode }; - next_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + next_button.add_css_class (Granite.CssClass.SUGGESTED); next_button.clicked.connect (() => next_step ()); action_box_end.append (next_button); diff --git a/src/Views/DriversView.vala b/src/Views/DriversView.vala index af20ee9a2..b671d9cc7 100644 --- a/src/Views/DriversView.vala +++ b/src/Views/DriversView.vala @@ -77,7 +77,7 @@ }; var next_button = new Gtk.Button.with_label (_("Erase and Install")); - next_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION); + next_button.add_css_class (Granite.CssClass.DESTRUCTIVE); next_button.clicked.connect (() => next_step ()); action_box_end.append (back_button); diff --git a/src/Views/EncryptView.vala b/src/Views/EncryptView.vala index cc559da9d..7840e64b1 100644 --- a/src/Views/EncryptView.vala +++ b/src/Views/EncryptView.vala @@ -82,7 +82,7 @@ public class EncryptView : AbstractInstallerView { message_box.append (keyboard_row); pw_error_revealer = new ErrorRevealer ("."); - pw_error_revealer.label_widget.add_css_class (Granite.STYLE_CLASS_WARNING); + pw_error_revealer.label_widget.add_css_class (Granite.CssClass.WARNING); pw_entry = new ValidatedEntry (); @@ -108,7 +108,7 @@ public class EncryptView : AbstractInstallerView { }; confirm_entry_revealer = new ErrorRevealer ("."); - confirm_entry_revealer.label_widget.add_css_class (Granite.STYLE_CLASS_ERROR); + confirm_entry_revealer.label_widget.add_css_class (Granite.CssClass.ERROR); var password_box = new Gtk.Box (VERTICAL, 6); password_box.append (pw_label); @@ -133,7 +133,7 @@ public class EncryptView : AbstractInstallerView { next_button = new Gtk.Button.with_label (_(SKIP_STRING)) { receives_default = true }; - next_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + next_button.add_css_class (Granite.CssClass.SUGGESTED); action_box_end.append (encrypt_button); action_box_end.append (next_button); @@ -289,7 +289,7 @@ public class EncryptView : AbstractInstallerView { wrap = true, xalign = 1 }; - label_widget.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL); + label_widget.add_css_class (Granite.CssClass.SMALL); var revealer = new Gtk.Revealer () { child = label_widget, diff --git a/src/Views/ErrorView.vala b/src/Views/ErrorView.vala index b66bf2fcd..dcbceb5e9 100644 --- a/src/Views/ErrorView.vala +++ b/src/Views/ErrorView.vala @@ -116,7 +116,7 @@ public class ErrorView : AbstractInstallerView { var demo_button = new Gtk.Button.with_label (_("Try Demo Mode")); var install_button = new Gtk.Button.with_label (_("Try Installing Again")); - install_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + install_button.add_css_class (Granite.CssClass.SUGGESTED); action_box_end.append (restart_button); action_box_end.append (demo_button); diff --git a/src/Views/KeyboardLayoutView.vala b/src/Views/KeyboardLayoutView.vala index bf1521c59..365eb051e 100644 --- a/src/Views/KeyboardLayoutView.vala +++ b/src/Views/KeyboardLayoutView.vala @@ -58,7 +58,7 @@ public class KeyboardLayoutView : AbstractInstallerView { var next_button = new Gtk.Button.with_label (_("Select")) { sensitive = false }; - next_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + next_button.add_css_class (Granite.CssClass.SUGGESTED); action_box_end.append (back_button); action_box_end.append (next_button); diff --git a/src/Views/LanguageView.vala b/src/Views/LanguageView.vala index 07f50cfb2..ee523f914 100644 --- a/src/Views/LanguageView.vala +++ b/src/Views/LanguageView.vala @@ -104,7 +104,7 @@ public class Installer.LanguageView : AbstractInstallerView { next_button = new Gtk.Button.with_label (_("Select")) { sensitive = false }; - next_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + next_button.add_css_class (Granite.CssClass.SUGGESTED); action_box_end.append (next_button); diff --git a/src/Views/PartitioningView.vala b/src/Views/PartitioningView.vala index 1f2e9abe7..11d410359 100644 --- a/src/Views/PartitioningView.vala +++ b/src/Views/PartitioningView.vala @@ -143,7 +143,7 @@ public class Installer.PartitioningView : AbstractInstallerView { }; next_button = new Gtk.Button.with_label (_("Next")); - next_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + next_button.add_css_class (Granite.CssClass.SUGGESTED); next_button.sensitive = false; action_box_start.append (modify_partitions_button); @@ -237,6 +237,8 @@ public class Installer.PartitioningView : AbstractInstallerView { break; case GPT: break; + case NONE: + break; } string layout_debug = ""; diff --git a/src/Views/ProgressView.vala b/src/Views/ProgressView.vala index 9c9e0b24f..2ff917115 100644 --- a/src/Views/ProgressView.vala +++ b/src/Views/ProgressView.vala @@ -68,9 +68,8 @@ public class ProgressView : Adw.NavigationPage { progressbar_label = new Gtk.Label (null) { xalign = 0 }; - progressbar_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - // FIXME: use granite constant when Granite 7.7.0 is released - progressbar_label.add_css_class ("numeric"); + progressbar_label.add_css_class (Granite.CssClass.DIM); + progressbar_label.add_css_class (Granite.CssClass.NUMERIC); progressbar = new Gtk.ProgressBar () { hexpand = true @@ -239,6 +238,8 @@ public class ProgressView : Adw.NavigationPage { ///TRANSLATORS: The current step of the installer back-end step_string = _("Finishing the Installation"); break; + default: + break; } progressbar_label.label = "%s (%d%%)".printf (step_string, status.percent); diff --git a/src/Views/SuccessView.vala b/src/Views/SuccessView.vala index ffeef7bf1..5dc5fbd9c 100644 --- a/src/Views/SuccessView.vala +++ b/src/Views/SuccessView.vala @@ -59,7 +59,7 @@ public class SuccessView : AbstractInstallerView { shutdown_button.clicked.connect (Utils.shutdown); var restart_button = new Gtk.Button.with_label (_("Restart Device")); - restart_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + restart_button.add_css_class (Granite.CssClass.SUGGESTED); restart_button.clicked.connect (Utils.restart); action_box_end.append (shutdown_button); diff --git a/src/Views/TryInstallView.vala b/src/Views/TryInstallView.vala index f6e0e938d..58b9c1dc7 100644 --- a/src/Views/TryInstallView.vala +++ b/src/Views/TryInstallView.vala @@ -83,7 +83,7 @@ public class Installer.TryInstallView : AbstractInstallerView { var next_button = new Gtk.Button.with_label (_("Next")) { sensitive = false }; - next_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + next_button.add_css_class (Granite.CssClass.SUGGESTED); action_box_end.append (back_button); action_box_end.append (next_button); diff --git a/src/Widgets/DecryptMenu.vala b/src/Widgets/DecryptMenu.vala index 5eb1b1ff9..23c0131f0 100644 --- a/src/Widgets/DecryptMenu.vala +++ b/src/Widgets/DecryptMenu.vala @@ -108,7 +108,7 @@ public class Installer.DecryptMenu: Gtk.Popover { decrypt_button = new Gtk.Button.with_label (_("Decrypt")); decrypt_button.halign = Gtk.Align.END; decrypt_button.sensitive = false; - decrypt_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION); + decrypt_button.add_css_class (Granite.CssClass.SUGGESTED); decrypt_button.clicked.connect (() => { decrypt.begin (pv_entry.get_text ()); }); diff --git a/src/Widgets/DescriptionRow.vala b/src/Widgets/DescriptionRow.vala index 6ce7d528b..4144bcd03 100644 --- a/src/Widgets/DescriptionRow.vala +++ b/src/Widgets/DescriptionRow.vala @@ -21,7 +21,7 @@ public class DescriptionRow : Gtk.Box { pixel_size = 24, valign = START }; - image.add_css_class (Granite.STYLE_CLASS_ACCENT); + image.add_css_class (Granite.CssClass.ACCENT); image.add_css_class (color); var description_label = new Gtk.Label (description) { diff --git a/src/Widgets/DiskBar.vala b/src/Widgets/DiskBar.vala index 4d82986f7..045f4911b 100644 --- a/src/Widgets/DiskBar.vala +++ b/src/Widgets/DiskBar.vala @@ -261,8 +261,8 @@ public class Installer.DiskBar: Gtk.Box { ) { halign = START, }; - info.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - info.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL); + info.add_css_class (Granite.CssClass.DIM); + info.add_css_class (Granite.CssClass.SMALL); info.use_markup = true; var path = new Gtk.Label (ppath) {