#394: fix setting focus on filter panel when activating it

This commit is contained in:
Ansgar Becker
2018-11-28 21:15:46 +01:00
parent 6d4d4e0d97
commit 82254afe45

View File

@@ -10878,15 +10878,13 @@ end;
procedure TMainForm.actFilterPanelExecute(Sender: TObject);
var
MakeVisible: Boolean;
begin
// (De-)activate or focus filter panel
if Sender <> actFilterPanel then
actFilterPanel.Checked := not actFilterPanel.Checked;
pnlFilterVT.Visible := actFilterPanel.Checked;
// On startup, we cannot SetFocus, throws exceptons. Call with nil in that special case - see FormCreate
if Assigned(Sender) and MakeVisible and editFilterVT.CanFocus then
if pnlFilterVT.Visible and editFilterVT.CanFocus and (Sender <> nil) then
editFilterVT.SetFocus;
end;