mirror of https://gitlab.com/basile.b/dexed.git
fix #139 - explorer, add options to control whether the size and the ext columns are visible
This commit is contained in:
parent
340c099fe9
commit
a45e590521
|
@ -22,6 +22,8 @@ type
|
|||
fDblClick: TExplorerDoubleClick;
|
||||
fContextExpand: boolean;
|
||||
fShowHidden: boolean;
|
||||
fShowSize: boolean;
|
||||
fShowType: boolean;
|
||||
fExplorer: TMiniExplorerWidget;
|
||||
function optionedWantCategory(): string;
|
||||
function optionedWantEditorKind: TOptionEditorKind;
|
||||
|
@ -33,6 +35,8 @@ type
|
|||
property doubleClick: TExplorerDoubleClick read fDblClick write fDblClick;
|
||||
property contextExpand: boolean read fContextExpand write fContextExpand;
|
||||
property showHidden: boolean read fShowHidden write fShowHidden default true;
|
||||
property showSize: boolean read fShowSize write fShowSize default true;
|
||||
property showType: boolean read fShowType write fShowType default true;
|
||||
public
|
||||
constructor create(miniexpl: TMiniExplorerWidget);
|
||||
destructor destroy; override;
|
||||
|
@ -48,6 +52,8 @@ type
|
|||
fDblClick: TExplorerDoubleClick;
|
||||
fContextExpand: boolean;
|
||||
fShowHidden: boolean;
|
||||
fShowSize: boolean;
|
||||
fShowType: boolean;
|
||||
procedure setFavoriteFolders(value: TStringList);
|
||||
published
|
||||
property splitter1Position: integer read fSplitter1Position write fSplitter1Position;
|
||||
|
@ -58,6 +64,8 @@ type
|
|||
property doubleClick: TExplorerDoubleClick read fDblClick write fDblClick;
|
||||
property contextExpand: boolean read fContextExpand write fContextExpand;
|
||||
property showHidden: boolean read fShowHidden write fShowHidden default true;
|
||||
property showSize: boolean read fShowSize write fShowSize default true;
|
||||
property showType: boolean read fShowType write fShowType default true;
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
|
@ -96,6 +104,8 @@ type
|
|||
procedure lstFilesDblClick(Sender: TObject);
|
||||
procedure lstFilesEnter(Sender: TObject);
|
||||
procedure lstFilesFileAdded(Sender: TObject; Item: TListItem);
|
||||
procedure lstFilesMouseMove(Sender: TObject; Shift: TShiftState; X,
|
||||
Y: Integer);
|
||||
procedure lstFilterButtonClick(Sender: TObject);
|
||||
procedure lstFilterKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure Splitter2MouseWheel(Sender: TObject; Shift: TShiftState;
|
||||
|
@ -165,6 +175,8 @@ constructor TMiniExplorerEditableOptions.create(miniexpl: TMiniExplorerWidget);
|
|||
begin
|
||||
fExplorer := miniexpl;
|
||||
fShowHidden:=true;
|
||||
fShowSize:=true;
|
||||
fShowType:=true;
|
||||
EntitiesConnector.addObserver(self);
|
||||
end;
|
||||
|
||||
|
@ -188,6 +200,8 @@ begin
|
|||
fExplorer.treeFolders.ObjectTypes := fExplorer.treeFolders.ObjectTypes - [otHidden];
|
||||
fExplorer.lstFiles.ObjectTypes := fExplorer.lstFiles.ObjectTypes - [otHidden];
|
||||
end;
|
||||
fExplorer.lstFiles.Columns[1].Visible := fShowSize;
|
||||
fExplorer.lstFiles.Columns[2].Visible := fShowType;
|
||||
fExplorer.treeFolders.Refresh;
|
||||
end;
|
||||
|
||||
|
@ -223,6 +237,8 @@ begin
|
|||
inherited;
|
||||
fFavoriteFolders := TStringList.Create;
|
||||
fShowHidden:=true;
|
||||
fShowType:=true;
|
||||
fShowSize:=true;
|
||||
end;
|
||||
|
||||
destructor TMiniExplorerOptions.destroy;
|
||||
|
@ -246,6 +262,8 @@ begin
|
|||
fDblClick:= widg.fDblClick;
|
||||
fContextExpand:=widg.fContextExpand;
|
||||
fShowHidden:= otHidden in widg.lstFiles.ObjectTypes;
|
||||
fShowSize := widg.lstFiles.Columns[1].Visible;
|
||||
fShowType := widg.lstFiles.Columns[2].Visible;
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
@ -276,9 +294,11 @@ begin
|
|||
widg.treeFolders.ObjectTypes := widg.treeFolders.ObjectTypes - [otHidden];
|
||||
widg.lstFiles.ObjectTypes := widg.lstFiles.ObjectTypes -[otHidden];
|
||||
end;
|
||||
if fRootFolder.isNotEmpty and fRootFolder.dirExists then
|
||||
widg.lstFiles.Columns[1].Visible := fShowSize;
|
||||
widg.lstFiles.Columns[2].Visible := fShowType;
|
||||
if fRootFolder.isNotEmpty and fRootFolder.dirExists then
|
||||
widg.browse(fRootFolder)
|
||||
else if fLastFolder.isNotEmpty and fLastFolder.dirExists then
|
||||
else if fLastFolder.isNotEmpty and fLastFolder.dirExists then
|
||||
widg.browse(fLastFolder);
|
||||
end
|
||||
else inherited;
|
||||
|
@ -739,6 +759,17 @@ begin
|
|||
lstFiles.Sort;
|
||||
end;
|
||||
|
||||
procedure TMiniExplorerWidget.lstFilesMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
i: TListItem;
|
||||
begin
|
||||
i := lstFiles.GetItemAt(x,y);
|
||||
if i.isAssigned() then
|
||||
begin
|
||||
lstFiles.Hint := i.Caption;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMiniExplorerWidget.lstFilterButtonClick(Sender: TObject);
|
||||
begin
|
||||
filterFiles;
|
||||
|
|
Loading…
Reference in New Issue