mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:01:06 +02:00
lcl:
- skip forms which does not share application taskbar item from TApplication.UpdateVisible (bug #0013042) - don't perform any visual actions when we change ShowInTaskBar property in the design time git-svn-id: trunk@18445 -
This commit is contained in:
parent
799d3a721f
commit
cf4f433100
@ -825,22 +825,31 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TApplication.UpdateVisible;
|
||||
|
||||
function UseAppTaskbarItem(AForm: TCustomForm): Boolean; inline;
|
||||
begin
|
||||
Result := (AForm = MainForm) or (AForm.ShowInTaskBar in [stNever, stDefault]);
|
||||
end;
|
||||
|
||||
function HasVisibleForms: Boolean;
|
||||
var
|
||||
i: integer;
|
||||
AForm: TCustomForm;
|
||||
begin
|
||||
Result := False;
|
||||
for i := 0 to Screen.CustomFormCount - 1 do
|
||||
if Screen.CustomForms[i].Visible and (Screen.CustomForms[i].Parent = nil) then
|
||||
begin
|
||||
AForm := Screen.CustomForms[i];
|
||||
if AForm.Visible and (AForm.Parent = nil) and UseAppTaskbarItem(AForm) then
|
||||
begin
|
||||
Result := True;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
// if there are visible forms then application task bar item must be visible too
|
||||
// else hide it
|
||||
// if there are visible forms wich shares application taskbar item then application
|
||||
// task bar item must be visible too else hide it
|
||||
WidgetSet.AppSetVisible(HasVisibleForms);
|
||||
end;
|
||||
|
||||
|
@ -1418,7 +1418,7 @@ procedure TCustomForm.SetShowInTaskbar(Value: TShowInTaskbar);
|
||||
begin
|
||||
if Value = FShowInTaskbar then exit;
|
||||
FShowInTaskbar := Value;
|
||||
if HandleAllocated then
|
||||
if not (csDesigning in ComponentState) and HandleAllocated then
|
||||
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user