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

fix clippy errors on macOS #7064

Merged
merged 2 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion core/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ pub struct BundleConfig {
}

/// a tuple struct of RGBA colors. Each value has minimum of 0 and maximum of 255.
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize, Default)]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize, Default)]
#[cfg_attr(feature = "schema", derive(JsonSchema))]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct Color(pub u8, pub u8, pub u8, pub u8);
Expand Down
23 changes: 11 additions & 12 deletions core/tauri/src/vibrancy/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ pub fn apply_effects(window: id, effects: WindowEffectsConfig) {
return;
}

if appearance as u32 > 9 && NSAppKitVersionNumber < NSAppKitVersionNumber10_14 {
if appearance as u32 > 4 && NSAppKitVersionNumber < NSAppKitVersionNumber10_11 {
appearance = NSVisualEffectMaterial::AppearanceBased;
} else if appearance as u32 > 4 && NSAppKitVersionNumber < NSAppKitVersionNumber10_11 {
}

if appearance as u32 > 9 && NSAppKitVersionNumber < NSAppKitVersionNumber10_14 {
appearance = NSVisualEffectMaterial::AppearanceBased;
}

Expand Down Expand Up @@ -201,20 +203,17 @@ impl NSVisualEffectView for id {

/// <https://developer.apple.com/documentation/appkit/nsvisualeffectview/material>
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NSVisualEffectMaterial {
#[deprecated(
since = "macOS 10.14",
note = "A default material appropriate for the view's effectiveAppearance. You should instead choose an appropriate semantic material."
)]
#[deprecated = "Since macOS 10.14 a default material appropriate for the view's effectiveAppearance. You should instead choose an appropriate semantic material."]
AppearanceBased = 0,
#[deprecated(since = "macOS 10.14", note = "Use a semantic material instead.")]
#[deprecated = "Since macOS 10.14 use a semantic material instead."]
Light = 1,
#[deprecated(since = "macOS 10.14", note = "Use a semantic material instead.")]
#[deprecated = "Since macOS 10.14 use a semantic material instead."]
Dark = 2,
#[deprecated(since = "macOS 10.14", note = "Use a semantic material instead.")]
#[deprecated = "Since macOS 10.14 use a semantic material instead."]
MediumLight = 8,
#[deprecated(since = "macOS 10.14", note = "Use a semantic material instead.")]
#[deprecated = "Since macOS 10.14 use a semantic material instead."]
UltraDark = 9,

/// macOS 10.10+
Expand Down Expand Up @@ -252,7 +251,7 @@ pub enum NSVisualEffectMaterial {
/// <https://developer.apple.com/documentation/appkit/nsvisualeffectview/state>
#[allow(dead_code)]
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NSVisualEffectState {
/// Make window vibrancy state follow the window's active state
FollowsWindowActiveState = 0,
Expand Down