chore: typo

This commit is contained in:
Amr Bashir 2023-07-27 19:44:50 +03:00
parent c7ec320738
commit 22f2405bb9
No known key found for this signature in database
GPG key ID: BBD7A47A2003FF33
4 changed files with 119 additions and 119 deletions

View file

@ -30,27 +30,27 @@ unsafe impl IsMenuItem for PredefinedMenuItem {
impl PredefinedMenuItem {
/// Separator menu item
pub fn separator() -> PredefinedMenuItem {
PredefinedMenuItem::new::<&str>(PredfinedMenuItemType::Separator, None)
PredefinedMenuItem::new::<&str>(PredefinedMenuItemType::Separator, None)
}
/// Copy menu item
pub fn copy(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Copy, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Copy, text)
}
/// Cut menu item
pub fn cut(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Cut, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Cut, text)
}
/// Paste menu item
pub fn paste(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Paste, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Paste, text)
}
/// SelectAll menu item
pub fn select_all(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::SelectAll, text)
PredefinedMenuItem::new(PredefinedMenuItemType::SelectAll, text)
}
/// Undo menu item
@ -59,7 +59,7 @@ impl PredefinedMenuItem {
///
/// - **Windows / Linux:** Unsupported.
pub fn undo(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Undo, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Undo, text)
}
/// Redo menu item
///
@ -67,7 +67,7 @@ impl PredefinedMenuItem {
///
/// - **Windows / Linux:** Unsupported.
pub fn redo(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Redo, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Redo, text)
}
/// Minimize window menu item
@ -76,7 +76,7 @@ impl PredefinedMenuItem {
///
/// - **Linux:** Unsupported.
pub fn minimize(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Minimize, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Minimize, text)
}
/// Maximize window menu item
@ -85,7 +85,7 @@ impl PredefinedMenuItem {
///
/// - **Linux:** Unsupported.
pub fn maximize(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Maximize, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Maximize, text)
}
/// Fullscreen menu item
@ -94,7 +94,7 @@ impl PredefinedMenuItem {
///
/// - **Windows / Linux:** Unsupported.
pub fn fullscreen(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Fullscreen, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Fullscreen, text)
}
/// Hide window menu item
@ -103,7 +103,7 @@ impl PredefinedMenuItem {
///
/// - **Linux:** Unsupported.
pub fn hide(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Hide, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Hide, text)
}
/// Hide other windows menu item
@ -112,7 +112,7 @@ impl PredefinedMenuItem {
///
/// - **Linux:** Unsupported.
pub fn hide_others(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::HideOthers, text)
PredefinedMenuItem::new(PredefinedMenuItemType::HideOthers, text)
}
/// Show all app windows menu item
@ -121,7 +121,7 @@ impl PredefinedMenuItem {
///
/// - **Windows / Linux:** Unsupported.
pub fn show_all(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::ShowAll, text)
PredefinedMenuItem::new(PredefinedMenuItemType::ShowAll, text)
}
/// Close window menu item
@ -130,7 +130,7 @@ impl PredefinedMenuItem {
///
/// - **Linux:** Unsupported.
pub fn close_window(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::CloseWindow, text)
PredefinedMenuItem::new(PredefinedMenuItemType::CloseWindow, text)
}
/// Quit app menu item
@ -139,12 +139,12 @@ impl PredefinedMenuItem {
///
/// - **Linux:** Unsupported.
pub fn quit(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Quit, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Quit, text)
}
/// About app menu item
pub fn about(text: Option<&str>, metadata: Option<AboutMetadata>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::About(metadata), text)
PredefinedMenuItem::new(PredefinedMenuItemType::About(metadata), text)
}
/// Services menu item
@ -153,10 +153,10 @@ impl PredefinedMenuItem {
///
/// - **Windows / Linux:** Unsupported.
pub fn services(text: Option<&str>) -> PredefinedMenuItem {
PredefinedMenuItem::new(PredfinedMenuItemType::Services, text)
PredefinedMenuItem::new(PredefinedMenuItemType::Services, text)
}
fn new<S: AsRef<str>>(item: PredfinedMenuItemType, text: Option<S>) -> Self {
fn new<S: AsRef<str>>(item: PredefinedMenuItemType, text: Option<S>) -> Self {
Self(Rc::new(RefCell::new(
crate::platform_impl::MenuChild::new_predefined(
item,
@ -213,7 +213,7 @@ fn test_about_metadata() {
#[derive(Debug, Clone)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub(crate) enum PredfinedMenuItemType {
pub(crate) enum PredefinedMenuItemType {
Separator,
Copy,
Cut,
@ -234,84 +234,84 @@ pub(crate) enum PredfinedMenuItemType {
None,
}
impl Default for PredfinedMenuItemType {
impl Default for PredefinedMenuItemType {
fn default() -> Self {
Self::None
}
}
impl PredfinedMenuItemType {
impl PredefinedMenuItemType {
pub(crate) fn text(&self) -> &str {
match self {
PredfinedMenuItemType::Separator => "",
PredfinedMenuItemType::Copy => "&Copy",
PredfinedMenuItemType::Cut => "Cu&t",
PredfinedMenuItemType::Paste => "&Paste",
PredfinedMenuItemType::SelectAll => "Select &All",
PredfinedMenuItemType::Undo => "Undo",
PredfinedMenuItemType::Redo => "Redo",
PredfinedMenuItemType::Minimize => "&Minimize",
PredefinedMenuItemType::Separator => "",
PredefinedMenuItemType::Copy => "&Copy",
PredefinedMenuItemType::Cut => "Cu&t",
PredefinedMenuItemType::Paste => "&Paste",
PredefinedMenuItemType::SelectAll => "Select &All",
PredefinedMenuItemType::Undo => "Undo",
PredefinedMenuItemType::Redo => "Redo",
PredefinedMenuItemType::Minimize => "&Minimize",
#[cfg(target_os = "macos")]
PredfinedMenuItemType::Maximize => "Zoom",
PredefinedMenuItemType::Maximize => "Zoom",
#[cfg(not(target_os = "macos"))]
PredfinedMenuItemType::Maximize => "Ma&ximize",
PredfinedMenuItemType::Fullscreen => "Toggle Full Screen",
PredfinedMenuItemType::Hide => "&Hide",
PredfinedMenuItemType::HideOthers => "Hide Others",
PredfinedMenuItemType::ShowAll => "Show All",
PredefinedMenuItemType::Maximize => "Ma&ximize",
PredefinedMenuItemType::Fullscreen => "Toggle Full Screen",
PredefinedMenuItemType::Hide => "&Hide",
PredefinedMenuItemType::HideOthers => "Hide Others",
PredefinedMenuItemType::ShowAll => "Show All",
#[cfg(windows)]
PredfinedMenuItemType::CloseWindow => "Close",
PredefinedMenuItemType::CloseWindow => "Close",
#[cfg(not(windows))]
PredfinedMenuItemType::CloseWindow => "C&lose Window",
PredefinedMenuItemType::CloseWindow => "C&lose Window",
#[cfg(windows)]
PredfinedMenuItemType::Quit => "&Exit",
PredefinedMenuItemType::Quit => "&Exit",
#[cfg(not(windows))]
PredfinedMenuItemType::Quit => "&Quit",
PredfinedMenuItemType::About(_) => "&About",
PredfinedMenuItemType::Services => "Services",
PredfinedMenuItemType::None => "",
PredefinedMenuItemType::Quit => "&Quit",
PredefinedMenuItemType::About(_) => "&About",
PredefinedMenuItemType::Services => "Services",
PredefinedMenuItemType::None => "",
}
}
pub(crate) fn accelerator(&self) -> Option<Accelerator> {
match self {
PredfinedMenuItemType::Copy => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyC)),
PredfinedMenuItemType::Cut => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyX)),
PredfinedMenuItemType::Paste => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyV)),
PredfinedMenuItemType::Undo => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyZ)),
PredefinedMenuItemType::Copy => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyC)),
PredefinedMenuItemType::Cut => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyX)),
PredefinedMenuItemType::Paste => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyV)),
PredefinedMenuItemType::Undo => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyZ)),
#[cfg(target_os = "macos")]
PredfinedMenuItemType::Redo => Some(Accelerator::new(
PredefinedMenuItemType::Redo => Some(Accelerator::new(
Some(CMD_OR_CTRL | Modifiers::SHIFT),
Code::KeyZ,
)),
#[cfg(not(target_os = "macos"))]
PredfinedMenuItemType::Redo => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyY)),
PredfinedMenuItemType::SelectAll => {
PredefinedMenuItemType::Redo => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyY)),
PredefinedMenuItemType::SelectAll => {
Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyA))
}
PredfinedMenuItemType::Minimize => {
PredefinedMenuItemType::Minimize => {
Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyM))
}
#[cfg(target_os = "macos")]
PredfinedMenuItemType::Fullscreen => Some(Accelerator::new(
PredefinedMenuItemType::Fullscreen => Some(Accelerator::new(
Some(Modifiers::META | Modifiers::CONTROL),
Code::KeyF,
)),
PredfinedMenuItemType::Hide => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyH)),
PredfinedMenuItemType::HideOthers => Some(Accelerator::new(
PredefinedMenuItemType::Hide => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyH)),
PredefinedMenuItemType::HideOthers => Some(Accelerator::new(
Some(CMD_OR_CTRL | Modifiers::ALT),
Code::KeyH,
)),
#[cfg(target_os = "macos")]
PredfinedMenuItemType::CloseWindow => {
PredefinedMenuItemType::CloseWindow => {
Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyW))
}
#[cfg(not(target_os = "macos"))]
PredfinedMenuItemType::CloseWindow => {
PredefinedMenuItemType::CloseWindow => {
Some(Accelerator::new(Some(Modifiers::ALT), Code::F4))
}
#[cfg(target_os = "macos")]
PredfinedMenuItemType::Quit => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyQ)),
PredefinedMenuItemType::Quit => Some(Accelerator::new(Some(CMD_OR_CTRL), Code::KeyQ)),
_ => None,
}
}

View file

@ -32,12 +32,12 @@ macro_rules! return_if_predefined_item_not_supported {
match (&child_.type_, &child_.predefined_item_type) {
(
crate::MenuItemType::Predefined,
PredfinedMenuItemType::Separator
| PredfinedMenuItemType::Copy
| PredfinedMenuItemType::Cut
| PredfinedMenuItemType::Paste
| PredfinedMenuItemType::SelectAll
| PredfinedMenuItemType::About(_),
PredefinedMenuItemType::Separator
| PredefinedMenuItemType::Copy
| PredefinedMenuItemType::Cut
| PredefinedMenuItemType::Paste
| PredefinedMenuItemType::SelectAll
| PredefinedMenuItemType::About(_),
) => {}
(
crate::MenuItemType::Submenu
@ -365,7 +365,7 @@ pub struct MenuChild {
gtk_accelerator: Option<(gdk::ModifierType, u32)>,
// predefined menu item fields
predefined_item_type: PredfinedMenuItemType,
predefined_item_type: PredefinedMenuItemType,
// check menu item fields
checked: Rc<AtomicBool>,
@ -409,7 +409,7 @@ impl MenuChild {
}
}
pub(crate) fn new_predefined(item_type: PredfinedMenuItemType, text: Option<String>) -> Self {
pub(crate) fn new_predefined(item_type: PredefinedMenuItemType, text: Option<String>) -> Self {
Self {
text: text.unwrap_or_else(|| item_type.text().to_string()),
enabled: true,
@ -935,13 +935,13 @@ impl MenuChild {
};
let item = match predefined_item_type {
PredfinedMenuItemType::Separator => {
PredefinedMenuItemType::Separator => {
gtk::SeparatorMenuItem::new().upcast::<gtk::MenuItem>()
}
PredfinedMenuItemType::Copy
| PredfinedMenuItemType::Cut
| PredfinedMenuItemType::Paste
| PredfinedMenuItemType::SelectAll => {
PredefinedMenuItemType::Copy
| PredefinedMenuItemType::Cut
| PredefinedMenuItemType::Paste
| PredefinedMenuItemType::SelectAll => {
let item = make_item();
let (mods, key) =
parse_accelerator(&predefined_item_type.accelerator().unwrap()).unwrap();
@ -959,7 +959,7 @@ impl MenuChild {
});
item
}
PredfinedMenuItemType::About(metadata) => {
PredefinedMenuItemType::About(metadata) => {
let item = make_item();
register_accel(&item);
item.connect_activate(move |_| {
@ -1230,14 +1230,14 @@ fn show_context_menu(
}
}
impl PredfinedMenuItemType {
impl PredefinedMenuItemType {
#[cfg(feature = "libxdo")]
fn xdo_keys(&self) -> &str {
match self {
PredfinedMenuItemType::Copy => "ctrl+c",
PredfinedMenuItemType::Cut => "ctrl+X",
PredfinedMenuItemType::Paste => "ctrl+v",
PredfinedMenuItemType::SelectAll => "ctrl+a",
PredefinedMenuItemType::Copy => "ctrl+c",
PredefinedMenuItemType::Cut => "ctrl+X",
PredefinedMenuItemType::Paste => "ctrl+v",
PredefinedMenuItemType::SelectAll => "ctrl+a",
_ => unreachable!(),
}
}

View file

@ -177,7 +177,7 @@ pub struct MenuChild {
accelerator: Option<Accelerator>,
// predefined menu item fields
predefined_item_type: PredfinedMenuItemType,
predefined_item_type: PredefinedMenuItemType,
// check menu item fields
checked: bool,
@ -236,20 +236,20 @@ impl MenuChild {
}
}
pub(crate) fn new_predefined(item_type: PredfinedMenuItemType, text: Option<String>) -> Self {
pub(crate) fn new_predefined(item_type: PredefinedMenuItemType, text: Option<String>) -> Self {
let text = strip_mnemonic(text.unwrap_or_else(|| {
match item_type {
PredfinedMenuItemType::About(_) => {
PredefinedMenuItemType::About(_) => {
format!("About {}", unsafe { app_name_string() }.unwrap_or_default())
.trim()
.to_string()
}
PredfinedMenuItemType::Hide => {
PredefinedMenuItemType::Hide => {
format!("Hide {}", unsafe { app_name_string() }.unwrap_or_default())
.trim()
.to_string()
}
PredfinedMenuItemType::Quit => {
PredefinedMenuItemType::Quit => {
format!("Quit {}", unsafe { app_name_string() }.unwrap_or_default())
.trim()
.to_string()
@ -611,13 +611,13 @@ impl MenuChild {
pub fn create_ns_item_for_predefined_menu_item(&mut self, menu_id: u32) -> crate::Result<id> {
let item_type = &self.predefined_item_type;
let ns_menu_item = match item_type {
PredfinedMenuItemType::Separator => unsafe {
PredefinedMenuItemType::Separator => unsafe {
NSMenuItem::separatorItem(nil).autorelease()
},
_ => create_ns_menu_item(&self.text, item_type.selector(), &self.accelerator)?,
};
if let PredfinedMenuItemType::About(_) = self.predefined_item_type {
if let PredefinedMenuItemType::About(_) = self.predefined_item_type {
unsafe {
let _: () = msg_send![ns_menu_item, setTarget: ns_menu_item];
let _: () = msg_send![ns_menu_item, setTag:self.id()];
@ -632,7 +632,7 @@ impl MenuChild {
if !self.enabled {
let () = msg_send![ns_menu_item, setEnabled: NO];
}
if let PredfinedMenuItemType::Services = self.predefined_item_type {
if let PredefinedMenuItemType::Services = self.predefined_item_type {
// we have to assign an empty menu as the app's services menu, and macOS will populate it
let services_menu = NSMenu::new(nil).autorelease();
let () = msg_send![NSApp(), setServicesMenu: services_menu];
@ -724,28 +724,28 @@ impl MenuChild {
}
}
impl PredfinedMenuItemType {
impl PredefinedMenuItemType {
pub(crate) fn selector(&self) -> Option<Sel> {
match self {
PredfinedMenuItemType::Separator => None,
PredfinedMenuItemType::Copy => Some(selector("copy:")),
PredfinedMenuItemType::Cut => Some(selector("cut:")),
PredfinedMenuItemType::Paste => Some(selector("paste:")),
PredfinedMenuItemType::SelectAll => Some(selector("selectAll:")),
PredfinedMenuItemType::Undo => Some(selector("undo:")),
PredfinedMenuItemType::Redo => Some(selector("redo:")),
PredfinedMenuItemType::Minimize => Some(selector("performMiniaturize:")),
PredfinedMenuItemType::Maximize => Some(selector("performZoom:")),
PredfinedMenuItemType::Fullscreen => Some(selector("toggleFullScreen:")),
PredfinedMenuItemType::Hide => Some(selector("hide:")),
PredfinedMenuItemType::HideOthers => Some(selector("hideOtherApplications:")),
PredfinedMenuItemType::ShowAll => Some(selector("unhideAllApplications:")),
PredfinedMenuItemType::CloseWindow => Some(selector("performClose:")),
PredfinedMenuItemType::Quit => Some(selector("terminate:")),
PredefinedMenuItemType::Separator => None,
PredefinedMenuItemType::Copy => Some(selector("copy:")),
PredefinedMenuItemType::Cut => Some(selector("cut:")),
PredefinedMenuItemType::Paste => Some(selector("paste:")),
PredefinedMenuItemType::SelectAll => Some(selector("selectAll:")),
PredefinedMenuItemType::Undo => Some(selector("undo:")),
PredefinedMenuItemType::Redo => Some(selector("redo:")),
PredefinedMenuItemType::Minimize => Some(selector("performMiniaturize:")),
PredefinedMenuItemType::Maximize => Some(selector("performZoom:")),
PredefinedMenuItemType::Fullscreen => Some(selector("toggleFullScreen:")),
PredefinedMenuItemType::Hide => Some(selector("hide:")),
PredefinedMenuItemType::HideOthers => Some(selector("hideOtherApplications:")),
PredefinedMenuItemType::ShowAll => Some(selector("unhideAllApplications:")),
PredefinedMenuItemType::CloseWindow => Some(selector("performClose:")),
PredefinedMenuItemType::Quit => Some(selector("terminate:")),
// manual implementation in `fire_menu_item_click`
PredfinedMenuItemType::About(_) => Some(selector("fireMenuItemAction:")),
PredfinedMenuItemType::Services => None,
PredfinedMenuItemType::None => None,
PredefinedMenuItemType::About(_) => Some(selector("fireMenuItemAction:")),
PredefinedMenuItemType::Services => None,
PredefinedMenuItemType::None => None,
}
}
}
@ -838,7 +838,7 @@ extern "C" fn fire_menu_item_click(this: &Object, _: Sel, _item: id) {
let ptr: usize = *this.get_ivar(BLOCK_PTR);
let item = ptr as *mut &mut MenuChild;
if let PredfinedMenuItemType::About(about_meta) = &(*item).predefined_item_type {
if let PredefinedMenuItemType::About(about_meta) = &(*item).predefined_item_type {
match about_meta {
Some(about_meta) => {
unsafe fn mkstr(s: &str) -> id {

View file

@ -11,7 +11,7 @@ pub(crate) use self::icon::WinIcon as PlatformIcon;
use crate::{
accelerator::Accelerator,
icon::{Icon, NativeIcon},
items::PredfinedMenuItemType,
items::PredefinedMenuItemType,
util::{AddOp, Counter},
AboutMetadata, CheckMenuItem, IconMenuItem, IsMenuItem, MenuEvent, MenuItem, MenuItemType,
Position, PredefinedMenuItem, Submenu,
@ -64,8 +64,8 @@ macro_rules! inner_menu_child_and_flags {
let child = &item.0;
let child_ = child.borrow();
match child_.predefined_item_type {
PredfinedMenuItemType::None => return Ok(()),
PredfinedMenuItemType::Separator => {
PredefinedMenuItemType::None => return Ok(()),
PredefinedMenuItemType::Separator => {
flags |= MF_SEPARATOR;
}
_ => {
@ -381,7 +381,7 @@ pub(crate) struct MenuChild {
accelerator: Option<Accelerator>,
// predefined menu item fields
predefined_item_type: PredfinedMenuItemType,
predefined_item_type: PredefinedMenuItemType,
// check menu item fields
checked: bool,
@ -424,7 +424,7 @@ impl MenuChild {
}
}
pub fn new_predefined(item_type: PredfinedMenuItemType, text: Option<String>) -> Self {
pub fn new_predefined(item_type: PredefinedMenuItemType, text: Option<String>) -> Self {
Self {
type_: MenuItemType::Predefined,
text: text.unwrap_or_else(|| item_type.text().to_string()),
@ -943,29 +943,29 @@ unsafe extern "system" fn menu_subclass_proc(
item.set_checked(checked);
}
MenuItemType::Predefined => match &item.predefined_item_type {
PredfinedMenuItemType::Copy => execute_edit_command(EditCommand::Copy),
PredfinedMenuItemType::Cut => execute_edit_command(EditCommand::Cut),
PredfinedMenuItemType::Paste => execute_edit_command(EditCommand::Paste),
PredfinedMenuItemType::SelectAll => {
PredefinedMenuItemType::Copy => execute_edit_command(EditCommand::Copy),
PredefinedMenuItemType::Cut => execute_edit_command(EditCommand::Cut),
PredefinedMenuItemType::Paste => execute_edit_command(EditCommand::Paste),
PredefinedMenuItemType::SelectAll => {
execute_edit_command(EditCommand::SelectAll)
}
PredfinedMenuItemType::Separator => {}
PredfinedMenuItemType::Minimize => {
PredefinedMenuItemType::Separator => {}
PredefinedMenuItemType::Minimize => {
ShowWindow(hwnd, SW_MINIMIZE);
}
PredfinedMenuItemType::Maximize => {
PredefinedMenuItemType::Maximize => {
ShowWindow(hwnd, SW_MAXIMIZE);
}
PredfinedMenuItemType::Hide => {
PredefinedMenuItemType::Hide => {
ShowWindow(hwnd, SW_HIDE);
}
PredfinedMenuItemType::CloseWindow => {
PredefinedMenuItemType::CloseWindow => {
SendMessageW(hwnd, WM_CLOSE, 0, 0);
}
PredfinedMenuItemType::Quit => {
PredefinedMenuItemType::Quit => {
PostQuitMessage(0);
}
PredfinedMenuItemType::About(Some(ref metadata)) => {
PredefinedMenuItemType::About(Some(ref metadata)) => {
show_about_dialog(hwnd, metadata)
}