Skip to content

Commit

Permalink
Merge branch 'monitorv2support'
Browse files Browse the repository at this point in the history
  • Loading branch information
landrix committed Nov 30, 2020
2 parents a9e7334 + adf5f73 commit 95d8484
Show file tree
Hide file tree
Showing 10 changed files with 404 additions and 261 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
TChromeTabs 2.6

26-11-2020
Update: High-DPI support
Fixed: bug(spell error?) in TChromeTabControl.CalculateRects #58

26-06-2020
Update: DX10.4 Sydney

TChromeTabs 2.5

22-11-2018
Expand Down
11 changes: 5 additions & 6 deletions Demo/ChromeTabsDemoDX10_4.dproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{c9ed9a5c-a15c-4d5c-af55-c6450d1b6687}</ProjectGuid>
<MainSource>ChromeTabsDemoDX10_4.dpr</MainSource>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
<DCC_DependencyCheckOutputName>Project2.exe</DCC_DependencyCheckOutputName>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>19.0</ProjectVersion>
<ProjectVersion>19.1</ProjectVersion>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>3</TargetedPlatforms>
<AppType>Application</AppType>
Expand Down Expand Up @@ -77,13 +77,13 @@
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<Version>7.0</Version>
Expand Down Expand Up @@ -126,7 +126,6 @@
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<BT_BuildType>Debug</BT_BuildType>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
</PropertyGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
Expand Down
Binary file modified Demo/ChromeTabsDemoDX10_4.res
Binary file not shown.
4 changes: 2 additions & 2 deletions Demo/frmMainU.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -2837,9 +2837,9 @@ object frmMain: TfrmMain
object chkActiveNewTab: TCheckBox
Left = 3
Top = 199
Width = 142
Width = 371
Height = 17
Caption = 'Activate new Tab'
Caption = 'ActivateNewTag'
Checked = True
State = cbChecked
TabOrder = 7
Expand Down
2 changes: 1 addition & 1 deletion Demo/frmMainU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ procedure TfrmMain.ChromeTabs2AfterDrawItem(Sender: TObject;

if (ChromeTabs2.Tabs.Count = 0) and (ItemType = itTabContainer) and (ChromeTabs2.ActiveDragTabObject = nil) then
begin
TabsFont := TGPFont.Create(ChromeTabs2.LookAndFeel.Tabs.DefaultFont.Name, 11);
TabsFont := TGPFont.Create(ChromeTabs2.LookAndFeel.Tabs.DefaultFont.Name, ChromeTabs2.ScaledFontSize(11));
TabsTxtBrush := TGPSolidBrush.Create(MakeGDIPColor(clWhite, 255));
try
TargetCanvas.SetSmoothingMode(ChromeTabs2.Options.Display.Tabs.CanvasSmoothingMode);
Expand Down
315 changes: 168 additions & 147 deletions Lib/ChromeTabs.pas

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions Lib/ChromeTabsClasses.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ TChromeTabsLookAndFeelStyle = class;
function GetSpinnerState: TChromeTabSpinnerState;
function GetHideCloseButton: Boolean;
function GetData: Pointer;
function GetCustomImages: TCustomImageList;
function GetCustomImagesOverlay: TCustomImageList;
function GetCustomImagesSpinnerDownload: TCustomImageList;
function GetCustomImagesSpinnerUpload: TCustomImageList;
procedure SetData(const Value: Pointer);
property Data: Pointer read GetData write SetData;
end;
Expand Down Expand Up @@ -126,6 +130,10 @@ TChromeTab = class(TCollectionItem, IChromeTab)
FMarkedForDeletion: Boolean;
FSpinnerState: TChromeTabSpinnerState;
FHideCloseButton: Boolean;
FCustomImages: TCustomImageList;
FCustomImagesOverlay: TCustomImageList;
FCustomImagesSpinnerDownload: TCustomImageList;
FCustomImagesSpinnerUpload: TCustomImageList;

procedure SetActive(Value: boolean);
procedure SetCaption(Value: TCaption);
Expand Down Expand Up @@ -155,6 +163,14 @@ TChromeTab = class(TCollectionItem, IChromeTab)
function GetSpinnerState: TChromeTabSpinnerState;
function GetHideCloseButton: Boolean;
function GetData: Pointer;
procedure SetCustomImages(const Value: TCustomImageList);
procedure SetCustomImagesOverlay(const Value: TCustomImageList);
procedure SetCustomImagesSpinnerDownload(const Value: TCustomImageList);
procedure SetCustomImagesSpinnerUpload(const Value: TCustomImageList);
function GetCustomImages: TCustomImageList;
function GetCustomImagesOverlay: TCustomImageList;
function GetCustomImagesSpinnerDownload: TCustomImageList;
function GetCustomImagesSpinnerUpload: TCustomImageList;
protected
procedure DoChanged(ChangeType: TTabChangeType = tcPropertyUpdated); virtual;
function GetDisplayName: string; override;
Expand All @@ -175,6 +191,10 @@ TChromeTab = class(TCollectionItem, IChromeTab)
property Caption: TCaption read GetCaption write SetCaption;
property Active: boolean read GetActive write SetActive;
property Tag: integer read GetTag write SetTag;
property CustomImages: TCustomImageList read GetCustomImages write SetCustomImages;
property CustomImagesOverlay: TCustomImageList read GetCustomImagesOverlay write SetCustomImagesOverlay;
property CustomImagesSpinnerUpload: TCustomImageList read GetCustomImagesSpinnerUpload write SetCustomImagesSpinnerUpload;
property CustomImagesSpinnerDownload: TCustomImageList read GetCustomImagesSpinnerDownload write SetCustomImagesSpinnerDownload;
property ImageIndex: {$IF CompilerVersion >= 23.0}System.UITypes.{$IFEND}TImageIndex read GetImageIndex write SetImageIndex;
property ImageIndexOverlay: {$IF CompilerVersion >= 23.0}System.UITypes.{$IFEND}TImageIndex read GetImageIndexOverlay write SetImageIndexOverlay;
property Pinned: Boolean read GetPinned write SetPinned;
Expand Down Expand Up @@ -1186,6 +1206,8 @@ TOptions = class(TChromeTabsPersistent)
procedure Invalidate;
function GetComponentState: TComponentState;
function IsDragging: Boolean;
function ScaledPixels(pPixels: Integer): Integer;
function ScaledFontSize(fFontSize : Integer) : Integer;

function GetLookAndFeel: TChromeTabsLookAndFeel;
function GetOptions: TOptions;
Expand Down Expand Up @@ -1238,6 +1260,46 @@ destructor TChromeTab.Destroy;
FTabControl.Free;
end;

procedure TChromeTab.SetCustomImages(const Value: TCustomImageList);
begin
FCustomImages := Value;
end;

procedure TChromeTab.SetCustomImagesOverlay(const Value: TCustomImageList);
begin
FCustomImagesOverlay := Value;
end;

procedure TChromeTab.SetCustomImagesSpinnerDownload(const Value: TCustomImageList);
begin
FCustomImagesSpinnerDownload := Value;
end;

procedure TChromeTab.SetCustomImagesSpinnerUpload(const Value: TCustomImageList);
begin
FCustomImagesSpinnerUpload := Value;
end;

function TChromeTab.GetCustomImages : TCustomImageList;
begin
Result := FCustomImages;
end;

function TChromeTab.GetCustomImagesOverlay : TCustomImageList;
begin
Result := FCustomImagesOverlay;
end;

function TChromeTab.GetCustomImagesSpinnerDownload : TCustomImageList;
begin
Result := FCustomImagesSpinnerDownload;
end;

function TChromeTab.GetCustomImagesSpinnerUpload : TCustomImageList;
begin
Result := FCustomImagesSpinnerUpload;
end;

procedure TChromeTab.SetPinned(const Value: Boolean);
var
LastPinned: Integer;
Expand Down
Loading

0 comments on commit 95d8484

Please sign in to comment.