-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improvements to appbar implementation (#150)
- Loading branch information
1 parent
3100cef
commit c5fe429
Showing
20 changed files
with
653 additions
and
424 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type DockConfig = { | ||
enabled: boolean; | ||
edge: 'top' | 'bottom' | 'left' | 'right' | null; | ||
windowMargin: string; | ||
}; |
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 @@ | ||
export * from './monitor-selection'; | ||
export * from './reserve-space-config'; | ||
export * from './dock-config'; | ||
export * from './widget-config'; | ||
export * from './widget-placement'; | ||
export * from './widget-preset'; |
This file was deleted.
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
This file was deleted.
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,3 @@ | ||
mod window_ext_macos; | ||
|
||
pub use window_ext_macos::*; |
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,27 @@ | ||
use anyhow::Context; | ||
use cocoa::{ | ||
appkit::{NSMainMenuWindowLevel, NSWindow}, | ||
base::id, | ||
}; | ||
use tauri::{Runtime, Window}; | ||
|
||
pub trait WindowExtMacOs { | ||
fn set_above_menu_bar(&self) -> anyhow::Result<()>; | ||
} | ||
|
||
impl<R: Runtime> WindowExtMacOs for Window<R> { | ||
fn set_above_menu_bar(&self) -> anyhow::Result<()> { | ||
let ns_win = | ||
self.ns_window().context("Failed to get window handle.")? as id; | ||
|
||
unsafe { | ||
ns_win.setLevel_( | ||
((NSMainMenuWindowLevel + 1) as u64) | ||
.try_into() | ||
.context("Failed to cast `NSMainMenuWindowLevel`.")?, | ||
); | ||
} | ||
|
||
Ok(()) | ||
} | ||
} |
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,15 +1,13 @@ | ||
#[cfg(target_os = "windows")] | ||
mod app_bar; | ||
mod format_bytes; | ||
mod fs_util; | ||
mod length_value; | ||
#[cfg(target_os = "macos")] | ||
pub mod macos; | ||
mod path_ext; | ||
mod window_ext; | ||
|
||
#[cfg(target_os = "windows")] | ||
pub use app_bar::remove_app_bar; | ||
pub mod windows; | ||
|
||
pub use format_bytes::*; | ||
pub use fs_util::*; | ||
pub use length_value::*; | ||
pub use path_ext::*; | ||
pub use window_ext::*; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.