mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
#11756 hide additional menu items in edit menu on Mac
Mac OS adds two extra menu entries to the edit menu. These menu items are: 1. Start Dictation... 2. Emoji & Symbols Both menu items don't work with LyX. Therefore they shouldn't be present and the new code hides them.
This commit is contained in:
parent
784139da50
commit
1c5a2fc0ec
@ -78,6 +78,7 @@
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "support/AppleScript.h"
|
||||
#include "support/AppleSupport.h"
|
||||
#include "support/linkback/LinkBackProxy.h"
|
||||
#endif
|
||||
|
||||
@ -1032,6 +1033,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
|
||||
setQuitOnLastWindowClosed(false);
|
||||
///
|
||||
setupApplescript();
|
||||
appleCleanupEditMenu();
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_X11) || defined(QPA_XCB)
|
||||
|
23
src/support/AppleSupport.h
Normal file
23
src/support/AppleSupport.h
Normal file
@ -0,0 +1,23 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file AppleSupport.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Stephan Witt
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#ifndef LYX_SUPPORT_APPLESUPPORT_H
|
||||
#define LYX_SUPPORT_APPLESUPPORT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void appleCleanupEditMenu();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
23
src/support/AppleSupport.m
Normal file
23
src/support/AppleSupport.m
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* \file AppleSupport.m
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Stephan Witt
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include "AppleSupport.h"
|
||||
|
||||
|
||||
void appleCleanupEditMenu() {
|
||||
|
||||
// Remove (disable) the "Start Dictation..." and "Emoji & Symbols" menu items
|
||||
// from the "Edit" menu
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledCharacterPaletteMenuItem"];
|
||||
|
||||
}
|
@ -12,6 +12,7 @@ list(REMOVE_ITEM support_sources ${moc_files} .)
|
||||
if(APPLE)
|
||||
list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleSpeller.m)
|
||||
list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleScript.m)
|
||||
list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleSupport.m)
|
||||
else()
|
||||
list(REMOVE_ITEM support_sources "${TOP_SRC_DIR}/src/support/AppleScriptProxy.cpp")
|
||||
endif()
|
||||
|
@ -129,6 +129,8 @@ liblyxsupport_a_SOURCES += \
|
||||
AppleScript.h \
|
||||
AppleScript.m \
|
||||
AppleScriptProxy.cpp \
|
||||
AppleSupport.h \
|
||||
AppleSupport.m \
|
||||
linkback/LinkBack.h \
|
||||
linkback/LinkBack.m \
|
||||
linkback/LinkBackProxy.h \
|
||||
|
Loading…
Reference in New Issue
Block a user