refactor(tauri-utils)!: remove windows_version and is_windows_7 (#8271)

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Amr Bashir 2023-11-20 23:21:42 +02:00 committed by GitHub
parent 46451aee13
commit 3b91e236c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 274 additions and 336 deletions

View File

@ -2,4 +2,4 @@
'tauri-utils': 'minor:breaking' 'tauri-utils': 'minor:breaking'
--- ---
Changed `platform::windows_version` to return a `(u32, u32, u32)` instead of `Option<(u32, u32, u32)>` Removed `platform::windows_version` and `platform::is_windows_7`, use `windows-version` crate instead.

View File

@ -43,9 +43,6 @@ log = "0.4.20"
[target."cfg(target_os = \"linux\")".dependencies] [target."cfg(target_os = \"linux\")".dependencies]
heck = "0.4" heck = "0.4"
[target."cfg(windows)".dependencies]
windows-version = "0.1"
[features] [features]
build = [ "proc-macro2", "quote" ] build = [ "proc-macro2", "quote" ]
compression = [ "brotli" ] compression = [ "brotli" ]

View File

@ -255,21 +255,3 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<Path
res res
} }
#[cfg(windows)]
pub use windows_platform::{is_windows_7, windows_version};
#[cfg(windows)]
mod windows_platform {
/// Checks if we're running on Windows 7.
pub fn is_windows_7() -> bool {
let v = windows_version();
v.0 == 6 && v.1 == 1
}
/// Returns a tuple of (major, minor, buildnumber) for the Windows version.
pub fn windows_version() -> (u32, u32, u32) {
let v = windows_version::OsVersion::current();
(v.major, v.minor, v.build)
}
}

View File

@ -12,7 +12,6 @@ use std::ffi::c_void;
use crate::utils::config::WindowEffectsConfig; use crate::utils::config::WindowEffectsConfig;
use crate::window::{Color, Effect}; use crate::window::{Color, Effect};
use raw_window_handle::HasRawWindowHandle; use raw_window_handle::HasRawWindowHandle;
use tauri_utils::platform::{is_windows_7, windows_version};
use windows::Win32::Foundation::HWND; use windows::Win32::Foundation::HWND;
pub fn apply_effects(window: impl HasRawWindowHandle, effects: WindowEffectsConfig) { pub fn apply_effects(window: impl HasRawWindowHandle, effects: WindowEffectsConfig) {

586
tooling/cli/Cargo.lock generated

File diff suppressed because it is too large Load Diff