mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 17:36:12 +02:00
MenuEditor: Update menuitems correctly when adding or removing separators. Patch from BrunoK, issue #37595.
git-svn-id: trunk@63803 -
This commit is contained in:
parent
8b34fff80b
commit
dbe82166d0
@ -2007,9 +2007,14 @@ begin
|
|||||||
if (sepCount > 0) then begin
|
if (sepCount > 0) then begin
|
||||||
FShadowMenu.HideFakes;
|
FShadowMenu.HideFakes;
|
||||||
ShowAllUnSelected;
|
ShowAllUnSelected;
|
||||||
nearestMI:=GetNextNonSepItem(FShadowMenu.SelectedMenuItem);
|
nearestMI:=FShadowMenu.SelectedMenuItem;
|
||||||
if (nearestMI = nil) then
|
if assigned(nearestMI) and nearestMI.IsLine then begin
|
||||||
nearestMI:=GetPreviousNonSepItem(FShadowMenu.SelectedMenuItem);
|
nearestMI:=GetNextNonSepItem(FShadowMenu.SelectedMenuItem);
|
||||||
|
if (nearestMI = nil) then
|
||||||
|
nearestMI:=GetPreviousNonSepItem(FShadowMenu.SelectedMenuItem);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
FShadowMenu.SelectedMenuItem := nil;
|
||||||
if (nearestMI = nil) then
|
if (nearestMI = nil) then
|
||||||
nearestMI:=FParentMenuItem;
|
nearestMI:=FParentMenuItem;
|
||||||
for i:=ParentMenuItem.Count-1 downto 0 do
|
for i:=ParentMenuItem.Count-1 downto 0 do
|
||||||
@ -2030,6 +2035,7 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
FShadowMenu.UpdateBoxLocationsAndSizes;
|
FShadowMenu.UpdateBoxLocationsAndSizes;
|
||||||
FShadowMenu.SetSelectedMenuItem(nearestMI, False, True);
|
FShadowMenu.SetSelectedMenuItem(nearestMI, False, True);
|
||||||
|
LocateShadows;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2042,6 +2048,7 @@ begin
|
|||||||
if (ShadowList.Count = 0) then
|
if (ShadowList.Count = 0) then
|
||||||
Exit;
|
Exit;
|
||||||
FShadowList.Sort(@SortByItemMenuIndex);
|
FShadowList.Sort(@SortByItemMenuIndex);
|
||||||
|
DisableAutoSizing;
|
||||||
if IsMenuBar then begin
|
if IsMenuBar then begin
|
||||||
len:=0;
|
len:=0;
|
||||||
for si in FShadowList do begin
|
for si in FShadowList do begin
|
||||||
@ -2059,6 +2066,7 @@ begin
|
|||||||
Inc(t, h);
|
Inc(t, h);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
EnableAutoSizing;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TShadowBox.CreateWithParentBox(aSMenu: TShadowMenu;
|
constructor TShadowBox.CreateWithParentBox(aSMenu: TShadowMenu;
|
||||||
|
Loading…
Reference in New Issue
Block a user