Skip to content

Commit

Permalink
change caption of the form and app title when searching
Browse files Browse the repository at this point in the history
  • Loading branch information
FRex committed Feb 1, 2024
1 parent 54b9d06 commit abf0615
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mainunit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ TForm1 = class(TForm)
FAllTagCount, FSelectedTagCount: integer;
FUndoCloseTabHistory: array [0..UndoCloseTabHistoryMaxSize] of string;
FUndoCloseTabHistoryUsed: integer;
FBaseTitle: string;

procedure CollectAllTags;
procedure FilterTextByAwesomeBar;
Expand Down Expand Up @@ -326,6 +327,7 @@ procedure TForm1.FormCreate(Sender: TObject);
begin
WindowState := wsMaximized;

FBaseTitle := Caption;
FAllLines := TStringList.Create;
FAllLines.LineBreak := #10;
FDiscardedLines := TStringList.Create;
Expand Down Expand Up @@ -836,9 +838,14 @@ procedure TForm1.AwesomeBarChange(Sender: TObject);
FDiscardedLines.Clear;
TextEditor.Lines.Assign(FAllLines);
alllines := True;
Caption := FBaseTitle;
end
else
begin
Caption := FBaseTitle + ' - ' + AwesomeBar.Text;
Application.Title := Caption;
FilterTextByAwesomeBar;
end;

tmp := Format('Lines: %d/%d', [TextEditor.Lines.Count, FAllLines.Count]);
StatusBar.Panels[LineCountPanel].Text := tmp;
Expand Down

0 comments on commit abf0615

Please sign in to comment.