mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-12 22:52:33 +02:00
IDE: Remember selection after moving an item in package editor. Issue #40135.
This commit is contained in:
parent
59babefde7
commit
c8419bca6d
@ -398,8 +398,10 @@ end;
|
|||||||
|
|
||||||
procedure TTreeFilterBranch.Move(CurIndex, NewIndex: integer);
|
procedure TTreeFilterBranch.Move(CurIndex, NewIndex: integer);
|
||||||
begin
|
begin
|
||||||
|
fOwner.StoreSelection;
|
||||||
fOriginalData.Move(CurIndex, NewIndex);
|
fOriginalData.Move(CurIndex, NewIndex);
|
||||||
InvalidateBranch;
|
InvalidateBranch;
|
||||||
|
fOwner.RestoreSelection;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFileNameItem }
|
{ TFileNameItem }
|
||||||
@ -562,7 +564,7 @@ begin
|
|||||||
SelectNode:=Nil;
|
SelectNode:=Nil;
|
||||||
// ToDo: support more than one items or otherwise clean the code.
|
// ToDo: support more than one items or otherwise clean the code.
|
||||||
Assert(fSelectionList.Count < 2,
|
Assert(fSelectionList.Count < 2,
|
||||||
'TTreeFilterEdit.RestoreSelection: fSelectionList has more than one items.');
|
'TTreeFilterEdit.RestoreSelection: fSelectionList has more than one item.');
|
||||||
if fSelectionList.Count > 0 then
|
if fSelectionList.Count > 0 then
|
||||||
begin
|
begin
|
||||||
CurText:=fSelectionList[0];
|
CurText:=fSelectionList[0];
|
||||||
|
@ -2478,7 +2478,8 @@ begin
|
|||||||
FPropGui.SetDisableI18NCB(SelDisableI18NForLFM);
|
FPropGui.SetDisableI18NCB(SelDisableI18NForLFM);
|
||||||
|
|
||||||
// move up/down (only single selection)
|
// move up/down (only single selection)
|
||||||
aVisible:=(not (SortAlphabetically or SingleSelectedRemoved))
|
aVisible := (FilterEdit.Filter='')
|
||||||
|
and (not (SortAlphabetically or SingleSelectedRemoved))
|
||||||
and ((SingleSelectedFile<>nil) or (SingleSelectedDep<>nil));
|
and ((SingleSelectedFile<>nil) or (SingleSelectedDep<>nil));
|
||||||
MoveUpBtn.Enabled :=aVisible and Assigned(SingleSelectedNode.GetPrevVisibleSibling);
|
MoveUpBtn.Enabled :=aVisible and Assigned(SingleSelectedNode.GetPrevVisibleSibling);
|
||||||
MoveDownBtn.Enabled:=aVisible and Assigned(SingleSelectedNode.GetNextVisibleSibling);
|
MoveDownBtn.Enabled:=aVisible and Assigned(SingleSelectedNode.GetNextVisibleSibling);
|
||||||
@ -2989,7 +2990,6 @@ begin
|
|||||||
FilesBranch.Move(OldIndex,NewIndex);
|
FilesBranch.Move(OldIndex,NewIndex);
|
||||||
UpdatePEProperties;
|
UpdatePEProperties;
|
||||||
UpdateStatusBar;
|
UpdateStatusBar;
|
||||||
//FilterEdit.InvalidateFilter;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.DoMoveDependency(Offset: integer);
|
procedure TPackageEditorForm.DoMoveDependency(Offset: integer);
|
||||||
@ -3012,7 +3012,6 @@ begin
|
|||||||
RequiredBranch.Move(OldIndex,NewIndex);
|
RequiredBranch.Move(OldIndex,NewIndex);
|
||||||
UpdatePEProperties;
|
UpdatePEProperties;
|
||||||
UpdateStatusBar;
|
UpdateStatusBar;
|
||||||
//FilterEdit.InvalidateFilter;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.DoSortFiles;
|
procedure TPackageEditorForm.DoSortFiles;
|
||||||
|
Loading…
Reference in New Issue
Block a user