Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite to use objc2 #172

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ description = "Create tray icons for desktop applications"
homepage = "https://github.com/tauri-apps/tray-icon"
repository = "https://github.com/tauri-apps/tray-icon"
license = "MIT OR Apache-2.0"
categories = [ "gui" ]
categories = ["gui"]

[features]
default = [ "libxdo" ]
libxdo = [ "muda/libxdo" ]
serde = [ "muda/serde", "dep:serde" ]
common-controls-v6 = [ "muda/common-controls-v6" ]
default = ["libxdo"]
libxdo = ["muda/libxdo"]
serde = ["muda/serde", "dep:serde"]
common-controls-v6 = ["muda/common-controls-v6"]

[dependencies]
muda = { version = "0.13", default-features = false }
Expand All @@ -28,7 +28,7 @@ features = [
"Win32_Foundation",
"Win32_System_SystemServices",
"Win32_Graphics_Gdi",
"Win32_UI_Shell"
"Win32_UI_Shell",
]

[target."cfg(target_os = \"linux\")".dependencies]
Expand All @@ -39,8 +39,31 @@ dirs = "5"
gtk = "0.18"

[target."cfg(target_os = \"macos\")".dependencies]
cocoa = "0.25"
objc = "0.2"
objc2 = "0.5.2"
objc2-foundation = { version = "0.2.2", features = [
"block2",
"NSArray",
"NSData",
"NSEnumerator",
"NSGeometry",
"NSString",
"NSThread",
] }
objc2-app-kit = { version = "0.2.2", features = [
"NSButton",
"NSCell",
"NSControl",
"NSEvent",
"NSImage",
"NSMenu",
"NSResponder",
"NSStatusBar",
"NSStatusBarButton",
"NSStatusItem",
"NSTrackingArea",
"NSView",
"NSWindow",
] }
core-graphics = "0.23"

[target."cfg(target_os = \"macos\")".dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub enum Error {
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[error(transparent)]
PngEncodingError(#[from] png::EncodingError),
#[error("not on the main thread")]
NotMainThread,
}

/// Convenient type alias of Result type for tray-icon.
Expand Down
Loading
Loading