IDE, SourceEditor: prevent ShowAloneMenu inside normal menu. Issue #40161 and #39540

This commit is contained in:
Martin 2023-04-27 17:34:06 +02:00
parent 491800a694
commit 405b9d2a29

View File

@ -1728,8 +1728,7 @@ begin
// register the Goto Bookmarks Submenu
SrcEditSubMenuGotoBookmarks:=RegisterIDESubMenu(AParent,
'Goto bookmarks', uemGotoBookmark,
nil, TNotifyProcedure(@TToolButton_GotoBookmarks.ShowAloneMenu),
'menu_goto_bookmarks');
nil, nil, 'menu_goto_bookmarks');
AParent:=SrcEditSubMenuGotoBookmarks;
for I in TBookmarkNumRange do
SrcEditMenuGotoBookmark[I]:=RegisterIDEMenuCommand(AParent,
@ -1750,8 +1749,7 @@ begin
AParent:=SrcEditMenuSectionMarks;
SrcEditSubMenuToggleBookmarks:=RegisterIDESubMenu(AParent,
'Toggle bookmarks', uemToggleBookmark,
nil, TNotifyProcedure(@TToolButton_ToggleBookmarks.ShowAloneMenu),
'menu_toggle_bookmarks');
nil, nil, 'menu_toggle_bookmarks');
AParent:=SrcEditSubMenuToggleBookmarks;
for I in TBookmarkNumRange do
SrcEditMenuToggleBookmark[I]:=RegisterIDEMenuCommand(AParent,
@ -4283,6 +4281,9 @@ Begin
ecCloseOtherTabs: Application.QueueAsyncCall(@Manager.CloseOtherPagesClickedAsync, PtrInt(SourceNotebook.GetNoteBookPage(SourceNotebook.FindPageWithEditor(Self))));
ecCloseRightTabs: Application.QueueAsyncCall(@Manager.CloseRightPagesClickedAsync, PtrInt(SourceNotebook.GetNoteBookPage(SourceNotebook.FindPageWithEditor(Self))));
ecGotoBookmarks: TToolButton_GotoBookmarks.ShowAloneMenu(nil);
ecToggleBookmarks: TToolButton_ToggleBookmarks.ShowAloneMenu(nil);
else
begin
Handled:=false;