mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 14:09:31 +02:00
if a Form has default bordericons, it should keep the default bordericons, if the BorderStyle changes (related to issue #1678)
git-svn-id: trunk@8685 -
This commit is contained in:
parent
29a732f8c6
commit
b8f76e44f5
@ -1114,10 +1114,27 @@ end;
|
||||
{ TCustomForm SetFormBorderStyle }
|
||||
{------------------------------------------------------------------------------}
|
||||
procedure TCustomForm.SetFormBorderStyle(NewStyle: TFormBorderStyle);
|
||||
const
|
||||
DefaultBorderIcons : array[TFormBorderStyle] of TBorderIcons =
|
||||
([], // bsNone
|
||||
[biSystemMenu, biMinimize], // bsSingle
|
||||
[biSystemMenu, biMinimize, biMaximize], // bsSizeable
|
||||
[biSystemMenu], // bsDialog
|
||||
[biSystemMenu, biMinimize], // bsToolWindow
|
||||
[biSystemMenu, biMinimize, biMaximize]); // bsSizeToolWin
|
||||
var
|
||||
AdaptBorderIcons: boolean;
|
||||
begin
|
||||
if FFormBorderStyle = NewStyle then exit;
|
||||
//TODO: Finish SETBORDERSTYLE
|
||||
AdaptBorderIcons := not (csLoading in ComponentState) and
|
||||
(BorderIcons=DefaultBorderIcons[FFormBorderStyle]);
|
||||
FFormBorderStyle := NewStyle;
|
||||
|
||||
// if Form had default border icons before change, it should keep the default
|
||||
if AdaptBorderIcons then
|
||||
BorderIcons := DefaultBorderIcons[FFormBorderStyle];
|
||||
|
||||
Include(FFormState,fsBorderStyleChanged);
|
||||
// ToDo: implement it.
|
||||
// We can not use inherited SetBorderStyle(NewStyle),
|
||||
|
Loading…
Reference in New Issue
Block a user