From 22d7da3ff8cb9df302d9f6dd103cf53b2c8e8307 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 13 Jun 2021 12:11:08 +0200 Subject: [PATCH] Performance: call RefreshBackgroundColors only during RefreshSessions and btnSaveClick, not in ListSessionsFocusChanged --- source/connections.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/connections.pas b/source/connections.pas index 30db736b..4af75a11 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -335,6 +335,8 @@ begin RefreshSessions(SessNode); end; end; + if not Assigned(ParentNode) then + RefreshBackgroundColors; end; @@ -494,6 +496,7 @@ begin FSessionModified := False; ListSessions.Invalidate; + RefreshBackgroundColors; ValidateControls; // Apply session color (and othher settings) to opened connection(s) @@ -972,7 +975,6 @@ begin updownKeepAlive.Position := Sess.KeepAlive; chkLocalTimeZone.Checked := Sess.LocalTimeZone; chkFullTableStatus.Checked := Sess.FullTableStatus; - RefreshBackgroundColors; ColorBoxBackgroundColor.Selected := Sess.SessionColor; editDatabases.Text := Sess.AllDatabasesStr; comboLibrary.Items := Sess.GetLibraries;