UPD: disable minimize button in Modeless Form on macOS

on macOS, it's inconvenient to restore minimized non-MainForms, and they're easily forgotten.
it's more convenient to switch between the forms by Command+`, rather than minimizing them.
This commit is contained in:
rich2014 2026-05-12 09:31:41 +08:00
commit be400728aa
6 changed files with 19 additions and 0 deletions

View file

@ -738,6 +738,9 @@ begin
if (ListOffrmFindDlgInstance.Count = 0) then
Application.AddOnKeyDownBeforeHandler(@FormKeyDown);
{$ENDIF}
{$IFDEF DARWIN}
self.BorderIcons:= self.BorderIcons - [biMinimize];
{$ENDIF}
end;
{ TfrmFindDlg.cbUsePluginChange }

View file

@ -849,6 +849,10 @@ begin
FillEncodingMenu(pmEncodingLeft.Items, @SetEncodingLeft, 1);
FillEncodingMenu(pmEncodingRight.Items, @SetEncodingRight, 2);
EncodingList.Free;
{$IFDEF DARWIN}
self.BorderIcons:= self.BorderIcons - [biMinimize];
{$ENDIF}
end;
procedure TfrmDiffer.FormDestroy(Sender: TObject);

View file

@ -373,6 +373,10 @@ begin
FCommands := TFormCommands.Create(Self, ActListEdit);
FMultiCaret := TSynPluginMultiCaret.Create(Editor);
{$IFDEF DARWIN}
self.BorderIcons:= self.BorderIcons - [biMinimize];
{$ENDIF}
end;
procedure TfrmEditor.LoadGlobalOptions;

View file

@ -213,6 +213,9 @@ begin
// Initialize property storage
InitPropStorage(Self);
TreeFilterEdit.Visible:= (OptionsSearchCache.Count > 0);
{$IFDEF DARWIN}
self.BorderIcons:= self.BorderIcons - [biMinimize];
{$ENDIF}
end;
procedure TfrmOptions.FormClose(Sender: TObject; var CloseAction: TCloseAction);

View file

@ -968,6 +968,10 @@ begin
HMSync := HotMan.Register(Self, HotkeysCategory);
HMSync.RegisterActionList(ActionList);
FCommands := TFormCommands.Create(Self, ActionList);
{$IFDEF DARWIN}
self.BorderIcons:= self.BorderIcons - [biMinimize];
{$ENDIF}
end;
procedure TfrmSyncDirsDlg.FormResize(Sender: TObject);

View file

@ -2564,6 +2564,7 @@ begin
GraphicFilter(TPortableAnyMapGraphic);
{$IFDEF DARWIN}
self.BorderIcons:= self.BorderIcons - [biMinimize];
self.OnWindowStateChange:= @self.FormWindowStateChange;
{$ENDIF}
end;