mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 01:08:12 +02:00
IDE In search results window, do not expand nodes when switching tabs. Issue #41259.
This commit is contained in:
parent
e1aff780f0
commit
d326f3e9e7
@ -82,8 +82,8 @@ type
|
||||
fFirstPassedNode: TTreeNode;
|
||||
fOnGetImageIndex: TImageIndexEvent;
|
||||
fOnFilterNode: TFilterNodeEvent;
|
||||
procedure SetFilteredTreeview(const AValue: TCustomTreeview);
|
||||
procedure SetShowDirHierarchy(const AValue: Boolean);
|
||||
procedure SetFilteredTreeview(AValue: TCustomTreeview);
|
||||
procedure SetShowDirHierarchy(AValue: Boolean);
|
||||
function FilterTree(Node: TTreeNode): Boolean;
|
||||
procedure OnBeforeTreeDestroy(Sender: TObject);
|
||||
protected
|
||||
@ -102,6 +102,7 @@ type
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
procedure SetTreeFilterSilently(ATree: TCustomTreeview; AFilter: string);
|
||||
procedure StoreSelection; override;
|
||||
procedure RestoreSelection; override;
|
||||
function GetExistingBranch(ARootNode: TTreeNode): TTreeFilterBranch;
|
||||
@ -446,7 +447,7 @@ begin
|
||||
FreeAndNil(fBranches);
|
||||
end;
|
||||
|
||||
procedure TTreeFilterEdit.SetFilteredTreeview(const AValue: TCustomTreeview);
|
||||
procedure TTreeFilterEdit.SetFilteredTreeview(AValue: TCustomTreeview);
|
||||
begin
|
||||
if fFilteredTreeview = AValue then Exit;
|
||||
if fFilteredTreeview <> nil then
|
||||
@ -463,7 +464,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTreeFilterEdit.SetShowDirHierarchy(const AValue: Boolean);
|
||||
procedure TTreeFilterEdit.SetTreeFilterSilently(ATree: TCustomTreeview; AFilter: string);
|
||||
begin // The tree is already filtered, the same FilterEdit is used for many.
|
||||
fAlreadyFiltered:=True;
|
||||
SetFilteredTreeview(ATree);
|
||||
InternalSetFilter(AFilter);
|
||||
fAlreadyFiltered:=False;
|
||||
Text:=AFilter; // This will trigger filtering if Text differs from AFilter.
|
||||
end;
|
||||
|
||||
procedure TTreeFilterEdit.SetShowDirHierarchy(AValue: Boolean);
|
||||
begin
|
||||
if fShowDirHierarchy=AValue then exit;
|
||||
if not Assigned(fFilteredTreeview) then
|
||||
|
@ -10,9 +10,9 @@ object SearchResultsView: TSearchResultsView
|
||||
Constraints.MinHeight = 100
|
||||
Constraints.MinWidth = 400
|
||||
KeyPreview = True
|
||||
LCLVersion = '4.99.0.0'
|
||||
OnCreate = Form1Create
|
||||
OnKeyDown = FormKeyDown
|
||||
LCLVersion = '2.3.0.0'
|
||||
object ControlBar1: TPanel
|
||||
Left = 0
|
||||
Height = 26
|
||||
|
@ -798,8 +798,7 @@ begin
|
||||
lTree := GetCurrentTree;
|
||||
if assigned(lTree) and not (csDestroying in lTree.ComponentState) then
|
||||
begin
|
||||
SearchInListEdit.FilteredTreeview := lTree;
|
||||
SearchInListEdit.Filter := lTree.SearchInListPhrases;
|
||||
SearchInListEdit.SetTreeFilterSilently(lTree, lTree.SearchInListPhrases);
|
||||
if FFocusTreeViewInOnChange then
|
||||
ActivateControl(lTree);
|
||||
end;
|
||||
|
@ -241,8 +241,9 @@ type
|
||||
procedure OnAsync(Data: PtrInt);
|
||||
function IsTextHintStored: Boolean;
|
||||
protected
|
||||
fNeedUpdate: Boolean;
|
||||
fAlreadyFiltered: Boolean;
|
||||
fIsFirstUpdate: Boolean;
|
||||
fNeedUpdate: Boolean;
|
||||
fSelectedPart: TObject; // Select this node on next update
|
||||
fOnFilterItem: TFilterItemEvent;
|
||||
fOnFilterItemEx: TFilterItemExEvent;
|
||||
@ -1348,6 +1349,7 @@ end;
|
||||
|
||||
procedure TCustomControlFilterEdit.InvalidateFilter;
|
||||
begin
|
||||
if fAlreadyFiltered then Exit;
|
||||
fNeedUpdate:=true;
|
||||
IdleConnected:=true;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user