File tree Expand file tree Collapse file tree 11 files changed +19
-19
lines changed Expand file tree Collapse file tree 11 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ edition = "2021"
5
5
6
6
7
7
[dependencies ]
8
- gtk = { version = " *" , package = " gtk4" , features = [" v4_12 " ] }
8
+ gtk = { version = " *" , package = " gtk4" , features = [" v4_8 " ] }
9
9
adw = { version = " >= 0.3.1" , package = " libadwaita" , features = [" v1_2" ] }
10
10
once_cell = " 1.0"
11
11
serde = { version = " 1.0" , features = [" derive" ] }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ fn main() -> glib::ExitCode {
20
20
fn load_css ( ) {
21
21
// Load the CSS file and add it to the provider
22
22
let provider = CssProvider :: new ( ) ;
23
- provider. load_from_string ( include_str ! ( "style.css" ) ) ;
23
+ provider. load_from_data ( include_str ! ( "style.css" ) ) ;
24
24
25
25
// Add the provider to the default screen
26
26
gtk:: style_context_add_provider_for_display (
@@ -40,7 +40,7 @@ fn build_ui(app: &Application) {
40
40
. margin_end ( 12 )
41
41
. build ( ) ;
42
42
43
- // Create a new window and show it
43
+ // Create a new window and present it
44
44
let window = ApplicationWindow :: builder ( )
45
45
. application ( app)
46
46
. title ( "My GTK App" )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn main() -> glib::ExitCode {
19
19
fn load_css ( ) {
20
20
// Load the CSS file and add it to the provider
21
21
let provider = CssProvider :: new ( ) ;
22
- provider. load_from_string ( include_str ! ( "style.css" ) ) ;
22
+ provider. load_from_data ( include_str ! ( "style.css" ) ) ;
23
23
24
24
// Add the provider to the default screen
25
25
gtk:: style_context_add_provider_for_display (
@@ -39,7 +39,7 @@ fn build_ui(app: &Application) {
39
39
. margin_end ( 12 )
40
40
. build ( ) ;
41
41
42
- // Create a new window and show it
42
+ // Create a new window and present it
43
43
let window = ApplicationWindow :: builder ( )
44
44
. application ( app)
45
45
. title ( "My GTK App" )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn main() -> glib::ExitCode {
19
19
fn load_css ( ) {
20
20
// Load the CSS file and add it to the provider
21
21
let provider = CssProvider :: new ( ) ;
22
- provider. load_from_string ( include_str ! ( "style.css" ) ) ;
22
+ provider. load_from_data ( include_str ! ( "style.css" ) ) ;
23
23
24
24
// Add the provider to the default screen
25
25
gtk:: style_context_add_provider_for_display (
@@ -50,7 +50,7 @@ fn build_ui(app: &Application) {
50
50
gtk_box. append ( & button_1) ;
51
51
gtk_box. append ( & button_2) ;
52
52
53
- // Create a new window and show it
53
+ // Create a new window and present it
54
54
let window = ApplicationWindow :: builder ( )
55
55
. application ( app)
56
56
. title ( "My GTK App" )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn main() -> glib::ExitCode {
19
19
fn load_css ( ) {
20
20
// Load the CSS file and add it to the provider
21
21
let provider = CssProvider :: new ( ) ;
22
- provider. load_from_string ( include_str ! ( "style.css" ) ) ;
22
+ provider. load_from_data ( include_str ! ( "style.css" ) ) ;
23
23
24
24
// Add the provider to the default screen
25
25
gtk:: style_context_add_provider_for_display (
@@ -50,7 +50,7 @@ fn build_ui(app: &Application) {
50
50
gtk_box. append ( & button_1) ;
51
51
gtk_box. append ( & button_2) ;
52
52
53
- // Create a new window and show it
53
+ // Create a new window and present it
54
54
let window = ApplicationWindow :: builder ( )
55
55
. application ( app)
56
56
. title ( "My GTK App" )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ fn build_ui(app: &Application) {
36
36
gtk_box. append ( & button_1) ;
37
37
gtk_box. append ( & button_2) ;
38
38
39
- // Create a new window and show it
39
+ // Create a new window and present it
40
40
let window = ApplicationWindow :: builder ( )
41
41
. application ( app)
42
42
. title ( "My GTK App" )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn main() -> glib::ExitCode {
19
19
}
20
20
21
21
fn build_ui ( app : & Application ) {
22
- // Create a new window and show it
22
+ // Create a new window and present it
23
23
let window = Window :: new ( app) ;
24
24
window. present ( ) ;
25
25
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ fn main() -> glib::ExitCode {
23
23
fn load_css ( ) {
24
24
// Load the CSS file and add it to the provider
25
25
let provider = CssProvider :: new ( ) ;
26
- provider. load_from_string ( include_str ! ( "style.css" ) ) ;
26
+ provider. load_from_data ( include_str ! ( "style.css" ) ) ;
27
27
28
28
// Add the provider to the default screen
29
29
gtk:: style_context_add_provider_for_display (
@@ -34,7 +34,7 @@ fn load_css() {
34
34
}
35
35
36
36
fn build_ui ( app : & Application ) {
37
- // Create a new window and show it
37
+ // Create a new window and present it
38
38
let window = Window :: new ( app) ;
39
39
window. present ( ) ;
40
40
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ fn main() -> glib::ExitCode {
23
23
fn load_css ( ) {
24
24
// Load the CSS file and add it to the provider
25
25
let provider = CssProvider :: new ( ) ;
26
- provider. load_from_string ( include_str ! ( "style.css" ) ) ;
26
+ provider. load_from_data ( include_str ! ( "style.css" ) ) ;
27
27
28
28
// Add the provider to the default screen
29
29
gtk:: style_context_add_provider_for_display (
@@ -34,7 +34,7 @@ fn load_css() {
34
34
}
35
35
36
36
fn build_ui ( app : & Application ) {
37
- // Create a new window and show it
37
+ // Create a new window and present it
38
38
let window = Window :: new ( app) ;
39
39
window. present ( ) ;
40
40
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ fn main() -> glib::ExitCode {
23
23
fn load_css ( ) {
24
24
// Load the CSS file and add it to the provider
25
25
let provider = CssProvider :: new ( ) ;
26
- provider. load_from_string ( include_str ! ( "style.css" ) ) ;
26
+ provider. load_from_data ( include_str ! ( "style.css" ) ) ;
27
27
28
28
// Add the provider to the default screen
29
29
gtk:: style_context_add_provider_for_display (
@@ -34,7 +34,7 @@ fn load_css() {
34
34
}
35
35
36
36
fn build_ui ( app : & Application ) {
37
- // Create a new window and show it
37
+ // Create a new window and present it
38
38
let window = Window :: new ( app) ;
39
39
window. present ( ) ;
40
40
}
You can’t perform that action at this time.
0 commit comments