mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
UPD: simplify BriefFileView/ThumbFileView base on TDisplayFile.DIsplayName
This commit is contained in:
parent
de762d8b8b
commit
e503d554c8
3 changed files with 2 additions and 34 deletions
|
|
@ -474,7 +474,7 @@ var
|
|||
if (gShowIcons <> sim_none) then targetWidth:= targetWidth - gIconsSize - 2;
|
||||
if (not gBriefViewFileExtAligned) or (AFile.FSFile.Extension = '') then
|
||||
begin
|
||||
s:= AFile.DisplayStrings[0];
|
||||
s:= AFile.DisplayName;
|
||||
s:= FitFileName(s, Canvas, AFile.FSFile, targetWidth);
|
||||
end
|
||||
else
|
||||
|
|
@ -509,9 +509,6 @@ begin
|
|||
params.drawingRect:= aRect;
|
||||
params.focused:= (gdSelected in aState) and FBriefView.Active;
|
||||
|
||||
if AFile.DisplayStrings.Count = 0 then
|
||||
FBriefView.MakeColumnsStrings(AFile);
|
||||
|
||||
PrepareColors(aFile, aCol, aRow, aRect, aState);
|
||||
|
||||
iTextTop := aRect.Top + (RowHeights[aRow] - self.calcTextHeight) div 2;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ type
|
|||
procedure UpdateFooterDetails;
|
||||
procedure dgPanelSelection(Sender: TObject; aCol, aRow: Integer);
|
||||
protected
|
||||
procedure MakeColumnsStrings(AFile: TDisplayFile);
|
||||
function GetFileViewGridClass: TFileViewGridClass; virtual; abstract;
|
||||
protected
|
||||
procedure CreateDefault(AOwner: TWinControl); override;
|
||||
|
|
@ -88,7 +87,6 @@ type
|
|||
procedure RedrawFile(DisplayFile: TDisplayFile); override;
|
||||
procedure RedrawFiles; override;
|
||||
procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean; aLastTopRowIndex: PtrInt = -1); override;
|
||||
procedure DoFileUpdated(AFile: TDisplayFile; UpdatedProperties: TFilePropertiesTypes = []); override;
|
||||
procedure DoHandleKeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure UpdateFlatFileName; override;
|
||||
procedure UpdateInfoPanel; override;
|
||||
|
|
@ -544,17 +542,6 @@ begin
|
|||
dgPanel.Invalidate;
|
||||
end;
|
||||
|
||||
procedure TFileViewWithGrid.MakeColumnsStrings(AFile: TDisplayFile);
|
||||
begin
|
||||
AFile.DisplayStrings.BeginUpdate;
|
||||
try
|
||||
AFile.DisplayStrings.Clear;
|
||||
AFile.DisplayStrings.Add(FormatFileFunction('DC().GETFILENAME{}', AFile, FileSource));
|
||||
finally
|
||||
AFile.DisplayStrings.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFileViewWithGrid.RedrawFile(FileIndex: PtrInt);
|
||||
var
|
||||
ACol, ARow: Integer;
|
||||
|
|
@ -711,13 +698,6 @@ var
|
|||
I: Integer;
|
||||
begin
|
||||
inherited Create(AOwner, AFileView, AFlags);
|
||||
|
||||
if (not (AFileView is TFileViewWithGrid)) and Assigned(FAllDisplayFiles) then
|
||||
begin
|
||||
// Update display strings in case FileView type have changed.
|
||||
for I := 0 to FAllDisplayFiles.Count - 1 do
|
||||
MakeColumnsStrings(FAllDisplayFiles[I]);
|
||||
end;
|
||||
TabHeader.UpdateSorting(Sorting);
|
||||
end;
|
||||
|
||||
|
|
@ -877,12 +857,6 @@ begin
|
|||
inherited Create(AOwner, AFileSource, APath, AFlags);
|
||||
end;
|
||||
|
||||
procedure TFileViewWithGrid.DoFileUpdated(AFile: TDisplayFile; UpdatedProperties: TFilePropertiesTypes);
|
||||
begin
|
||||
MakeColumnsStrings(AFile);
|
||||
inherited DoFileUpdated(AFile, UpdatedProperties);
|
||||
end;
|
||||
|
||||
procedure TFileViewWithGrid.DoHandleKeyDown(var Key: Word; Shift: TShiftState);
|
||||
var
|
||||
Index,
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ var
|
|||
iTextTop - gIconsSize - 2
|
||||
);
|
||||
|
||||
s:= AFile.DisplayStrings[0];
|
||||
s:= AFile.DisplayName;
|
||||
s:= FitFileName(s, Canvas, AFile.FSFile, aRect.Width - 4);
|
||||
|
||||
Canvas.TextOut(aRect.Left + 2, iTextTop - 1, s);
|
||||
|
|
@ -579,9 +579,6 @@ begin
|
|||
params.displayFile:= aFile;
|
||||
params.focused:= (gdSelected in aState) and FThumbView.Active;
|
||||
|
||||
if AFile.DisplayStrings.Count = 0 then
|
||||
FThumbView.MakeColumnsStrings(AFile);
|
||||
|
||||
PrepareColors(AFile, aCol, aRow, aRect, aState);
|
||||
|
||||
if gUseFrameCursor then begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue