FIX: Apply color settings

(cherry picked from commit a5009f63af)
This commit is contained in:
Alexander Koblov 2024-02-13 22:29:18 +03:00
commit a8cac649ba
4 changed files with 29 additions and 4 deletions

View file

@ -44,6 +44,7 @@ type
procedure UpdateAddressLabel;
procedure UpdatePathLabel;
procedure UpdateColor;
procedure UpdateFont;
procedure ShowPathEdit;
@ -272,8 +273,7 @@ begin
FPathLabel := TPathLabel.Create(Self, True);
FPathLabel.Parent := Self;
PathLabelSetColor(FPathLabel);
PathLabelSetColor(FAddressLabel);
UpdateColor;
// Display path below address.
// For correct alignment, first put path at the top, then address at the top.
@ -353,6 +353,12 @@ begin
FPathLabel.Caption := MinimizeFilePath(FFileView.CurrentPath, FPathLabel.Canvas, FPathLabel.Width);
end;
procedure TFileViewHeader.UpdateColor;
begin
PathLabelSetColor(FPathLabel);
PathLabelSetColor(FAddressLabel);
end;
procedure TFileViewHeader.UpdateFont;
begin
FontOptionsToFont(gFonts[dcfPathEdit], FAddressLabel.Font);

View file

@ -567,6 +567,7 @@ end;
procedure TFileViewWithMainCtrl.UpdateColor;
begin
inherited UpdateColor;
MainControl.Color := DimColor(gColors.FilePanel^.BackColor);
end;

View file

@ -61,6 +61,8 @@ type
function AddFileSource(aFileSource: IFileSource; aPath: String): Boolean; override;
function RemoveCurrentFileSource: Boolean; override;
procedure UpdateColor; override;
published
procedure cm_EditPath(const {%H-}Params: array of string);
end;
@ -167,6 +169,11 @@ begin
pnlHeader.UpdateAddressLabel;
end;
procedure TFileViewWithPanels.UpdateColor;
begin
pnlHeader.UpdateColor;
end;
procedure TFileViewWithPanels.ShowPathEdit;
begin
pnlHeader.ShowPathEdit;

View file

@ -7116,11 +7116,22 @@ begin
end;
procedure TfrmMain.AppThemeChange(Sender: TObject);
procedure UpdateNoteBook(NoteBook: TFileViewNotebook);
var
Index: Integer;
begin
for Index := 0 to NoteBook.PageCount - 1 do
begin
NoteBook.View[Index].UpdateColor;
end;
end;
var
Index: Integer;
begin
FrameLeft.UpdateColor;
FrameRight.UpdateColor;
UpdateNoteBook(LeftTabs);
UpdateNoteBook(RightTabs);
ColSet.UpdateStyle;
gColorExt.UpdateStyle;