mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 06:39:26 +02:00
IDEIntf: fixed TIDEMenuSection.Visible keeping Visible of children, bug #31970
git-svn-id: trunk@55259 -
This commit is contained in:
parent
b3dd2c09cb
commit
014156ee09
@ -553,16 +553,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TIDEMenuItem.RealVisible: boolean;
|
function TIDEMenuItem.RealVisible: boolean;
|
||||||
var
|
|
||||||
aSection: TIDEMenuSection;
|
|
||||||
begin
|
begin
|
||||||
Result := Visible;
|
Result := VisibleActive;
|
||||||
aSection := Section;
|
if Result and (Section<>nil) then
|
||||||
while (aSection<>nil) and Result do
|
Result:=Section.RealVisible;
|
||||||
begin
|
|
||||||
Result := aSection.Visible;
|
|
||||||
aSection := aSection.Section;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEMenuItem.BitmapChange(Sender: TObject);
|
procedure TIDEMenuItem.BitmapChange(Sender: TObject);
|
||||||
@ -573,7 +567,7 @@ end;
|
|||||||
procedure TIDEMenuItem.RealizeVisible;
|
procedure TIDEMenuItem.RealizeVisible;
|
||||||
begin
|
begin
|
||||||
if MenuItem=nil then exit;
|
if MenuItem=nil then exit;
|
||||||
MenuItem.Visible:=VisibleActive
|
MenuItem.Visible:=RealVisible
|
||||||
or (Section=nil); // keep the root menuitem always visible
|
or (Section=nil); // keep the root menuitem always visible
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -943,8 +937,8 @@ begin
|
|||||||
// ', ImageIndex=', ImageIndex, ', ImageList=', GetImageList]);
|
// ', ImageIndex=', ImageIndex, ', ImageList=', GetImageList]);
|
||||||
if MenuItem.Enabled<>Enabled then
|
if MenuItem.Enabled<>Enabled then
|
||||||
RaiseError('MenuItem.Enabled='+dbgs(MenuItem.Enabled)+' Enabled='+dbgs(Enabled));
|
RaiseError('MenuItem.Enabled='+dbgs(MenuItem.Enabled)+' Enabled='+dbgs(Enabled));
|
||||||
if MenuItem.Visible<>(VisibleActive or (Section=nil)) then
|
if MenuItem.Visible<>(RealVisible or (Section=nil)) then
|
||||||
RaiseError('MenuItem.Visible='+dbgs(MenuItem.Visible)+' VisibleActive='+dbgs(VisibleActive)+' Visible='+dbgs(Visible));
|
RaiseError('MenuItem.Visible='+dbgs(MenuItem.Visible)+' VisibleActive='+dbgs(VisibleActive)+' Visible='+dbgs(Visible)+' RealVisible='+dbgs(RealVisible));
|
||||||
if MenuItem.Caption<>Caption then
|
if MenuItem.Caption<>Caption then
|
||||||
RaiseError;
|
RaiseError;
|
||||||
if MenuItem.ImageIndex<>ImageIndex then
|
if MenuItem.ImageIndex<>ImageIndex then
|
||||||
@ -1090,7 +1084,8 @@ var
|
|||||||
then begin
|
then begin
|
||||||
// already in place -> ok
|
// already in place -> ok
|
||||||
inc(aMenuIndex);
|
inc(aMenuIndex);
|
||||||
Item.Visible:=aVisible;
|
// update MenuItem.Visible here for less overhead
|
||||||
|
Item.MenuItem.Visible:=Item.RealVisible;
|
||||||
end else begin
|
end else begin
|
||||||
// structure has changed
|
// structure has changed
|
||||||
if Item.MenuItem<>nil then
|
if Item.MenuItem<>nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user