-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
30 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Changelog | ||
|
||
## 2023.1.15 | ||
## 23.1.15 (2023.01.15) | ||
|
||
初始化f-t | ||
第一个版本, 完成基本功能 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use crate::setup::set_window_vibrancy; | ||
|
||
#[tauri::command] | ||
pub fn backend_add(number: i32) -> i32 { | ||
// Note: these commands block the main thread and hang the UI until they return. | ||
// If you need to run a long-running task, use async command instead. | ||
println!("Backend was called with an argument: {}", number); | ||
// set_window_vibrancy(); | ||
number + 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
use tauri::{App, Manager}; | ||
use tauri::{App, Manager, Window}; | ||
use window_vibrancy::{self, NSVisualEffectMaterial, NSVisualEffectState}; | ||
|
||
/// setup | ||
pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>> { | ||
let win = app.get_window("main").unwrap(); | ||
set_window_vibrancy(win); | ||
Ok(()) | ||
} | ||
|
||
pub fn set_window_vibrancy(win: Window) { | ||
// 仅在 macOS 下执行 | ||
#[cfg(target_os = "macos")] | ||
window_vibrancy::apply_vibrancy( | ||
&win, | ||
NSVisualEffectMaterial::FullScreenUI, | ||
Some(NSVisualEffectState::FollowsWindowActiveState), | ||
Some(12.1) | ||
Some(12.1), | ||
) | ||
.expect("Unsupported platform! 'apply_vibrancy' is only supported on macOS"); | ||
|
||
// 仅在 windows 下执行 | ||
#[cfg(target_os = "windows")] | ||
window_vibrancy::apply_blur(&win, Some((18, 18, 18, 125))) | ||
.expect("Unsupported platform! 'apply_blur' is only supported on Windows"); | ||
|
||
Ok(()) | ||
// 支持win10和win11 | ||
window_vibrancy::apply_acrylic(&win, Some((18, 18, 18, 125))) | ||
.expect("Unsupported platform! 'apply_acrylic' is only supported on Windows"); | ||
// 只支持win11 | ||
// window_vibrancy::apply_mica(&win); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters