chore: change CMD_OR_CTRL export location

This commit is contained in:
Amr Bashir 2023-07-18 05:11:00 +03:00
parent 460e88d279
commit db49402b5b
No known key found for this signature in database
GPG key ID: BBD7A47A2003FF33
2 changed files with 9 additions and 6 deletions

View file

@ -30,6 +30,11 @@
pub use keyboard_types::{Code, Modifiers};
use std::{borrow::Borrow, hash::Hash, str::FromStr};
#[cfg(target_os = "macos")]
pub const CMD_OR_CTRL: Modifiers = Modifiers::SUPER;
#[cfg(not(target_os = "macos"))]
pub const CMD_OR_CTRL: Modifiers = Modifiers::CONTROL;
/// A keyboard shortcut that consists of an optional combination
/// of modifier keys (provided by [`Modifiers`](crate::accelerator::Modifiers)) and
/// one key ([`Code`](crate::accelerator::Code)).

View file

@ -4,14 +4,12 @@
use std::{cell::RefCell, rc::Rc};
use crate::{accelerator::Accelerator, AboutMetadata, IsMenuItem, MenuItemType};
use crate::{
accelerator::{Accelerator, CMD_OR_CTRL},
AboutMetadata, IsMenuItem, MenuItemType,
};
use keyboard_types::{Code, Modifiers};
#[cfg(target_os = "macos")]
pub const CMD_OR_CTRL: Modifiers = Modifiers::META;
#[cfg(not(target_os = "macos"))]
pub const CMD_OR_CTRL: Modifiers = Modifiers::CONTROL;
/// A predefined (native) menu item which has a predfined behavior by the OS or by this crate.
pub struct PredefinedMenuItem(pub(crate) Rc<RefCell<crate::platform_impl::MenuChild>>);