Skip to content

Commit

Permalink
Fix white background on Windows/Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Jul 23, 2022
1 parent 8eb4b5c commit 515a8bc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src-tauri/Cargo.lock

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

3 changes: 1 addition & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ atomicwrites = "0.3"
macos-app-nap = "0.0.1"
cocoa = "0.24.0"
objc = "0.2.7"
# https://github.com/h4llow3En/mac-notification-sys/issues/43
mac-notification-sys = "=0.5.2"
mac-notification-sys = "0.5.5"

[features]
default = [ "custom-protocol" ]
Expand Down
15 changes: 7 additions & 8 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,13 @@ fn create_window(app: &AppHandle) -> Window {
.title("Remind Me Again")
.inner_size(400.0, 550.0)
.min_inner_size(400.0, 200.0)
.skip_taskbar(true)
.visible(false) // tauri_plugin_window_state reveals window
.transparent(true)
.build()
.expect("Unable to create window");
.skip_taskbar(true);

#[cfg(target_os = "macos")]
let win = win.transparent(true);

let win = win.build().expect("Unable to create window");

#[cfg(target_os = "macos")]
{
Expand Down Expand Up @@ -231,10 +233,7 @@ fn create_window(app: &AppHandle) -> Window {
// set window background color
let bg_color = cocoa::appkit::NSColor::colorWithRed_green_blue_alpha_(
cocoa::base::nil,
// 34.0 / 255.0 * 0.5,
// 38.0 / 255.0 * 0.5,
// 45.5 / 255.0 * 0.5,
// 1.0,
// also used in App.svelte
8.0 / 255.0,
9.0 / 255.0,
13.0 / 255.0,
Expand Down
1 change: 1 addition & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji
font-size: 18px
color: #ffffff
background-color: rgb(8, 9, 13) // also used in main.rs
</style>

0 comments on commit 515a8bc

Please sign in to comment.