This commit is contained in:
Tsuki 2024-04-26 14:56:53 +08:00
parent e8f8050269
commit ad8a75f780
4 changed files with 98 additions and 8 deletions

83
Cargo.lock generated
View File

@ -1127,6 +1127,29 @@ version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
[[package]]
name = "javascriptcore6"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d95a69260c40bbf52066f2c6fa520c00c1ec8ab8208636cf3070c0157c5221f8"
dependencies = [
"glib",
"javascriptcore6-sys",
"libc",
]
[[package]]
name = "javascriptcore6-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc104f99c5adcd7ed53dd491121c111e05e3e8d40020d3519e98c346ca64186b"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "js-sys"
version = "0.3.68"
@ -1712,6 +1735,7 @@ dependencies = [
"tracker",
"url",
"validator",
"webkit6",
]
[[package]]
@ -1899,6 +1923,32 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "soup3"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fb6bbb0e56d089517432ca8aac0879e5f343b309783384a7fdbdd6d5232e681"
dependencies = [
"futures-channel",
"gio",
"glib",
"libc",
"soup3-sys",
]
[[package]]
name = "soup3-sys"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9c6d7beef555a91c6129f5e71ecf4b6e9eac8b48914098d713b1537ebbf6917"
dependencies = [
"gio-sys",
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "spin"
version = "0.9.8"
@ -2434,6 +2484,39 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "webkit6"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d82bda18116290a9effc1e0f8dbd00236807bf4a9b990b9484bad5ba852fc06"
dependencies = [
"gdk4",
"gio",
"glib",
"gtk4",
"javascriptcore6",
"libc",
"soup3",
"webkit6-sys",
]
[[package]]
name = "webkit6-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c459941f1b22750cbda435ede3f94ed8e8dd8c8608d324ecb0b9a8556b49abd"
dependencies = [
"gdk4-sys",
"gio-sys",
"glib-sys",
"gobject-sys",
"gtk4-sys",
"javascriptcore6-sys",
"libc",
"soup3-sys",
"system-deps",
]
[[package]]
name = "webpki-roots"
version = "0.25.4"

View File

@ -32,6 +32,7 @@ rust-ini = "*"
gitlab = "0.1609.0"
url = "2.5.0"
pulldown-cmark = "0.10.0"
webkit6 = "0.3.0"
[build-dependencies]

View File

@ -1,4 +1,5 @@
use adw::prelude::*;
use webkit6::{prelude::*, WebView};
use gitlab::Project;
use gtk::prelude::*;
use relm4::{
@ -66,8 +67,12 @@ impl SimpleComponent for PackageDetail {
set_label: &init.web_url,
set_halign: gtk::Align::Start,
}
},
gtk::Box{
WebView {
load_uri: "https://www.rust-lang.org",
}
}
,
}
}

View File

@ -35,12 +35,13 @@ impl Config {
pub fn from_env() -> Result<Self, SettingError> {
if let Some(dir_path) =
std::env::current_dir().ok().or(
env::var("RSP_CONFIG")
.ok()
.map(|x| PathBuf::from(x))
.or(dirs::config_dir())
)
// std::env::current_dir().ok().or(
//
// )
{
let path = dir_path.join("rsp.toml");
println!("{:?}", path);