Skip to content

Commit cc85c7a

Browse files
authored
Fix Granite Style deprecations (#401)
1 parent 0c84381 commit cc85c7a

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

src/Views/FirmwareReleaseView.vala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ public class About.FirmwareReleaseView : Adw.NavigationPage {
2424
private Gtk.Label install_duration_value_label;
2525

2626
construct {
27-
var back_button = new Gtk.Button.with_label (_("All Updates")) {
28-
action_name = "navigation.pop",
27+
var back_button = new Granite.BackButton (_("All Updates")) {
2928
halign = START
3029
};
31-
back_button.add_css_class (Granite.STYLE_CLASS_BACK_BUTTON);
3230

3331
title_label = new Gtk.Label ("") {
3432
ellipsize = END,
@@ -40,7 +38,7 @@ public class About.FirmwareReleaseView : Adw.NavigationPage {
4038
halign = END,
4139
sensitive = false
4240
};
43-
update_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION);
41+
update_button.add_css_class (Granite.CssClass.SUGGESTED);
4442

4543
update_button_revealer = new Gtk.Revealer () {
4644
child = update_button
@@ -108,7 +106,7 @@ public class About.FirmwareReleaseView : Adw.NavigationPage {
108106
margin_top = 12,
109107
row_spacing = 3
110108
};
111-
key_val_grid.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);
109+
key_val_grid.add_css_class (Granite.CssClass.DIM);
112110

113111
key_val_grid.attach (version_label, 0, 0);
114112
key_val_grid.attach (version_value_label, 1, 0);

src/Views/FirmwareView.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public class About.FirmwareView : Switchboard.SettingsPage {
357357
};
358358

359359
var suggested_button = (Gtk.Button) message_dialog.add_button (_("Continue"), Gtk.ResponseType.ACCEPT);
360-
suggested_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION);
360+
suggested_button.add_css_class (Granite.CssClass.SUGGESTED);
361361

362362
if (detach_image != null) {
363363
var custom_widget = new Gtk.Image.from_file (detach_image);
@@ -379,7 +379,7 @@ public class About.FirmwareView : Switchboard.SettingsPage {
379379
};
380380

381381
var suggested_button = (Gtk.Button) message_dialog.add_button (_("Restart"), Gtk.ResponseType.ACCEPT);
382-
suggested_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION);
382+
suggested_button.add_css_class (Granite.CssClass.SUGGESTED);
383383

384384
message_dialog.response.connect ((response) => {
385385
if (response == Gtk.ResponseType.ACCEPT) {
@@ -403,7 +403,7 @@ public class About.FirmwareView : Switchboard.SettingsPage {
403403
};
404404

405405
var suggested_button = (Gtk.Button) message_dialog.add_button (_("Shut Down"), Gtk.ResponseType.ACCEPT);
406-
suggested_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION);
406+
suggested_button.add_css_class (Granite.CssClass.DESTRUCTIVE);
407407

408408
message_dialog.response.connect ((response) => {
409409
if (response == Gtk.ResponseType.ACCEPT) {
@@ -428,7 +428,7 @@ public class About.FirmwareView : Switchboard.SettingsPage {
428428
};
429429

430430
var continue_button = dialog.add_button (_("Restart"), Gtk.ResponseType.ACCEPT);
431-
continue_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION);
431+
continue_button.add_css_class (Granite.CssClass.DESTRUCTIVE);
432432

433433
dialog.response.connect ((result) => {
434434
dialog.destroy ();

src/Views/HardwareView.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class About.HardwareView : Gtk.Box {
9999
selectable = true,
100100
xalign = 0
101101
};
102-
manufacturer_info.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);
102+
manufacturer_info.add_css_class (Granite.CssClass.DIM);
103103

104104
if (product_name != null) {
105105
manufacturer_info.label += " <b>%s</b>".printf (product_name);

src/Views/OperatingSystemView.vala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public class About.OperatingSystemView : Gtk.Box {
171171
xalign = 0,
172172
hexpand = true
173173
};
174-
kernel_version_label.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL);
175-
kernel_version_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);
174+
kernel_version_label.add_css_class (Granite.CssClass.SMALL);
175+
kernel_version_label.add_css_class (Granite.CssClass.DIM);
176176

177177
packages = new Gtk.StringList (null);
178178

@@ -199,15 +199,15 @@ public class About.OperatingSystemView : Gtk.Box {
199199
use_markup = true,
200200
wrap = true
201201
};
202-
updates_description.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL);
203-
updates_description.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);
202+
updates_description.add_css_class (Granite.CssClass.SMALL);
203+
updates_description.add_css_class (Granite.CssClass.DIM);
204204

205205
var progress_description_box = new Gtk.Box (VERTICAL, 3);
206206
progress_description_box.append (update_progress_revealer);
207207
progress_description_box.append (updates_description);
208208

209209
var update_button = new Gtk.Button.with_label (_("Download"));
210-
update_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION);
210+
update_button.add_css_class (Granite.CssClass.SUGGESTED);
211211

212212
var cancel_button = new Gtk.Button.with_label (_("Cancel"));
213213

@@ -229,7 +229,7 @@ public class About.OperatingSystemView : Gtk.Box {
229229
margin_top = 6
230230
};
231231
details_button.add_css_class ("link");
232-
details_button.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL);
232+
details_button.add_css_class (Granite.CssClass.SMALL);
233233

234234
details_button_revealer = new Gtk.Revealer () {
235235
child = details_button
@@ -498,8 +498,8 @@ public class About.OperatingSystemView : Gtk.Box {
498498
xalign = 0,
499499
hexpand = true
500500
};
501-
based_off.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL);
502-
based_off.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);
501+
based_off.add_css_class (Granite.CssClass.SMALL);
502+
based_off.add_css_class (Granite.CssClass.DIM);
503503
software_grid.attach (based_off, 1, 1, 3);
504504
}
505505
}
@@ -677,7 +677,7 @@ public class About.OperatingSystemView : Gtk.Box {
677677
};
678678

679679
var continue_button = dialog.add_button (_("Restore Settings"), Gtk.ResponseType.ACCEPT);
680-
continue_button.add_css_class (Granite.STYLE_CLASS_DESTRUCTIVE_ACTION);
680+
continue_button.add_css_class (Granite.CssClass.DESTRUCTIVE);
681681

682682
dialog.response.connect ((response) => {
683683
dialog.destroy ();
@@ -773,7 +773,7 @@ public class About.OperatingSystemView : Gtk.Box {
773773
var image = new Gtk.Image.from_icon_name (icon_name) {
774774
pixel_size = 16
775775
};
776-
image.add_css_class (Granite.STYLE_CLASS_ACCENT);
776+
image.add_css_class (Granite.CssClass.ACCENT);
777777
image.add_css_class (color);
778778

779779
var left_label = new Gtk.Label (label_string) {
@@ -818,7 +818,7 @@ public class About.OperatingSystemView : Gtk.Box {
818818

819819
construct {
820820
var image = new Gtk.Image.from_icon_name ("face-heart-symbolic");
821-
image.add_css_class (Granite.STYLE_CLASS_ACCENT);
821+
image.add_css_class (Granite.CssClass.ACCENT);
822822
image.add_css_class ("pink");
823823

824824
var main_label = new Gtk.Label (_("Sponsor Us")) {
@@ -829,8 +829,8 @@ public class About.OperatingSystemView : Gtk.Box {
829829
target_label = new Gtk.Label (null) {
830830
halign = START
831831
};
832-
target_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL);
833-
target_label.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL);
832+
target_label.add_css_class (Granite.CssClass.DIM);
833+
target_label.add_css_class (Granite.CssClass.SMALL);
834834

835835
levelbar = new Gtk.LevelBar ();
836836
levelbar.add_css_class (Granite.STYLE_CLASS_FLAT);

0 commit comments

Comments
 (0)