forked from iced-rs/iced
-
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.
Expose macOS ActivationPolicy and activate_ignoring_other_apps
- Loading branch information
Showing
3 changed files
with
71 additions
and
4 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
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,12 +1,43 @@ | ||
//! Platform specific settings for macOS. | ||
|
||
/// The platform specific window settings of an application. | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
pub struct PlatformSpecific { | ||
/// Hides the window title. | ||
pub title_hidden: bool, | ||
/// Makes the titlebar transparent and allows the content to appear behind it. | ||
pub titlebar_transparent: bool, | ||
/// Makes the window content appear behind the titlebar. | ||
pub fullsize_content_view: bool, | ||
/// Activation policy for the application. | ||
pub activation_policy: ActivationPolicy, | ||
/// Used to prevent the application from automatically activating when launched if | ||
/// another application is already active. | ||
/// | ||
/// The default behavior is to ignore other applications and activate when launched. | ||
pub activate_ignoring_other_apps: bool, | ||
} | ||
|
||
impl Default for PlatformSpecific { | ||
fn default() -> Self { | ||
Self { | ||
title_hidden: false, | ||
titlebar_transparent: false, | ||
fullsize_content_view: false, | ||
activation_policy: Default::default(), // Regular | ||
activate_ignoring_other_apps: true, | ||
} | ||
} | ||
} | ||
|
||
/// Corresponds to `NSApplicationActivationPolicy`. | ||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] | ||
pub enum ActivationPolicy { | ||
/// Corresponds to `NSApplicationActivationPolicyRegular`. | ||
#[default] | ||
Regular, | ||
/// Corresponds to `NSApplicationActivationPolicyAccessory`. | ||
Accessory, | ||
/// Corresponds to `NSApplicationActivationPolicyProhibited`. | ||
Prohibited, | ||
} |
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