1
0
mirror of synced 2024-11-15 00:43:50 +00:00

Draw the active project Bold

This commit is contained in:
Mark van Renswoude 2011-01-14 09:58:03 +00:00
parent 6588aedb53
commit 9ac9fc34c6
6 changed files with 21 additions and 6 deletions

Binary file not shown.

View File

@ -29,12 +29,14 @@ uses
type
TBaseSwStyleVisitor = class(TInterfacedPersistent, IBaseSwVisitor)
private
FBold: Boolean;
FColor: TColor;
FImageIndex: Integer;
FOverlayIndex: Integer;
protected
procedure VisitItem(const AItem: TBaseSwItem); virtual;
public
property Bold: Boolean read FBold write FBold;
property Color: TColor read FColor write FColor;
property ImageIndex: Integer read FImageIndex write FImageIndex;
property OverlayIndex: Integer read FOverlayIndex write FOverlayIndex;
@ -146,6 +148,7 @@ const
{ TBaseSwStyleVisitor }
procedure TBaseSwStyleVisitor.VisitItem(const AItem: TBaseSwItem);
begin
Bold := False;
Color := clDefault;
ImageIndex := -1;
OverlayIndex := -1;
@ -631,6 +634,11 @@ begin
end;
Canvas.FillRect(Rect);
if FStyleVisitor.Bold then
Canvas.Font.Style := [fsBold]
else
Canvas.Font.Style := [];
textRect := Rect;
InflateRect(textRect, -2, -2);

View File

@ -98,9 +98,9 @@ begin
for projectIndex := Pred(moduleServices.MainProjectGroup.ProjectCount) downto 0 do
begin
project := moduleServices.MainProjectGroup.Projects[projectIndex];
projectItem := TProjSwProject.Create(project);
projectItem := TProjSwProject.Create(project, project = activeProject);
if project = activeProject then
if projectItem.IsActive then
activeItem := projectItem;
projectList.Add(projectItem);

View File

@ -1,6 +1,6 @@
inherited frmProjSwDialog: TfrmProjSwDialog
Caption = 'ProjectSwitcher'
ExplicitHeight = 425
ExplicitHeight = 427
PixelsPerInch = 96
TextHeight = 13
inherited pnlMain: TPanel
@ -21,7 +21,7 @@ inherited frmProjSwDialog: TfrmProjSwDialog
end
inherited ilsTypes: TImageList
Bitmap = {
494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C010101000400080010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000001000000001002000000000000010
000000000000000000000000000000000000000000000000000000000000A5A5
A500636363006363630063636300636363006363630063636300A5A5A5000000

View File

@ -57,6 +57,9 @@ uses
procedure TProjSwStyleVisitor.VisitItem(const AItem: TBaseSwItem);
begin
ImageIndex := 0;
if AItem is TProjSwProject then
Bold := TProjSwProject(AItem).IsActive;
end;

View File

@ -10,14 +10,17 @@ uses
type
TProjSwProject = class(TBaseSwItem)
private
FIsActive: Boolean;
FProject: IOTAProject;
FName: String;
protected
function GetName: String; override;
public
constructor Create(AProject: IOTAProject);
constructor Create(AProject: IOTAProject; AIsActive: Boolean);
procedure Activate(const AClearSelection: Boolean);
property IsActive: Boolean read FIsActive;
end;
@ -27,12 +30,13 @@ uses
{ TProjSwProject }
constructor TProjSwProject.Create(AProject: IOTAProject);
constructor TProjSwProject.Create(AProject: IOTAProject; AIsActive: Boolean);
begin
inherited Create;
FProject := AProject;
FName := ExtractFileName(FProject.ProjectOptions.TargetName);
FIsActive := AIsActive;
end;