You've already forked lazarus-ccr
spktoolbar: Add new property CaptionHeight to TabAppearance.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7195 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -317,6 +317,9 @@ type
|
|||||||
{ Setter for toolbar style, i.e. quick selection of new appearance theme }
|
{ Setter for toolbar style, i.e. quick selection of new appearance theme }
|
||||||
procedure SetStyle(const Value: TSpkStyle);
|
procedure SetStyle(const Value: TSpkStyle);
|
||||||
|
|
||||||
|
{ Calculates the height of the entire toolbar }
|
||||||
|
function CalcToolbarHeight: Integer;
|
||||||
|
|
||||||
{ LCL Scaling }
|
{ LCL Scaling }
|
||||||
{$IF lcl_fullversion >= 1080000}
|
{$IF lcl_fullversion >= 1080000}
|
||||||
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||||
@ -565,7 +568,7 @@ begin
|
|||||||
if (AOwner is TForm) then
|
if (AOwner is TForm) then
|
||||||
SpkInitLayoutConsts(96); // This default dpi value is ignored for LCL scaling
|
SpkInitLayoutConsts(96); // This default dpi value is ignored for LCL scaling
|
||||||
|
|
||||||
Height := ToolbarHeight;
|
// Height := CalcToolbarHeight;
|
||||||
|
|
||||||
//inherited Doublebuffered:=true;
|
//inherited Doublebuffered:=true;
|
||||||
|
|
||||||
@ -611,6 +614,13 @@ begin
|
|||||||
FDelayRunTimer.Enabled := False;
|
FDelayRunTimer.Enabled := False;
|
||||||
FDelayRunTimer.OnTimer := DelayRunTimer
|
FDelayRunTimer.OnTimer := DelayRunTimer
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
Height := CalcToolbarHeight;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TSpkToolbar.CalcToolbarHeight: Integer;
|
||||||
|
begin
|
||||||
|
Result := FAppearance.Tab.CalcCaptionHeight + TabHeight;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF DELAYRUNTIMER}
|
{$IFDEF DELAYRUNTIMER}
|
||||||
@ -1081,8 +1091,10 @@ end;
|
|||||||
|
|
||||||
procedure TSpkToolbar.DoOnResize;
|
procedure TSpkToolbar.DoOnResize;
|
||||||
begin
|
begin
|
||||||
|
{
|
||||||
if Height <> ToolbarHeight then
|
if Height <> ToolbarHeight then
|
||||||
Height := ToolbarHeight;
|
Height := ToolbarHeight;
|
||||||
|
}
|
||||||
|
|
||||||
{$IFDEF DELAYRUNTIMER}
|
{$IFDEF DELAYRUNTIMER}
|
||||||
FDelayRunTimer.Enabled := False;
|
FDelayRunTimer.Enabled := False;
|
||||||
@ -1326,6 +1338,7 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
var
|
var
|
||||||
FocusedAppearance: TSpkToolbarAppearance;
|
FocusedAppearance: TSpkToolbarAppearance;
|
||||||
i: integer;
|
i: integer;
|
||||||
|
tabHeight: Integer;
|
||||||
begin
|
begin
|
||||||
//Loading appearance of selected tab
|
//Loading appearance of selected tab
|
||||||
//or FToolbarAppearance if selected tab has no set OverrideAppearance
|
//or FToolbarAppearance if selected tab has no set OverrideAppearance
|
||||||
@ -1334,11 +1347,13 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
else
|
else
|
||||||
FocusedAppearance := FAppearance;
|
FocusedAppearance := FAppearance;
|
||||||
|
|
||||||
|
tabHeight := FocusedAppearance.Tab.CalcCaptionHeight;
|
||||||
|
|
||||||
TGuiTools.DrawRoundRect(FBuffer.Canvas,
|
TGuiTools.DrawRoundRect(FBuffer.Canvas,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntRect.Create(0, ToolbarTabCaptionsHeight, self.Width - 1, self.Height - 1),
|
T2DIntRect.Create(0, tabHeight, self.Width - 1, self.Height - 1),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntRect(0, ToolbarTabCaptionsHeight, self.Width - 1, self.Height - 1),
|
Create2DIntRect(0, tabHeight, self.Width - 1, self.Height - 1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FocusedAppearance.Tab.CornerRadius,
|
FocusedAppearance.Tab.CornerRadius,
|
||||||
FocusedAppearance.Tab.GradientFromColor,
|
FocusedAppearance.Tab.GradientFromColor,
|
||||||
@ -1347,9 +1362,9 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
|
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(0, ToolbarTabCaptionsHeight),
|
T2DIntPoint.Create(0, tabHeight),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(0, ToolbarTabCaptionsHeight),
|
Create2DIntPoint(0, tabHeight),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FocusedAppearance.Tab.CornerRadius,
|
FocusedAppearance.Tab.CornerRadius,
|
||||||
cpLeftTop,
|
cpLeftTop,
|
||||||
@ -1357,9 +1372,9 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
|
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(self.Width - FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight),
|
T2DIntPoint.Create(self.Width - FocusedAppearance.Tab.CornerRadius, tabHeight),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(self.Width - FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight),
|
Create2DIntPoint(self.Width - FocusedAppearance.Tab.CornerRadius, tabHeight),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FocusedAppearance.Tab.CornerRadius,
|
FocusedAppearance.Tab.CornerRadius,
|
||||||
cpRightTop,
|
cpRightTop,
|
||||||
@ -1385,15 +1400,18 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
cpRightBottom,
|
cpRightBottom,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
|
|
||||||
TGuiTools.DrawVLine(FBuffer, 0, ToolbarTabCaptionsHeight +
|
TGuiTools.DrawVLine(FBuffer, 0,
|
||||||
FocusedAppearance.Tab.CornerRadius, self.Height - FocusedAppearance.Tab.CornerRadius,
|
tabHeight + FocusedAppearance.Tab.CornerRadius,
|
||||||
|
self.Height - FocusedAppearance.Tab.CornerRadius,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
|
|
||||||
TGuiTools.DrawHLine(FBuffer, FocusedAppearance.Tab.CornerRadius, self.Width - FocusedAppearance.Tab.CornerRadius,
|
TGuiTools.DrawHLine(FBuffer, FocusedAppearance.Tab.CornerRadius,
|
||||||
|
self.Width - FocusedAppearance.Tab.CornerRadius,
|
||||||
self.Height - 1, FocusedAppearance.Tab.BorderColor);
|
self.Height - 1, FocusedAppearance.Tab.BorderColor);
|
||||||
|
|
||||||
TGuiTools.DrawVLine(FBuffer, self.Width - 1, ToolbarTabCaptionsHeight +
|
TGuiTools.DrawVLine(FBuffer, self.Width - 1,
|
||||||
FocusedAppearance.Tab.CornerRadius, self.Height - FocusedAppearance.Tab.CornerRadius,
|
tabHeight + FocusedAppearance.Tab.CornerRadius,
|
||||||
|
self.Height - FocusedAppearance.Tab.CornerRadius,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
|
|
||||||
if not (AtLeastOneTabVisible) then
|
if not (AtLeastOneTabVisible) then
|
||||||
@ -1401,7 +1419,7 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
|
|
||||||
//If there are no tabs then the horizontal line will be drawn
|
//If there are no tabs then the horizontal line will be drawn
|
||||||
TGuiTools.DrawHLine(FBuffer, FocusedAppearance.Tab.CornerRadius, self.Width -
|
TGuiTools.DrawHLine(FBuffer, FocusedAppearance.Tab.CornerRadius, self.Width -
|
||||||
FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.CornerRadius, tabHeight, FocusedAppearance.Tab.BorderColor);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1414,7 +1432,7 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
//Only right part, the rest will be drawn with tabs
|
//Only right part, the rest will be drawn with tabs
|
||||||
if FTabRects[i].Right < self.Width - FocusedAppearance.Tab.CornerRadius - 1 then
|
if FTabRects[i].Right < self.Width - FocusedAppearance.Tab.CornerRadius - 1 then
|
||||||
TGuiTools.DrawHLine(FBuffer, FTabRects[i].Right + 1, self.Width -
|
TGuiTools.DrawHLine(FBuffer, FTabRects[i].Right + 1, self.Width -
|
||||||
FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.CornerRadius, tabHeight, FocusedAppearance.Tab.BorderColor);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1746,23 +1764,26 @@ begin
|
|||||||
|
|
||||||
FBuffer.Free;
|
FBuffer.Free;
|
||||||
FBuffer := TBitmap.Create;
|
FBuffer := TBitmap.Create;
|
||||||
FBuffer.SetSize(self.Width, self.Height);
|
FBuffer.SetSize(self.Width, CalcToolbarHeight); //Height);
|
||||||
|
SetBounds(Left, Top, FBuffer.Width, FBuffer.Height);
|
||||||
|
|
||||||
// *** Tabs ***
|
// *** Tabs ***
|
||||||
|
|
||||||
|
TabAppearance := FAppearance;
|
||||||
|
|
||||||
// Cliprect of tabs (containg top frame of component)
|
// Cliprect of tabs (containg top frame of component)
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
FTabClipRect := T2DIntRect.Create(
|
FTabClipRect := T2DIntRect.Create(
|
||||||
ToolbarCornerRadius,
|
ToolbarCornerRadius,
|
||||||
0,
|
0,
|
||||||
self.Width - ToolbarCornerRadius - 1,
|
self.Width - ToolbarCornerRadius - 1,
|
||||||
ToolbarTabCaptionsHeight);
|
TabAppearance.Tab.CalcCaptionHeight);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
FTabClipRect.Create(
|
FTabClipRect.Create(
|
||||||
ToolbarCornerRadius,
|
ToolbarCornerRadius,
|
||||||
0,
|
0,
|
||||||
self.Width - ToolbarCornerRadius - 1,
|
self.Width - ToolbarCornerRadius - 1,
|
||||||
ToolbarTabCaptionsHeight);
|
TabAppearance.Tab.CalcCaptionHeight);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
// Rects of tabs headings (containg top frame of component)
|
// Rects of tabs headings (containg top frame of component)
|
||||||
@ -1792,7 +1813,7 @@ begin
|
|||||||
FTabRects[i].Left := x;
|
FTabRects[i].Left := x;
|
||||||
FTabRects[i].Right := x + TabWidth - 1;
|
FTabRects[i].Right := x + TabWidth - 1;
|
||||||
FTabRects[i].Top := 0;
|
FTabRects[i].Top := 0;
|
||||||
FTabRects[i].Bottom := ToolbarTabCaptionsHeight;
|
FTabRects[i].Bottom := TabAppearance.Tab.CalcCaptionHeight;
|
||||||
|
|
||||||
x := FTabRects[i].right + 1;
|
x := FTabRects[i].right + 1;
|
||||||
end
|
end
|
||||||
@ -1813,12 +1834,12 @@ begin
|
|||||||
// Rect of tab region
|
// Rect of tab region
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
FTabContentsClipRect := T2DIntRect.Create(ToolbarBorderWidth + TabPaneLeftPadding,
|
FTabContentsClipRect := T2DIntRect.Create(ToolbarBorderWidth + TabPaneLeftPadding,
|
||||||
ToolbarTabCaptionsHeight + ToolbarBorderWidth + TabPaneTopPadding,
|
TabAppearance.Tab.CalcCaptionHeight + ToolbarBorderWidth + TabPaneTopPadding,
|
||||||
self.Width - 1 - ToolbarBorderWidth - TabPaneRightPadding,
|
self.Width - 1 - ToolbarBorderWidth - TabPaneRightPadding,
|
||||||
self.Height - 1 - ToolbarBorderWidth - TabPaneBottomPadding);
|
self.Height - 1 - ToolbarBorderWidth - TabPaneBottomPadding);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
FTabContentsClipRect.Create(ToolbarBorderWidth + TabPaneLeftPadding,
|
FTabContentsClipRect.Create(ToolbarBorderWidth + TabPaneLeftPadding,
|
||||||
ToolbarTabCaptionsHeight + ToolbarBorderWidth + TabPaneTopPadding,
|
TabAppearance.Tab.CalcCaptionHeight + ToolbarBorderWidth + TabPaneTopPadding,
|
||||||
self.Width - 1 - ToolbarBorderWidth - TabPaneRightPadding,
|
self.Width - 1 - ToolbarBorderWidth - TabPaneRightPadding,
|
||||||
self.Height - 1 - ToolbarBorderWidth - TabPaneBottomPadding);
|
self.Height - 1 - ToolbarBorderWidth - TabPaneBottomPadding);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -1892,10 +1913,10 @@ begin
|
|||||||
|
|
||||||
ToolbarBorderWidth := round(TOOLBAR_BORDER_WIDTH * AXProportion);
|
ToolbarBorderWidth := round(TOOLBAR_BORDER_WIDTH * AXProportion);
|
||||||
ToolbarCornerRadius := TOOLBAR_CORNER_RADIUS;
|
ToolbarCornerRadius := TOOLBAR_CORNER_RADIUS;
|
||||||
ToolbarTabCaptionsHeight := round(TOOLBAR_TAB_CAPTIONS_HEIGHT * AYProportion);
|
// ToolbarTabCaptionsHeight := round(TOOLBAR_TAB_CAPTIONS_HEIGHT * AYProportion);
|
||||||
ToolbarTabCaptionsTextHPadding := round(TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING * AXProportion);
|
ToolbarTabCaptionsTextHPadding := round(TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING * AXProportion);
|
||||||
ToolbarMinTabCaptionWidth := round(TOOLBAR_MIN_TAB_CAPTION_WIDTH * AXProportion);
|
ToolbarMinTabCaptionWidth := round(TOOLBAR_MIN_TAB_CAPTION_WIDTH * AXProportion);
|
||||||
ToolbarHeight := ToolbarTabCaptionsHeight + TabHeight;
|
// ToolbarHeight := ToolbarTabCaptionsHeight + TabHeight;
|
||||||
|
|
||||||
// scaling radius if not square
|
// scaling radius if not square
|
||||||
if LargeButtonRadius > 1 then
|
if LargeButtonRadius > 1 then
|
||||||
|
@ -46,9 +46,11 @@ type
|
|||||||
FGradientType: TBackgroundKind;
|
FGradientType: TBackgroundKind;
|
||||||
FInactiveHeaderFontColor: TColor;
|
FInactiveHeaderFontColor: TColor;
|
||||||
FCornerRadius: Integer;
|
FCornerRadius: Integer;
|
||||||
|
FCaptionHeight: Integer;
|
||||||
// Getter & setter methods
|
// Getter & setter methods
|
||||||
procedure SetHeaderFont(const Value: TFont);
|
procedure SetHeaderFont(const Value: TFont);
|
||||||
procedure SetBorderColor(const Value: TColor);
|
procedure SetBorderColor(const Value: TColor);
|
||||||
|
procedure SetCaptionHeight(const Value: Integer);
|
||||||
procedure SetCornerRadius(const Value: Integer);
|
procedure SetCornerRadius(const Value: Integer);
|
||||||
procedure SetGradientFromColor(const Value: TColor);
|
procedure SetGradientFromColor(const Value: TColor);
|
||||||
procedure SetGradientToColor(const Value: TColor);
|
procedure SetGradientToColor(const Value: TColor);
|
||||||
@ -65,6 +67,7 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
|
|
||||||
|
function CalcCaptionHeight: Integer;
|
||||||
procedure LoadFromXML(Node: TSpkXMLNode);
|
procedure LoadFromXML(Node: TSpkXMLNode);
|
||||||
procedure SaveToPascal(AList: TStrings);
|
procedure SaveToPascal(AList: TStrings);
|
||||||
procedure SaveToXML(Node: TSpkXMLNode);
|
procedure SaveToXML(Node: TSpkXMLNode);
|
||||||
@ -73,6 +76,7 @@ type
|
|||||||
published
|
published
|
||||||
property TabHeaderFont: TFont read FTabHeaderFont write SetHeaderFont;
|
property TabHeaderFont: TFont read FTabHeaderFont write SetHeaderFont;
|
||||||
property BorderColor: TColor read FBorderColor write SetBorderColor;
|
property BorderColor: TColor read FBorderColor write SetBorderColor;
|
||||||
|
property CaptionHeight: Integer read FCaptionHeight write SetCaptionHeight default -1;
|
||||||
property CornerRadius: Integer read FCornerRadius write SetCornerRadius;
|
property CornerRadius: Integer read FCornerRadius write SetCornerRadius;
|
||||||
property GradientFromColor: TColor read FGradientFromColor write SetGradientFromColor;
|
property GradientFromColor: TColor read FGradientFromColor write SetGradientFromColor;
|
||||||
property GradientToColor: TColor read FGradientToColor write SetGradientToColor;
|
property GradientToColor: TColor read FGradientToColor write SetGradientToColor;
|
||||||
@ -304,6 +308,7 @@ constructor TSpkTabAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
|
|||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
FDispatch := ADispatch;
|
FDispatch := ADispatch;
|
||||||
|
FCaptionHeight := -1;
|
||||||
FCornerRadius := 0;
|
FCornerRadius := 0;
|
||||||
FTabHeaderFont := TFont.Create;
|
FTabHeaderFont := TFont.Create;
|
||||||
FTabHeaderFont.OnChange := TabHeaderFontChange;
|
FTabHeaderFont.OnChange := TabHeaderFontChange;
|
||||||
@ -325,6 +330,7 @@ begin
|
|||||||
SrcAppearance := TSpkTabAppearance(Source);
|
SrcAppearance := TSpkTabAppearance(Source);
|
||||||
FTabHeaderFont.Assign(SrcAppearance.TabHeaderFont);
|
FTabHeaderFont.Assign(SrcAppearance.TabHeaderFont);
|
||||||
FBorderColor := SrcAppearance.BorderColor;
|
FBorderColor := SrcAppearance.BorderColor;
|
||||||
|
FCaptionHeight := SrcAppearance.CaptionHeight;
|
||||||
FCornerRadius := SrcAppearance.CornerRadius;
|
FCornerRadius := SrcAppearance.CornerRadius;
|
||||||
FGradientFromColor := SrcAppearance.GradientFromColor;
|
FGradientFromColor := SrcAppearance.GradientFromColor;
|
||||||
FGradientToColor := SrcAppearance.GradientToColor;
|
FGradientToColor := SrcAppearance.GradientToColor;
|
||||||
@ -337,6 +343,22 @@ begin
|
|||||||
raise AssignException.Create('TSpkToolbarAppearance.Assign: Cannot assign the object '+Source.ClassName+' to TSpkToolbarAppearance!');
|
raise AssignException.Create('TSpkToolbarAppearance.Assign: Cannot assign the object '+Source.ClassName+' to TSpkToolbarAppearance!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSpkTabAppearance.CalcCaptionHeight: Integer;
|
||||||
|
var
|
||||||
|
h: Integer;
|
||||||
|
begin
|
||||||
|
if FCaptionHeight < 0 then
|
||||||
|
begin
|
||||||
|
if FTabHeaderFont.Size = 0 then
|
||||||
|
h := GetFontData(FTabHeaderFont.Handle).Height
|
||||||
|
else
|
||||||
|
h := FTabHeaderFont.Height;
|
||||||
|
Result := abs(h) + 10;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := FCaptionHeight;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSpkTabAppearance.LoadFromXML(Node: TSpkXMLNode);
|
procedure TSpkTabAppearance.LoadFromXML(Node: TSpkXMLNode);
|
||||||
var
|
var
|
||||||
Subnode: TSpkXMLNode;
|
Subnode: TSpkXMLNode;
|
||||||
@ -352,6 +374,10 @@ begin
|
|||||||
if Assigned(Subnode) then
|
if Assigned(Subnode) then
|
||||||
FBorderColor := Subnode.TextAsColor;
|
FBorderColor := Subnode.TextAsColor;
|
||||||
|
|
||||||
|
SubNode := Node['CaptionHeight', false];
|
||||||
|
if Assigned(SubNode) then
|
||||||
|
FCaptionHeight := SubNode.TextAsInteger;
|
||||||
|
|
||||||
SubNode := Node['CornerRadius', false];
|
SubNode := Node['CornerRadius', false];
|
||||||
if Assigned(SubNode) then
|
if Assigned(SubNode) then
|
||||||
FCornerRadius := SubNode.TextAsInteger;
|
FCornerRadius := SubNode.TextAsInteger;
|
||||||
@ -382,6 +408,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
FTabHeaderFont.Color := rgb(21, 66, 139);
|
FTabHeaderFont.Color := rgb(21, 66, 139);
|
||||||
FBorderColor := rgb(141, 178, 227);
|
FBorderColor := rgb(141, 178, 227);
|
||||||
|
FCaptionHeight := -1;
|
||||||
FCornerRadius := spkt_Const.TabCornerRadius;
|
FCornerRadius := spkt_Const.TabCornerRadius;
|
||||||
FGradientFromColor := rgb(222, 232, 245);
|
FGradientFromColor := rgb(222, 232, 245);
|
||||||
FGradientToColor := rgb(199, 216, 237);
|
FGradientToColor := rgb(199, 216, 237);
|
||||||
@ -395,6 +422,7 @@ begin
|
|||||||
FTabHeaderFont.Style := [];
|
FTabHeaderFont.Style := [];
|
||||||
FTabHeaderFont.Color := $007A534C;
|
FTabHeaderFont.Color := $007A534C;
|
||||||
FBorderColor := $00BEBEBE;
|
FBorderColor := $00BEBEBE;
|
||||||
|
FCaptionHeight := -1;
|
||||||
FCornerRadius := spkt_Const.TabCornerRadius;
|
FCornerRadius := spkt_Const.TabCornerRadius;
|
||||||
FGradientFromColor := $00F4F2F2;
|
FGradientFromColor := $00F4F2F2;
|
||||||
FGradientToColor := $00EFE6E1;
|
FGradientToColor := $00EFE6E1;
|
||||||
@ -407,6 +435,7 @@ begin
|
|||||||
FTabHeaderFont.Style := [];
|
FTabHeaderFont.Style := [];
|
||||||
FTabHeaderFont.Color := $0095572A;
|
FTabHeaderFont.Color := $0095572A;
|
||||||
FBorderColor := $00D2D0CF;
|
FBorderColor := $00D2D0CF;
|
||||||
|
FCaptionHeight := -1;
|
||||||
FCornerRadius := 0;
|
FCornerRadius := 0;
|
||||||
FGradientFromColor := $00F1F1F1;
|
FGradientFromColor := $00F1F1F1;
|
||||||
FGradientToColor := $00F1F1F1;
|
FGradientToColor := $00F1F1F1;
|
||||||
@ -419,6 +448,7 @@ begin
|
|||||||
FTabHeaderFont.Style := [];
|
FTabHeaderFont.Style := [];
|
||||||
FTabHeaderFont.Color := $00FFFFFF;
|
FTabHeaderFont.Color := $00FFFFFF;
|
||||||
FBorderColor := $00000000;
|
FBorderColor := $00000000;
|
||||||
|
FCaptionHeight := -1;
|
||||||
FCornerRadius := 0;
|
FCornerRadius := 0;
|
||||||
FGradientFromColor := $00464646;
|
FGradientFromColor := $00464646;
|
||||||
FGradientToColor := $00464646;
|
FGradientToColor := $00464646;
|
||||||
@ -434,6 +464,7 @@ begin
|
|||||||
Add(' with Tab do begin');
|
Add(' with Tab do begin');
|
||||||
SaveFontToPascal(AList, FTabHeaderFont, ' TabHeaderFont');
|
SaveFontToPascal(AList, FTabHeaderFont, ' TabHeaderFont');
|
||||||
Add(' BorderColor := $' + IntToHex(FBorderColor, 8) + ';');
|
Add(' BorderColor := $' + IntToHex(FBorderColor, 8) + ';');
|
||||||
|
Add(' CaptionHeight := ' + IntToStr(FCaptionHeight) + ';');
|
||||||
Add(' CornerRadius := ' + IntToStr(FCornerRadius) + ';');
|
Add(' CornerRadius := ' + IntToStr(FCornerRadius) + ';');
|
||||||
Add(' GradientFromColor := $' + IntToHex(FGradientFromColor, 8) + ';');
|
Add(' GradientFromColor := $' + IntToHex(FGradientFromColor, 8) + ';');
|
||||||
Add(' GradientToColor := $' + IntToHex(FGradientToColor, 8) + ';');
|
Add(' GradientToColor := $' + IntToHex(FGradientToColor, 8) + ';');
|
||||||
@ -456,6 +487,9 @@ begin
|
|||||||
Subnode := Node['BorderColor',true];
|
Subnode := Node['BorderColor',true];
|
||||||
Subnode.TextAsColor := FBorderColor;
|
Subnode.TextAsColor := FBorderColor;
|
||||||
|
|
||||||
|
SubNode := Node['CaptionHeight', true];
|
||||||
|
SubNode.TextAsInteger := FCaptionHeight;
|
||||||
|
|
||||||
SubNode := Node['CornerRadius',true];
|
SubNode := Node['CornerRadius',true];
|
||||||
SubNode.TextAsInteger := FCornerRadius;
|
SubNode.TextAsInteger := FCornerRadius;
|
||||||
|
|
||||||
@ -479,6 +513,13 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSpkTabAppearance.SetCaptionHeight(const Value: Integer);
|
||||||
|
begin
|
||||||
|
if Value < -1 then FCaptionHeight := -1 else FCaptionHeight := Value;
|
||||||
|
if FDispatch <> nil then
|
||||||
|
FDispatch.NotifyAppearanceChanged;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSpkTabAppearance.SetCornerRadius(const Value: Integer);
|
procedure TSpkTabAppearance.SetCornerRadius(const Value: Integer);
|
||||||
begin
|
begin
|
||||||
FCornerRadius := Value;
|
FCornerRadius := Value;
|
||||||
|
@ -134,7 +134,7 @@ const
|
|||||||
TOOLBAR_BORDER_WIDTH = 1;
|
TOOLBAR_BORDER_WIDTH = 1;
|
||||||
TOOLBAR_CORNER_RADIUS = 0; //was: 3;
|
TOOLBAR_CORNER_RADIUS = 0; //was: 3;
|
||||||
/// <summary>Tab caption height</summary>
|
/// <summary>Tab caption height</summary>
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT = 22;
|
// TOOLBAR_TAB_CAPTIONS_HEIGHT = 22;
|
||||||
/// <summary>Tab caption horizontal padding</summary>
|
/// <summary>Tab caption horizontal padding</summary>
|
||||||
TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING = 4;
|
TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING = 4;
|
||||||
/// <summary>Min tab caption width</summary>
|
/// <summary>Min tab caption width</summary>
|
||||||
@ -259,12 +259,12 @@ var
|
|||||||
ToolbarBorderWidth: Integer;
|
ToolbarBorderWidth: Integer;
|
||||||
ToolbarCornerRadius: Integer;
|
ToolbarCornerRadius: Integer;
|
||||||
/// <summary>Tab caption height</summary>
|
/// <summary>Tab caption height</summary>
|
||||||
ToolbarTabCaptionsHeight: Integer;
|
// ToolbarTabCaptionsHeight: Integer;
|
||||||
/// <summary>Tab caption horizontal padding</summary>
|
/// <summary>Tab caption horizontal padding</summary>
|
||||||
ToolbarTabCaptionsTextHPadding: Integer;
|
ToolbarTabCaptionsTextHPadding: Integer;
|
||||||
ToolbarMinTabCaptionWidth: Integer;
|
ToolbarMinTabCaptionWidth: Integer;
|
||||||
/// <summary>Toolbar total height</summary>
|
/// <summary>Toolbar total height</summary>
|
||||||
ToolbarHeight: Integer;
|
//ToolbarHeight: Integer;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -338,10 +338,10 @@ begin
|
|||||||
|
|
||||||
ToolbarBorderWidth := SpkScaleX(TOOLBAR_BORDER_WIDTH, FromDPI, ToDPI);
|
ToolbarBorderWidth := SpkScaleX(TOOLBAR_BORDER_WIDTH, FromDPI, ToDPI);
|
||||||
ToolbarCornerRadius := TOOLBAR_CORNER_RADIUS;
|
ToolbarCornerRadius := TOOLBAR_CORNER_RADIUS;
|
||||||
ToolbarTabCaptionsHeight := SpkScaleY(TOOLBAR_TAB_CAPTIONS_HEIGHT, FromDPI, ToDPI);
|
// ToolbarTabCaptionsHeight := SpkScaleY(TOOLBAR_TAB_CAPTIONS_HEIGHT, FromDPI, ToDPI);
|
||||||
ToolbarTabCaptionsTextHPadding := SpkScaleX(TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING, FromDPI, ToDPI);
|
ToolbarTabCaptionsTextHPadding := SpkScaleX(TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING, FromDPI, ToDPI);
|
||||||
ToolbarMinTabCaptionWidth := SpkScaleX(TOOLBAR_MIN_TAB_CAPTION_WIDTH, FromDPI, ToDPI);
|
ToolbarMinTabCaptionWidth := SpkScaleX(TOOLBAR_MIN_TAB_CAPTION_WIDTH, FromDPI, ToDPI);
|
||||||
ToolbarHeight := ToolbarTabCaptionsHeight + TabHeight;
|
// ToolbarHeight := ToolbarTabCaptionsHeight + TabHeight;
|
||||||
|
|
||||||
// scaling radius if not square
|
// scaling radius if not square
|
||||||
if LargeButtonRadius > 1 then
|
if LargeButtonRadius > 1 then
|
||||||
|
Reference in New Issue
Block a user