PackageTabs: Improve visibility of selected editor tab. Issue #41132, patch by Maxim Ganetsky.

(cherry picked from commit 930797ee74)
This commit is contained in:
wp_xyz 2024-09-13 23:28:24 +02:00 committed by Maxim Ganetsky
parent 191d5ff89f
commit b148fd8cb1

View File

@ -62,8 +62,6 @@ type
procedure CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean); override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseEnter; override;
procedure MouseLeave; override;
public
constructor Create(aOwner: TComponent); override;
public
@ -567,20 +565,6 @@ begin
end;
end;
procedure TGroupTabLabel.MouseEnter;
begin
inherited MouseEnter;
Font.Style := Font.Style + [fsUnderline];
end;
procedure TGroupTabLabel.MouseLeave;
begin
inherited MouseLeave;
Font.Style := Font.Style - [fsUnderline];
end;
{ TGroupItem }
constructor TGroupItem.Create(AType: TGroupType; const ATitle: string;
@ -952,7 +936,10 @@ begin
xBtn.PopupMenu := FTabButtonMenu;
xBtn.Down := xEditor = xOldActive;
if xBtn.Down then
begin
xActBtn := xBtn;
xBtn.Font.Style := xBtn.Font.Style + [fsUnderline];
end;
xBtn.IsOtherFile := xPkgItem.&Type = gtOther;
end;
end;
@ -1007,10 +994,14 @@ begin
begin
xBtn := TPackageTabButton(FPanel.Controls[I]);
xBtn.Down := xBtn.Editor = xActEditor;
xBtn.Font.Style := xBtn.Font.Style - [fsUnderline];
if xBtn.Editor = xActEditor then
xActBtn := xBtn;
end;
if xActBtn <> nil then
xActBtn.Font.Style := xActBtn.Font.Style + [fsUnderline];
if (xActBtn<>nil) and (FPanel is TPackageTabScrollBox) then
TPackageTabScrollBox(FPanel).ScrollInView(xActBtn);