mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 10:16:17 +02:00
Merge branch 'IDE/Options/SaveLayout' into 'main'
IDE/Options: Remember the window layout when closing via the close button in the window caption See merge request freepascal.org/lazarus/lazarus!423
This commit is contained in:
commit
59bf489735
@ -8,6 +8,7 @@ inherited IDEOptionsDialog: TIDEOptionsDialog
|
||||
Constraints.MinWidth = 500
|
||||
KeyPreview = True
|
||||
Position = poWorkAreaCenter
|
||||
OnClose = FormClose
|
||||
OnKeyDown = FormKeyDown
|
||||
OnShow = FormShow
|
||||
object ButtonPanel: TButtonPanel[0]
|
||||
|
@ -86,6 +86,7 @@ type
|
||||
procedure CategoryTreeExpanded(Sender: TObject; Node: TTreeNode);
|
||||
procedure CategoryTreeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
function FilterEditFilterItem(ItemData: Pointer; out Done: Boolean): Boolean;
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure HelpButtonClick(Sender: TObject);
|
||||
@ -358,6 +359,12 @@ begin
|
||||
Result:=OptEditor.ContainsTextInCaption(FilterEdit.Filter);
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsDialog.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
begin
|
||||
if WindowState <> wsMaximized then
|
||||
IDEDialogLayoutList.SaveLayout(self);
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsDialog.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
// dialog
|
||||
@ -431,12 +438,8 @@ end;
|
||||
|
||||
procedure TIDEOptionsDialog.OkButtonClick(Sender: TObject);
|
||||
begin
|
||||
if not Apply then
|
||||
Exit;
|
||||
// close
|
||||
if WindowState <> wsMaximized then
|
||||
IDEDialogLayoutList.SaveLayout(Self);
|
||||
ModalResult := mrOk;
|
||||
if Apply then
|
||||
ModalResult := mrOk;
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsDialog.CancelButtonClick(Sender: TObject);
|
||||
@ -446,8 +449,6 @@ begin
|
||||
// ToDo: Set build target only for project options.
|
||||
MainBuildBoss.SetBuildTargetProject1;
|
||||
// close
|
||||
if WindowState <> wsMaximized then
|
||||
IDEDialogLayoutList.SaveLayout(Self);
|
||||
ModalResult := mrCancel;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user