Skip to content

Commit a91d7a4

Browse files
committed
Updated src/lib.rs:
- Updated reuse copyright year - Refactored to use call gtk::style_context_add_provider_for_display instead of old gtk::StyleContext module Signed-off-by: Deren Vural <35734401+derenv@users.noreply.github.com>
1 parent 3e0fac6 commit a91d7a4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/lib.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 Deren Vural
1+
// SPDX-FileCopyrightText: 2024 Deren Vural
22
// SPDX-License-Identifier: GPL-3.0-or-later
33

44
/**
@@ -31,10 +31,20 @@ mod modificationwindow;
3131
mod settingswindow;
3232

3333
// Imports
34-
use adwaita::{gio, prelude::*, Application};
34+
// std
35+
//
36+
// gtk-rs
37+
use adwaita::{
38+
gio,
39+
prelude::*,
40+
Application
41+
};
3542
use gdk::Display;
3643
use gio::resources_register_include;
37-
use gtk::{CssProvider, StyleContext};
44+
use gtk::{
45+
CssProvider,
46+
style_context_add_provider_for_display
47+
};
3848

3949
// Constants
4050
const APP_ID: &str = "com.gtk_d.NvidiaMonitorRust";
@@ -127,7 +137,7 @@ fn load_css() {
127137
provider.load_from_path("style.css");
128138

129139
// Add the provider to the default screen
130-
StyleContext::add_provider_for_display(
140+
style_context_add_provider_for_display(
131141
&Display::default().expect("..Could not connect to a display."),
132142
&provider,
133143
gtk::STYLE_PROVIDER_PRIORITY_APPLICATION,

0 commit comments

Comments
 (0)