Merged revision(s) 54809 #25429f9352 from trunk:

MenuDesigner: Fixed adding a line separator at last position. Issue #31744
........

git-svn-id: branches/fixes_1_8@54867 -
This commit is contained in:
maxim 2017-05-10 22:43:16 +00:00
parent 770d44fcaa
commit 010812080b

View File

@ -1675,7 +1675,7 @@ procedure TShadowMenu.UpdateActionsEnabledness;
var
ac, ac1, ac2, ac3: TAction;
pe: TPopEnum;
isInBar, isFirst, isLast, prevIsSeparator, nextIsSeparator,
isInBar, isFirst, isSeparator, isLast, prevIsSeparator, nextIsSeparator,
levelZero, levelZeroOr1, primarySCEnabled: boolean;
begin
if (FSelectedMenuItem = nil) then
@ -1683,6 +1683,7 @@ begin
isInBar:=FSelectedMenuItem.IsInMenuBar;
isFirst:=(FSelectedMenuItem.MenuIndex = 0);
isLast:=(FSelectedMenuItem.MenuIndex = Pred(FSelectedMenuItem.Parent.Count));
isSeparator:=FSelectedMenuItem.IsLine;
prevIsSeparator:=PreviousItemIsSeparator(FSelectedMenuItem);
nextIsSeparator:=NextItemIsSeparator(FSelectedMenuItem);
levelZero:=(FSelectedMenuItem.Parent <> nil) and (FSelectedMenuItem.Parent.Parent = nil);
@ -1763,9 +1764,9 @@ begin
//popItemSep
popSeparators_: ac.Enabled:=primarySCEnabled;
popAddSeparatorBefore:
ac.Enabled:=primarySCEnabled and not isFirst and not prevIsSeparator;
ac.Enabled:=primarySCEnabled and not isSeparator and not isFirst and not prevIsSeparator;
popAddSeparatorAfter:
ac.Enabled:=primarySCEnabled and not isLast and not nextIsSeparator;
ac.Enabled:=not isInBar and not isSeparator and not nextIsSeparator;
popRemoveAllSeparators:
ac.Enabled:=primarySCEnabled and (GetChildSeparatorCount(FSelectedMenuItem.Parent) > 0);
//popShortcuts_