mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: hint in TFileViewHeader improved
This commit is contained in:
parent
623358eb14
commit
421417a09b
1 changed files with 21 additions and 4 deletions
|
|
@ -32,6 +32,8 @@ type
|
|||
procedure PathLabelMouseWheelUp(Sender: TObject;Shift: TShiftState; MousePos: TPoint;var Handled:Boolean);
|
||||
procedure PathLabelMouseWheelDown(Sender: TObject;Shift: TShiftState; MousePos: TPoint;var Handled:Boolean);
|
||||
|
||||
procedure HeaderShowHint(Sender: TObject; HintInfo: PHintInfo);
|
||||
|
||||
procedure EachViewUpdateHeader(AFileView: TFileView; {%H-}UserData: Pointer);
|
||||
|
||||
protected
|
||||
|
|
@ -286,22 +288,24 @@ begin
|
|||
FPathEdit.ObjectTypes:= [otFolders, otHidden];
|
||||
|
||||
OnResize:= @HeaderResize;
|
||||
OnShowHint:=@HeaderShowHint;
|
||||
|
||||
FPathEdit.OnExit:= @PathEditExit;
|
||||
FPathEdit.onKeyESCAPE:=@onKeyESCAPE;
|
||||
FPathEdit.onKeyRETURN:=@onKeyRETURN;
|
||||
FPathEdit.OnShowHint:=@HeaderShowHint;
|
||||
|
||||
FPathLabel.OnClick := @PathLabelClick;
|
||||
FPathLabel.OnDblClick := @PathLabelDblClick;
|
||||
FPathLabel.OnMouseUp := @PathLabelMouseUp;
|
||||
|
||||
FPathLabel.OnMouseWheelDown := @PathLabelMouseWheelDown;
|
||||
FPathLabel.OnMouseWheelUp := @PathLabelMouseWheelUp;
|
||||
|
||||
FPathLabel.OnShowHint:=@HeaderShowHint;
|
||||
|
||||
FAddressLabel.OnClick := @AddressLabelClick;
|
||||
FAddressLabel.OnMouseEnter:= @AddressLabelMouseEnter;
|
||||
|
||||
FAddressLabel.OnShowHint:=@HeaderShowHint;
|
||||
|
||||
tmViewHistoryMenu := TTimer.Create(Self); //Timer used to show history after a while in case it was not a double click to show Hot dir
|
||||
tmViewHistoryMenu.Enabled := False;
|
||||
tmViewHistoryMenu.Interval := 250;
|
||||
|
|
@ -316,6 +320,20 @@ begin
|
|||
UpdatePathLabel;
|
||||
end;
|
||||
|
||||
// 1. in most cases, as not to bother users,
|
||||
// the Header does not need to show hint,
|
||||
// 2. so set hint to the full path, only when the path in PathLabel is shortened
|
||||
// due to insufficient width
|
||||
procedure TFileViewHeader.HeaderShowHint(Sender: TObject; HintInfo: PHintInfo);
|
||||
begin
|
||||
HintInfo^.HintStr := '';
|
||||
if FFileView.CurrentAddress<>'' then
|
||||
exit;
|
||||
|
||||
if IncludeTrailingPathDelimiter(FPathLabel.Caption) <> FFileView.CurrentPath then
|
||||
HintInfo^.HintStr := FFileView.CurrentPath;
|
||||
end;
|
||||
|
||||
procedure TFileViewHeader.UpdateAddressLabel;
|
||||
begin
|
||||
if FFileView.CurrentAddress = '' then
|
||||
|
|
@ -333,7 +351,6 @@ end;
|
|||
procedure TFileViewHeader.UpdatePathLabel;
|
||||
begin
|
||||
FPathLabel.Caption := MinimizeFilePath(FFileView.CurrentPath, FPathLabel.Canvas, FPathLabel.Width);
|
||||
FPathLabel.Hint := FFileView.CurrentPath;
|
||||
end;
|
||||
|
||||
procedure TFileViewHeader.UpdateFont;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue