Skip to content

Commit 7c5c416

Browse files
Stop using deprecated APIs
1 parent 2189dc3 commit 7c5c416

File tree

16 files changed

+17
-17
lines changed

16 files changed

+17
-17
lines changed

book/listings/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66

77
[dependencies]
8-
gtk = { version = "*", package = "gtk4", features = ["v4_8"] }
8+
gtk = { version = "*", package = "gtk4", features = ["v4_12"] }
99
adw = { version = ">= 0.3.1", package = "libadwaita", features = ["v1_2"] }
1010
once_cell = "1.0"
1111
serde = { version = "1.0", features = ["derive"] }

book/listings/css/1/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() -> glib::ExitCode {
2020
fn load_css() {
2121
// Load the CSS file and add it to the provider
2222
let provider = CssProvider::new();
23-
provider.load_from_data(include_str!("style.css"));
23+
provider.load_from_string(include_str!("style.css"));
2424

2525
// Add the provider to the default screen
2626
gtk::style_context_add_provider_for_display(

book/listings/css/2/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() -> glib::ExitCode {
1919
fn load_css() {
2020
// Load the CSS file and add it to the provider
2121
let provider = CssProvider::new();
22-
provider.load_from_data(include_str!("style.css"));
22+
provider.load_from_string(include_str!("style.css"));
2323

2424
// Add the provider to the default screen
2525
gtk::style_context_add_provider_for_display(

book/listings/css/3/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() -> glib::ExitCode {
1919
fn load_css() {
2020
// Load the CSS file and add it to the provider
2121
let provider = CssProvider::new();
22-
provider.load_from_data(include_str!("style.css"));
22+
provider.load_from_string(include_str!("style.css"));
2323

2424
// Add the provider to the default screen
2525
gtk::style_context_add_provider_for_display(

book/listings/css/4/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() -> glib::ExitCode {
1919
fn load_css() {
2020
// Load the CSS file and add it to the provider
2121
let provider = CssProvider::new();
22-
provider.load_from_data(include_str!("style.css"));
22+
provider.load_from_string(include_str!("style.css"));
2323

2424
// Add the provider to the default screen
2525
gtk::style_context_add_provider_for_display(

book/listings/css/7/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() -> glib::ExitCode {
2323
fn load_css() {
2424
// Load the CSS file and add it to the provider
2525
let provider = CssProvider::new();
26-
provider.load_from_data(include_str!("style.css"));
26+
provider.load_from_string(include_str!("style.css"));
2727

2828
// Add the provider to the default screen
2929
gtk::style_context_add_provider_for_display(

book/listings/css/8/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() -> glib::ExitCode {
2323
fn load_css() {
2424
// Load the CSS file and add it to the provider
2525
let provider = CssProvider::new();
26-
provider.load_from_data(include_str!("style.css"));
26+
provider.load_from_string(include_str!("style.css"));
2727

2828
// Add the provider to the default screen
2929
gtk::style_context_add_provider_for_display(

book/listings/css/9/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() -> glib::ExitCode {
2323
fn load_css() {
2424
// Load the CSS file and add it to the provider
2525
let provider = CssProvider::new();
26-
provider.load_from_data(include_str!("style.css"));
26+
provider.load_from_string(include_str!("style.css"));
2727

2828
// Add the provider to the default screen
2929
gtk::style_context_add_provider_for_display(

book/listings/todo/4/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ fn setup_shortcuts(app: &Application) {
3333
fn build_ui(app: &Application) {
3434
// Create a new custom window and show it
3535
let window = Window::new(app);
36-
window.show();
36+
window.present();
3737
}

book/listings/todo/5/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ fn setup_shortcuts(app: &adw::Application) {
3737
fn build_ui(app: &adw::Application) {
3838
// Create a new custom window and show it
3939
let window = Window::new(app);
40-
window.show();
40+
window.present();
4141
}
4242
// ANCHOR_END: main

0 commit comments

Comments
 (0)