Switch to libadwaita
This commit is contained in:
parent
06b091c87f
commit
838e093190
32
Cargo.lock
generated
32
Cargo.lock
generated
@ -398,6 +398,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"gtk4",
|
"gtk4",
|
||||||
|
"libadwaita",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -410,6 +411,37 @@ dependencies = [
|
|||||||
"hashbrown",
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libadwaita"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ff9c222b5c783729de45185f07b2fec2d43a7f9c63961e777d3667e20443878"
|
||||||
|
dependencies = [
|
||||||
|
"gdk4",
|
||||||
|
"gio",
|
||||||
|
"glib",
|
||||||
|
"gtk4",
|
||||||
|
"libadwaita-sys",
|
||||||
|
"libc",
|
||||||
|
"pango",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libadwaita-sys"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1c44d8bdbad31d6639e1f20cc9c1424f1a8e02d751fc28d44659bf743fb9eca6"
|
||||||
|
dependencies = [
|
||||||
|
"gdk4-sys",
|
||||||
|
"gio-sys",
|
||||||
|
"glib-sys",
|
||||||
|
"gobject-sys",
|
||||||
|
"gtk4-sys",
|
||||||
|
"libc",
|
||||||
|
"pango-sys",
|
||||||
|
"system-deps",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.158"
|
version = "0.2.158"
|
||||||
|
@ -4,5 +4,6 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
adw = { version = "0.7.0", package = "libadwaita", features = ["v1_5"] }
|
||||||
anyhow = "1.0.86"
|
anyhow = "1.0.86"
|
||||||
gtk = { version = "0.9.0", package = "gtk4", features = ["v4_14"] }
|
gtk = { version = "0.9.0", package = "gtk4", features = ["v4_14"] }
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use crate::glib::clone;
|
use crate::glib::clone;
|
||||||
|
use adw;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::{self, glib, Application, ApplicationWindow, Button, Image};
|
use gtk::{self, glib, Application, ApplicationWindow, Button, Image};
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
@ -11,7 +12,7 @@ const APP_ID: &str = "org.gtk_rs.GObjectMemoryManagement1";
|
|||||||
|
|
||||||
fn main() -> glib::ExitCode {
|
fn main() -> glib::ExitCode {
|
||||||
// Create a new application
|
// Create a new application
|
||||||
let app = Application::builder().application_id(APP_ID).build();
|
let app = adw::Application::builder().application_id(APP_ID).build();
|
||||||
|
|
||||||
// Connect to "activate" signal of `app`
|
// Connect to "activate" signal of `app`
|
||||||
app.connect_activate(build_ui);
|
app.connect_activate(build_ui);
|
||||||
@ -45,7 +46,7 @@ fn get_pictures_in_folder(folder: String) -> anyhow::Result<Vec<String>> {
|
|||||||
Ok(myvec)
|
Ok(myvec)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_ui(application: &Application) {
|
fn build_ui(application: &adw::Application) {
|
||||||
// Create a vertical container
|
// Create a vertical container
|
||||||
let mut vbox = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
let mut vbox = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
||||||
|
|
||||||
@ -98,7 +99,6 @@ fn build_ui(application: &Application) {
|
|||||||
curr_pic.set(new_index);
|
curr_pic.set(new_index);
|
||||||
image.set_from_file(Some(shared_pics[curr_pic.get()].clone()));
|
image.set_from_file(Some(shared_pics[curr_pic.get()].clone()));
|
||||||
dbg!(new_index.clone());
|
dbg!(new_index.clone());
|
||||||
println!("haaa");
|
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -113,7 +113,6 @@ fn build_ui(application: &Application) {
|
|||||||
curr_pic.set(new_index);
|
curr_pic.set(new_index);
|
||||||
image.set_from_file(Some(shared_pics[curr_pic.get()].clone()));
|
image.set_from_file(Some(shared_pics[curr_pic.get()].clone()));
|
||||||
dbg!(new_index.clone());
|
dbg!(new_index.clone());
|
||||||
println!("haaa");
|
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user