Skip to content

Commit

Permalink
chore: move screenshotdialog to a crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Oct 6, 2023
1 parent 1eec22e commit b5ea00e
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 14 deletions.
12 changes: 10 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ name = "xdg-desktop-portal-luminous"
version = "0.3.4"
edition = "2021"

[workspace]
members = ["libs/screenshotdialog", "."]

[dependencies]
screenshotdialog = { path = "libs/screenshotdialog" }

zbus = { version = "3", default-features = false, features = ["tokio", "url"] }
tokio = { version = "1.32.0", features = ["full"] }
serde = { version = "1.0.188", features = ["derive"] }
Expand All @@ -18,7 +23,6 @@ image = { version = "0.24", default-features = false, features = [
"qoi",
] }

slint = "1.2.1"
bitflags = "2.4.0"
enumflags2 = "0.7.8"
once_cell = "1.18.0"
Expand Down Expand Up @@ -52,7 +56,3 @@ toml = "0.8.0"
csscolorparser = "0.6.2"
notify = "6.1.1"
futures = "0.3.28"


[build-dependencies]
slint-build = "1.2.1"
3 changes: 0 additions & 3 deletions build.rs

This file was deleted.

13 changes: 13 additions & 0 deletions libs/screenshotdialog/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "screenshotdialog"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
slint = "1.2.1"
libwayshot = { git = "https://github.com/waycrate/wayshot.git" }

[build-dependencies]
slint-build = "1.2.1"
3 changes: 3 additions & 0 deletions libs/screenshotdialog/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
slint_build::compile("../../ui/selectwindow.slint").unwrap();
}
File renamed without changes.
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod screencast;
mod screenshot;
mod session;
mod settings;
mod slintbackend;

use access::AccessBackend;
use remotedesktop::RemoteDesktopBackend;
Expand Down
5 changes: 2 additions & 3 deletions src/screenshot.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::slintbackend;
use libwayshot::WayshotConnection;
use slintbackend::SlintSelection;
use screenshotdialog::SlintSelection;
use std::collections::HashMap;
use zbus::zvariant::{DeserializeDict, SerializeDict, Type, Value};
use zbus::{dbus_interface, fdo, zvariant::ObjectPath};
Expand Down Expand Up @@ -55,7 +54,7 @@ impl ScreenShotBackend {
.get_all_outputs()
.clone();

match slintbackend::selectgui(wayinfos.clone()) {
match screenshotdialog::selectgui(wayinfos.clone()) {
SlintSelection::Canceled => return Ok(PortalResponse::Cancelled),
SlintSelection::Slurp => {
let slurp = std::process::Command::new("slurp")
Expand Down

0 comments on commit b5ea00e

Please sign in to comment.