mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 04:29:25 +02:00
IDE: Fix logic for switching windows from "Window" menu. Issue #32350, (modified) patch from ptvs.
git-svn-id: trunk@55754 -
This commit is contained in:
parent
af40eadb08
commit
8dd9ef126a
@ -618,24 +618,29 @@ end;
|
||||
// mnuApple: TIDEMenuSection = nil;
|
||||
//{$ENDIF}
|
||||
|
||||
function FormMatchesCmd(aForm: TCustomForm; aCmd: TIDEMenuCommand): Boolean;
|
||||
begin
|
||||
if EnvironmentOptions.Desktop.IDENameForDesignedFormList and IsFormDesign(aForm) then
|
||||
Result := aForm.Name = aCmd.Caption
|
||||
else
|
||||
Result := aForm.Caption = aCmd.Caption;
|
||||
end;
|
||||
|
||||
{ TMainIDEBase }
|
||||
|
||||
procedure TMainIDEBase.mnuWindowItemClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
Form: TCustomForm;
|
||||
nfd: Boolean;
|
||||
begin
|
||||
i:=Screen.CustomFormCount-1;
|
||||
while (i>=0) do begin
|
||||
Form:=Screen.CustomForms[i];
|
||||
nfd := EnvironmentOptions.Desktop.IDENameForDesignedFormList;
|
||||
if (nfd and (Form.Name=(Sender as TIDEMenuCommand).Caption))
|
||||
or ((not nfd) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
|
||||
begin
|
||||
IDEWindowCreators.ShowForm(Form,true);
|
||||
break;
|
||||
end;
|
||||
if FormMatchesCmd(Form, Sender as TIDEMenuCommand) then
|
||||
begin
|
||||
IDEWindowCreators.ShowForm(Form,true);
|
||||
break;
|
||||
end;
|
||||
dec(i);
|
||||
end;
|
||||
end;
|
||||
@ -645,14 +650,11 @@ var
|
||||
i: Integer;
|
||||
Form: TCustomForm;
|
||||
r, NewBounds: TRect;
|
||||
nfd: Boolean;
|
||||
begin
|
||||
i:=Screen.CustomFormCount-1;
|
||||
while (i>=0) do begin
|
||||
Form:=Screen.CustomForms[i];
|
||||
nfd := EnvironmentOptions.Desktop.IDENameForDesignedFormList;
|
||||
if (nfd and (Form.Name=(Sender as TIDEMenuCommand).Caption))
|
||||
or ((not nfd) and (Form.Caption=(Sender as TIDEMenuCommand).Caption)) then
|
||||
if FormMatchesCmd(Form, Sender as TIDEMenuCommand) then
|
||||
begin
|
||||
// show
|
||||
if not Form.IsVisible then
|
||||
|
Loading…
Reference in New Issue
Block a user