Permalink
Browse files

Fix randomly wrong state of filter panel menu item. Closes #394.

  • Loading branch information...
ansgarbecker committed Nov 28, 2018
1 parent b6a1fc2 commit 32982384911c3a5c573e18c3179df67760443bc1
Showing with 5 additions and 5 deletions.
  1. +1 −1 source/apphelpers.pas
  2. +4 −4 source/main.pas
@@ -3717,7 +3717,7 @@ constructor TAppSettings.Create;
InitSetting(asCompletionProposalNbLinesInWindow,'CompletionProposalNbLinesInWindow', 12);
InitSetting(asAutoUppercase, 'AutoUppercase', 0, True);
InitSetting(asTabsToSpaces, 'TabsToSpaces', 0, False);
InitSetting(asFilterPanel, 'FilterPanel', 0, False);
InitSetting(asFilterPanel, 'FilterPanel', 0, True);
InitSetting(asAllowMultipleInstances, 'AllowMultipleInstances', 0, True);
InitSetting(asFindDialogSearchHistory, 'FindDialogSearchHistory', 0, False, '');
InitSetting(asFindDialogReplaceHistory, 'FindDialogReplaceHistory', 0, False, '');
@@ -1536,7 +1536,7 @@ procedure TMainForm.FormDestroy(Sender: TObject);
AppSettings.WriteInt(asDataPreviewHeight, pnlPreview.Height);
AppSettings.WriteBool(asDataPreviewEnabled, actDataPreview.Checked);
AppSettings.WriteInt(asLogHeight, SynMemoSQLLog.Height);
AppSettings.WriteBool(asFilterPanel, pnlFilterVT.Tag=Integer(True));
AppSettings.WriteBool(asFilterPanel, actFilterPanel.Checked);
AppSettings.WriteBool(asWrapLongLines, actQueryWordWrap.Checked);
AppSettings.WriteBool(asSingleQueries, actSingleQueries.Checked);
AppSettings.WriteBool(asLogHorizontalScrollbar, actLogHorizontalScrollbar.Checked);
@@ -10880,9 +10880,9 @@ procedure TMainForm.actFilterPanelExecute(Sender: TObject);
MakeVisible: Boolean;
begin
// (De-)activate or focus filter panel
MakeVisible := Sender <> btnCloseFilterPanel;
pnlFilterVT.Visible := MakeVisible;
pnlFilterVT.Tag := Integer(MakeVisible);
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
editFilterVT.SetFocus;

0 comments on commit 3298238

Please sign in to comment.