Skip to content
Open
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
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tauri-plugin-template = { workspace = true }
tauri-plugin-tray = { workspace = true }
tauri-plugin-windows = { workspace = true }

tauri = { workspace = true, features = ["specta", "macos-private-api"] }
tauri = { workspace = true, features = ["macos-private-api"] }
tauri-plugin-autostart = "2"
tauri-plugin-clipboard-manager = "2"
tauri-plugin-decorum = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions apps/desktop/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
margin: 0;
}

html,
body {
background: transparent;
}

body {
line-height: 1.5;
-webkit-font-smoothing: antialiased;
Expand Down
3 changes: 2 additions & 1 deletion plugins/windows/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ serde = { workspace = true }
specta = { workspace = true }
strum = { workspace = true, features = ["derive"] }

tauri = { workspace = true, features = ["test"] }
tauri = { workspace = true, features = ["macos-private-api"] }
tauri-plugin-decorum = { workspace = true }
tauri-specta = { workspace = true, features = ["derive", "typescript"] }
window-vibrancy = "0.6.0"

thiserror = { workspace = true }
tracing = { workspace = true }
2 changes: 2 additions & 0 deletions plugins/windows/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use serde::{ser::Serializer, Serialize};
pub enum Error {
#[error(transparent)]
TauriError(#[from] tauri::Error),
#[error(transparent)]
WindowVibrancyError(#[from] window_vibrancy::Error),
#[error("monitor not found")]
MonitorNotFound,
}
Expand Down
20 changes: 20 additions & 0 deletions plugins/windows/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ impl HyprWindow {
};

if created {
self.apply_vibrancy(&window)?;

#[cfg(target_os = "macos")]
{
use tauri_plugin_decorum::WebviewWindowExt;
Expand Down Expand Up @@ -369,16 +371,34 @@ impl HyprWindow {

window.set_focus()?;
window.show()?;

Ok(window)
}

fn apply_vibrancy(&self, window: &WebviewWindow) -> Result<(), crate::Error> {
#[cfg(target_os = "macos")]
{
use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial};
apply_vibrancy(window, NSVisualEffectMaterial::HudWindow, None, None)?;
}

#[cfg(target_os = "windows")]
{
use window_vibrancy::apply_blur;
apply_blur(&window, Some((18, 18, 18, 125)))?;
}

Ok(())
}

fn window_builder<'a>(
&'a self,
app: &'a AppHandle<tauri::Wry>,
url: impl Into<std::path::PathBuf>,
) -> WebviewWindowBuilder<'a, tauri::Wry, AppHandle<tauri::Wry>> {
let mut builder = WebviewWindow::builder(app, self.label(), WebviewUrl::App(url.into()))
.title(self.title())
.transparent(true)
.decorations(true)
.disable_drag_drop_handler();

Expand Down
Loading