spktoolbar: Add Appearance property Tab.CornerRadius (https://forum.lazarus.freepascal.org/index.php/topic,47375.msg339191)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7183 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-11-12 15:25:04 +00:00
parent 56da43d5e4
commit 8e8e01d047
4 changed files with 132 additions and 123 deletions

View File

@ -1340,7 +1340,7 @@ procedure TSpkToolbar.ValidateBuffer;
{$ELSE}
Create2DIntRect(0, ToolbarTabCaptionsHeight, self.Width - 1, self.Height - 1),
{$ENDIF}
ToolbarCornerRadius,
FocusedAppearance.Tab.CornerRadius,
FocusedAppearance.Tab.GradientFromColor,
FocusedAppearance.Tab.GradientToColor,
FocusedAppearance.Tab.GradientType);
@ -1351,57 +1351,57 @@ procedure TSpkToolbar.ValidateBuffer;
{$ELSE}
Create2DIntPoint(0, ToolbarTabCaptionsHeight),
{$ENDIF}
ToolbarCornerRadius,
FocusedAppearance.Tab.CornerRadius,
cpLeftTop,
FocusedAppearance.Tab.BorderColor);
TGuiTools.DrawAARoundCorner(FBuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(self.Width - ToolbarCornerRadius, ToolbarTabCaptionsHeight),
T2DIntPoint.Create(self.Width - FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight),
{$ELSE}
Create2DIntPoint(self.Width - ToolbarCornerRadius, ToolbarTabCaptionsHeight),
Create2DIntPoint(self.Width - FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight),
{$ENDIF}
ToolbarCornerRadius,
FocusedAppearance.Tab.CornerRadius,
cpRightTop,
FocusedAppearance.Tab.BorderColor);
TGuiTools.DrawAARoundCorner(FBuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(0, self.Height - ToolbarCornerRadius),
T2DIntPoint.Create(0, self.Height - FocusedAppearance.Tab.CornerRadius),
{$ELSE}
Create2DIntPoint(0, self.Height - ToolbarCornerRadius),
Create2DIntPoint(0, self.Height - FocusedAppearance.Tab.CornerRadius),
{$ENDIF}
ToolbarCornerRadius,
FocusedAppearance.Tab.CornerRadius,
cpLeftBottom,
FocusedAppearance.Tab.BorderColor);
TGuiTools.DrawAARoundCorner(FBuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(self.Width - ToolbarCornerRadius, self.Height - ToolbarCornerRadius),
T2DIntPoint.Create(self.Width - FocusedAppearance.Tab.CornerRadius, self.Height - FocusedAppearance.Tab.CornerRadius),
{$ELSE}
Create2DIntPoint(self.Width - ToolbarCornerRadius, self.Height - ToolbarCornerRadius),
Create2DIntPoint(self.Width - FocusedAppearance.Tab.CornerRadius, self.Height - FocusedAppearance.Tab.CornerRadius),
{$ENDIF}
ToolbarCornerRadius,
FocusedAppearance.Tab.CornerRadius,
cpRightBottom,
FocusedAppearance.Tab.BorderColor);
TGuiTools.DrawVLine(FBuffer, 0, ToolbarTabCaptionsHeight +
ToolbarCornerRadius, self.Height - ToolbarCornerRadius,
FocusedAppearance.Tab.CornerRadius, self.Height - FocusedAppearance.Tab.CornerRadius,
FocusedAppearance.Tab.BorderColor);
TGuiTools.DrawHLine(FBuffer, ToolbarCornerRadius, self.Width - ToolbarCornerRadius,
TGuiTools.DrawHLine(FBuffer, FocusedAppearance.Tab.CornerRadius, self.Width - FocusedAppearance.Tab.CornerRadius,
self.Height - 1, FocusedAppearance.Tab.BorderColor);
TGuiTools.DrawVLine(FBuffer, self.Width - 1, ToolbarTabCaptionsHeight +
ToolbarCornerRadius, self.Height - ToolbarCornerRadius,
FocusedAppearance.Tab.CornerRadius, self.Height - FocusedAppearance.Tab.CornerRadius,
FocusedAppearance.Tab.BorderColor);
if not (AtLeastOneTabVisible) then
begin
//If there are no tabs then the horizontal line will be drawn
TGuiTools.DrawHLine(FBuffer, ToolbarCornerRadius, self.Width -
ToolbarCornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
TGuiTools.DrawHLine(FBuffer, FocusedAppearance.Tab.CornerRadius, self.Width -
FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
end
else
begin
@ -1412,9 +1412,9 @@ procedure TSpkToolbar.ValidateBuffer;
Dec(i);
//Only right part, the rest will be drawn with tabs
if FTabRects[i].Right < self.Width - ToolbarCornerRadius - 1 then
if FTabRects[i].Right < self.Width - FocusedAppearance.Tab.CornerRadius - 1 then
TGuiTools.DrawHLine(FBuffer, FTabRects[i].Right + 1, self.Width -
ToolbarCornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
FocusedAppearance.Tab.CornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
end;
end;
@ -1451,7 +1451,7 @@ procedure TSpkToolbar.ValidateBuffer;
end;
procedure DrawTab(index: integer;
Border, GradientFrom, GradientTo: TColor);
Border, GradientFrom, GradientTo: TColor; ATabCornerRadius: Integer);
var
TabRect: T2DIntRect;
TabRegion: HRGN;
@ -1463,36 +1463,36 @@ procedure TSpkToolbar.ValidateBuffer;
//Middle rectangle
TabRegion := CreateRectRgn(
TabRect.Left + TabCornerRadius - 1,
TabRect.Top + TabCornerRadius,
TabRect.Right - TabCornerRadius + 1 + 1,
TabRect.Left + ATabCornerRadius - 1,
TabRect.Top + ATabCornerRadius,
TabRect.Right - ATabCornerRadius + 1 + 1,
TabRect.Bottom + 1
);
//Top part with top convex curves
TmpRegion := CreateRectRgn(
TabRect.Left + 2 * TabCornerRadius - 1,
TabRect.Left + 2 * ATabCornerRadius - 1,
TabRect.Top,
TabRect.Right - 2 * TabCornerRadius + 1 + 1,
TabRect.Top + TabCornerRadius
TabRect.Right - 2 * ATabCornerRadius + 1 + 1,
TabRect.Top + ATabCornerRadius
);
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
DeleteObject(TmpRegion);
TmpRegion := CreateEllipticRgn(
TabRect.Left + TabCornerRadius - 1,
TabRect.Left + ATabCornerRadius - 1,
TabRect.Top,
TabRect.Left + 3 * TabCornerRadius,
TabRect.Top + 2 * TabCornerRadius + 1
TabRect.Left + 3 * ATabCornerRadius,
TabRect.Top + 2 * ATabCornerRadius + 1
);
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
DeleteObject(TmpRegion);
TmpRegion := CreateEllipticRgn(
TabRect.Right - 3 * TabCornerRadius + 2,
TabRect.Right - 3 * ATabCornerRadius + 2,
TabRect.Top,
TabRect.Right - TabCornerRadius + 3,
TabRect.Top + 2 * TabCornerRadius + 1
TabRect.Right - ATabCornerRadius + 3,
TabRect.Top + 2 * ATabCornerRadius + 1
);
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
DeleteObject(TmpRegion);
@ -1500,24 +1500,24 @@ procedure TSpkToolbar.ValidateBuffer;
//Bottom part with bottom convex curves
TmpRegion := CreateRectRgn(
TabRect.Left,
TabRect.Bottom - TabCornerRadius,
TabRect.Bottom - ATabCornerRadius,
TabRect.Right + 1,
TabRect.Bottom + 1
);
TmpRegion2 := CreateEllipticRgn(
TabRect.Left - TabCornerRadius,
TabRect.Bottom - 2 * TabCornerRadius + 1,
TabRect.Left + TabCornerRadius + 1,
TabRect.Left - ATabCornerRadius,
TabRect.Bottom - 2 * ATabCornerRadius + 1,
TabRect.Left + ATabCornerRadius + 1,
TabRect.Bottom + 2
);
CombineRgn(TmpRegion, TmpRegion, TmpRegion2, RGN_DIFF);
DeleteObject(TmpRegion2);
TmpRegion2 := CreateEllipticRgn(
TabRect.Right - TabCornerRadius + 1,
TabRect.Bottom - 2 * TabCornerRadius + 1,
TabRect.Right + TabCornerRadius + 2,
TabRect.Right - ATabCornerRadius + 1,
TabRect.Bottom - 2 * ATabCornerRadius + 1,
TabRect.Right + ATabCornerRadius + 2,
TabRect.Bottom + 2
);
CombineRgn(TmpRegion, TmpRegion, TmpRegion2, RGN_DIFF);
@ -1538,20 +1538,20 @@ procedure TSpkToolbar.ValidateBuffer;
// Frame
TGuiTools.DrawAARoundCorner(FBuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(TabRect.left, TabRect.bottom - TabCornerRadius + 1),
T2DIntPoint.Create(TabRect.left, TabRect.bottom - ATabCornerRadius + 1),
{$ELSE}
Create2DIntPoint(TabRect.left, TabRect.bottom - TabCornerRadius + 1),
Create2DIntPoint(TabRect.left, TabRect.bottom - ATabCornerRadius + 1),
{$ENDIF}
TabCornerRadius,
ATabCornerRadius,
cpRightBottom,
Border,
FTabClipRect);
TGuiTools.DrawAARoundCorner(FBuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(TabRect.right - TabCornerRadius + 1, TabRect.bottom - TabCornerRadius + 1),
T2DIntPoint.Create(TabRect.right - ATabCornerRadius + 1, TabRect.bottom - ATabCornerRadius + 1),
{$ELSE}
Create2DIntPoint(TabRect.right - TabCornerRadius + 1, TabRect.bottom - TabCornerRadius + 1),
Create2DIntPoint(TabRect.right - ATabCornerRadius + 1, TabRect.bottom - ATabCornerRadius + 1),
{$ENDIF}
TabCornerRadius,
cpLeftBottom,
@ -1559,44 +1559,44 @@ procedure TSpkToolbar.ValidateBuffer;
FTabClipRect);
TGuiTools.DrawVLine(FBuffer,
TabRect.left + TabCornerRadius - 1,
TabRect.top + TabCornerRadius,
TabRect.Bottom - TabCornerRadius + 1,
TabRect.left + ATabCornerRadius - 1,
TabRect.top + ATabCornerRadius,
TabRect.Bottom - ATabCornerRadius + 1,
Border,
FTabClipRect);
TGuiTools.DrawVLine(FBuffer,
TabRect.Right - TabCornerRadius + 1,
TabRect.top + TabCornerRadius,
TabRect.Bottom - TabCornerRadius + 1,
TabRect.Right - ATabCornerRadius + 1,
TabRect.top + ATabCornerRadius,
TabRect.Bottom - ATabCornerRadius + 1,
Border,
FTabClipRect);
TGuiTools.DrawAARoundCorner(FBuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(TabRect.Left + TabCornerRadius - 1, 0),
T2DIntPoint.Create(TabRect.Left + ATabCornerRadius - 1, 0),
{$ELSE}
Create2DIntPoint(TabRect.Left + TabCornerRadius - 1, 0),
Create2DIntPoint(TabRect.Left + ATabCornerRadius - 1, 0),
{$ENDIF}
TabCornerRadius,
ATabCornerRadius,
cpLeftTop,
Border,
FTabClipRect);
TGuiTools.DrawAARoundCorner(FBuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(TabRect.Right - 2 * TabCornerRadius + 2, 0),
T2DIntPoint.Create(TabRect.Right - 2 * ATabCornerRadius + 2, 0),
{$ELSE}
Create2DIntPoint(TabRect.Right - 2 * TabCornerRadius + 2, 0),
Create2DIntPoint(TabRect.Right - 2 * ATabCornerRadius + 2, 0),
{$ENDIF}
TabCornerRadius,
ATabCornerRadius,
cpRightTop,
Border,
FTabClipRect);
TGuiTools.DrawHLine(FBuffer,
TabRect.Left + 2 * TabCornerRadius - 1,
TabRect.Right - 2 * TabCornerRadius + 2,
TabRect.Left + 2 * ATabCornerRadius - 1,
TabRect.Right - 2 * ATabCornerRadius + 2,
0,
Border,
FTabClipRect);
@ -1659,7 +1659,8 @@ procedure TSpkToolbar.ValidateBuffer;
CurrentAppearance.Tab.BorderColor,
TColorTools.Brighten(TColorTools.Brighten(
CurrentAppearance.Tab.GradientFromColor, delta), delta),
CurrentAppearance.Tab.GradientFromColor);
CurrentAppearance.Tab.GradientFromColor,
CurrentAppearance.Tab.CornerRadius);
end
else
begin
@ -1667,7 +1668,8 @@ procedure TSpkToolbar.ValidateBuffer;
CurrentAppearance.Tab.BorderColor,
TColorTools.Brighten(
CurrentAppearance.Tab.GradientFromColor, delta),
CurrentAppearance.Tab.GradientFromColor);
CurrentAppearance.Tab.GradientFromColor,
CurrentAppearance.Tab.CornerRadius);
end;
DrawTabText(i, CurrentAppearance.Tab.TabHeaderFont);
@ -1682,7 +1684,8 @@ procedure TSpkToolbar.ValidateBuffer;
TColorTools.Shade(self.color,
TColorTools.Brighten(CurrentAppearance.Tab.GradientFromColor, delta), 50),
TColorTools.Shade(
self.color, CurrentAppearance.Tab.GradientFromColor, 50) );
self.color, CurrentAppearance.Tab.GradientFromColor, 50),
CurrentAppearance.Tab.CornerRadius);
end;
// Bottom line
@ -1778,7 +1781,7 @@ begin
FBuffer.Canvas.Font.Assign(TabAppearance.Tab.TabHeaderFont);
TabWidth := 2 + // Frame
2 * TabCornerRadius +
2 * TabAppearance.Tab.CornerRadius +
// Curves
2 * ToolbarTabCaptionsTextHPadding +
// Internal margins

View File

@ -45,9 +45,11 @@ type
FGradientToColor: TColor;
FGradientType: TBackgroundKind;
FInactiveHeaderFontColor: TColor;
FCornerRadius: Integer;
// Getter & setter methods
procedure SetHeaderFont(const Value: TFont);
procedure SetBorderColor(const Value: TColor);
procedure SetCornerRadius(const Value: Integer);
procedure SetGradientFromColor(const Value: TColor);
procedure SetGradientToColor(const Value: TColor);
procedure SetGradientType(const Value: TBackgroundKind);
@ -71,6 +73,7 @@ type
published
property TabHeaderFont: TFont read FTabHeaderFont write SetHeaderFont;
property BorderColor: TColor read FBorderColor write SetBorderColor;
property CornerRadius: Integer read FCornerRadius write SetCornerRadius;
property GradientFromColor: TColor read FGradientFromColor write SetGradientFromColor;
property GradientToColor: TColor read FGradientToColor write SetGradientToColor;
property GradientType: TBackgroundKind read FGradientType write SetGradientType;
@ -275,7 +278,7 @@ procedure SetDefaultFont(AFont: TFont);
implementation
uses
LCLIntf, LCLType, typinfo, spkGraphTools;
LCLIntf, LCLType, typinfo, spkt_Const, spkGraphTools;
procedure SaveFontToPascal(AList: TStrings; AFont: TFont; AName: String);
var
@ -301,6 +304,7 @@ constructor TSpkTabAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
begin
inherited Create;
FDispatch := ADispatch;
FCornerRadius := 0;
FTabHeaderFont := TFont.Create;
FTabHeaderFont.OnChange := TabHeaderFontChange;
Reset;
@ -321,6 +325,7 @@ begin
SrcAppearance := TSpkTabAppearance(Source);
FTabHeaderFont.Assign(SrcAppearance.TabHeaderFont);
FBorderColor := SrcAppearance.BorderColor;
FCornerRadius := SrcAppearance.CornerRadius;
FGradientFromColor := SrcAppearance.GradientFromColor;
FGradientToColor := SrcAppearance.GradientToColor;
FGradientType := SrcAppearance.GradientType;
@ -347,6 +352,10 @@ begin
if Assigned(Subnode) then
FBorderColor := Subnode.TextAsColor;
SubNode := Node['CornerRadius', false];
if Assigned(SubNode) then
FCornerRadius := SubNode.TextAsInteger;
Subnode := Node['GradientFromColor',false];
if Assigned(Subnode) then
FGradientFromColor := Subnode.TextAsColor;
@ -373,6 +382,7 @@ begin
begin
FTabHeaderFont.Color := rgb(21, 66, 139);
FBorderColor := rgb(141, 178, 227);
FCornerRadius := spkt_Const.TabCornerRadius;
FGradientFromColor := rgb(222, 232, 245);
FGradientToColor := rgb(199, 216, 237);
FGradientType := bkConcave;
@ -385,6 +395,7 @@ begin
FTabHeaderFont.Style := [];
FTabHeaderFont.Color := $007A534C;
FBorderColor := $00BEBEBE;
FCornerRadius := spkt_Const.TabCornerRadius;
FGradientFromColor := $00F4F2F2;
FGradientToColor := $00EFE6E1;
FGradientType := bkConcave;
@ -396,6 +407,7 @@ begin
FTabHeaderFont.Style := [];
FTabHeaderFont.Color := $0095572A;
FBorderColor := $00D2D0CF;
FCornerRadius := 0;
FGradientFromColor := $00F1F1F1;
FGradientToColor := $00F1F1F1;
FGradientType := bkSolid;
@ -407,6 +419,7 @@ begin
FTabHeaderFont.Style := [];
FTabHeaderFont.Color := $00FFFFFF;
FBorderColor := $00000000;
FCornerRadius := 0;
FGradientFromColor := $00464646;
FGradientToColor := $00464646;
FGradientType := bkSolid;
@ -421,6 +434,7 @@ begin
Add(' with Tab do begin');
SaveFontToPascal(AList, FTabHeaderFont, ' TabHeaderFont');
Add(' BorderColor := $' + IntToHex(FBorderColor, 8) + ';');
Add(' CornerRadius := ' + IntToStr(FCornerRadius) + ';');
Add(' GradientFromColor := $' + IntToHex(FGradientFromColor, 8) + ';');
Add(' GradientToColor := $' + IntToHex(FGradientToColor, 8) + ';');
Add(' GradientType := ' + GetEnumName(TypeInfo(TBackgroundKind), ord(FGradientType)) + ';');
@ -442,6 +456,9 @@ begin
Subnode := Node['BorderColor',true];
Subnode.TextAsColor := FBorderColor;
SubNode := Node['CornerRadius',true];
SubNode.TextAsInteger := FCornerRadius;
Subnode := Node['GradientFromColor',true];
Subnode.TextAsColor := FGradientFromColor;
@ -462,6 +479,13 @@ begin
FDispatch.NotifyAppearanceChanged;
end;
procedure TSpkTabAppearance.SetCornerRadius(const Value: Integer);
begin
FCornerRadius := Value;
if FDispatch <> nil then
FDispatch.NotifyAppearanceChanged;
end;
procedure TSpkTabAppearance.SetGradientFromColor(const Value: TColor);
begin
FGradientFromColor := Value;

View File

@ -13,7 +13,7 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
OnCreate = FormCreate
OnShow = FormShow
ShowHint = True
LCLVersion = '1.6.4.0'
LCLVersion = '2.1.0.0'
object gbPreview: TGroupBox
Left = 0
Height = 132
@ -27,6 +27,7 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
TabOrder = 0
object tbPreview: TSpkToolbar
Left = 0
Height = 112
Top = 0
Width = 548
Color = clBtnFace
@ -125,8 +126,6 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
CustomAppearance.Element.ActiveCaptionColor = 8405614
CustomAppearance.Element.Style = esRounded
Caption = 'Sample toolbar'
OverrideAppearance = False
Visible = True
Panes = (
'SpkPane1'
'SpkPane2'
@ -134,29 +133,21 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
)
object SpkPane1: TSpkPane
Caption = 'Sample large buttons'
Visible = True
Items = (
'SpkLargeButton1'
'SpkLargeButton3'
'SpkLargeButton2'
)
object SpkLargeButton1: TSpkLargeButton
Visible = True
Enabled = True
Caption = 'Default'
LargeImageIndex = 0
ButtonKind = bkButton
end
object SpkLargeButton3: TSpkLargeButton
Visible = True
Enabled = True
Caption = 'Button and dropdown'
LargeImageIndex = 0
ButtonKind = bkButtonDropdown
end
object SpkLargeButton2: TSpkLargeButton
Visible = True
Enabled = True
Caption = 'Dropdown'
LargeImageIndex = 0
ButtonKind = bkDropdown
@ -164,49 +155,34 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
end
object SpkPane2: TSpkPane
Caption = 'Sample small buttons'
Visible = True
Items = (
'SpkSmallButton1'
'SpkSmallButton2'
'SpkSmallButton3'
)
object SpkSmallButton1: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Default'
GroupBehaviour = gbSingleItem
HideFrameWhenIdle = True
ImageIndex = 0
ShowCaption = True
TableBehaviour = tbBeginsRow
ButtonKind = bkButton
end
object SpkSmallButton2: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Button and dropdown'
GroupBehaviour = gbSingleItem
HideFrameWhenIdle = True
ImageIndex = 0
ShowCaption = True
TableBehaviour = tbBeginsRow
ButtonKind = bkButtonDropdown
end
object SpkSmallButton3: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Dropdown'
GroupBehaviour = gbSingleItem
HideFrameWhenIdle = True
ImageIndex = 0
ShowCaption = True
TableBehaviour = tbBeginsRow
ButtonKind = bkDropdown
end
end
object SpkPane3: TSpkPane
Caption = 'Tool buttons'
Visible = True
Items = (
'SpkSmallButton4'
'SpkSmallButton5'
@ -215,59 +191,31 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
'SpkSmallButton8'
)
object SpkSmallButton4: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Button'
GroupBehaviour = gbBeginsGroup
HideFrameWhenIdle = False
ImageIndex = 0
ShowCaption = False
TableBehaviour = tbContinuesRow
ButtonKind = bkButton
end
object SpkSmallButton5: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Button'
GroupBehaviour = gbContinuesGroup
HideFrameWhenIdle = False
ImageIndex = 0
ShowCaption = False
TableBehaviour = tbContinuesRow
ButtonKind = bkButton
end
object SpkSmallButton6: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Button'
GroupBehaviour = gbEndsGroup
HideFrameWhenIdle = False
ImageIndex = 0
ShowCaption = False
TableBehaviour = tbContinuesRow
ButtonKind = bkButton
end
object SpkSmallButton7: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Btn1'
GroupBehaviour = gbSingleItem
HideFrameWhenIdle = False
ImageIndex = 0
ShowCaption = True
TableBehaviour = tbBeginsRow
ButtonKind = bkButton
end
object SpkSmallButton8: TSpkSmallButton
Visible = True
Enabled = True
Caption = 'Btn2'
GroupBehaviour = gbSingleItem
HideFrameWhenIdle = False
ImageIndex = 0
ShowCaption = True
TableBehaviour = tbContinuesRow
ButtonKind = bkButton
end
end
end
@ -316,8 +264,6 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
CustomAppearance.Element.ActiveCaptionColor = 8405614
CustomAppearance.Element.Style = esRounded
Caption = 'Another tab'
OverrideAppearance = False
Visible = True
Panes = ( )
end
end
@ -405,15 +351,15 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
Caption = 'Gradient kind'
ParentColor = False
end
object Label6: TLabel
object lblTabHeaderFont: TLabel
AnchorSideTop.Control = pTabHeaderFont
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = LblInactiveTabHeaderFontColor
AnchorSideRight.Side = asrBottom
Left = 88
Left = 89
Height = 15
Top = 235
Width = 83
Width = 82
Anchors = [akTop, akRight]
Caption = 'Tab header font'
ParentColor = False
@ -697,6 +643,31 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
Anchors = [akTop, akLeft, akBottom]
Shape = bsSpacer
end
object edTabCornerRadius: TSpinEdit
AnchorSideLeft.Control = pTabHeaderFont
AnchorSideTop.Control = pTabHeaderFont
AnchorSideTop.Side = asrBottom
Left = 191
Height = 23
Top = 261
Width = 82
BorderSpacing.Top = 6
OnChange = edTabCornerRadiusChange
TabOrder = 8
end
object lblTabCornerRadius: TLabel
AnchorSideTop.Control = edTabCornerRadius
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = lblTabHeaderFont
AnchorSideRight.Side = asrBottom
Left = 81
Height = 15
Top = 265
Width = 90
Anchors = [akTop, akRight]
Caption = 'Tab corner radius'
ParentColor = False
end
end
object TabSheet2: TTabSheet
Caption = 'Pane'
@ -1188,7 +1159,7 @@ object frmAppearanceEditWindow: TfrmAppearanceEditWindow
end
object TabSheet3: TTabSheet
Caption = 'Item'
ClientHeight = 355
ClientHeight = 354
ClientWidth = 544
ImageIndex = 2
object sItemRectangle: TShape

View File

@ -15,6 +15,7 @@ type
{ TfrmAppearanceEditWindow }
TfrmAppearanceEditWindow = class(TForm)
lblTabCornerRadius: TLabel;
SmallImages: TImageList;
LargeImages: TImageList;
Images_150: TImageList;
@ -26,6 +27,7 @@ type
ItemHSpacer: TBevel;
edPaneHotTrackBrightnessChange: TSpinEdit;
edItemHotTrackBrightnessChange: TSpinEdit;
edTabCornerRadius: TSpinEdit;
TabVSpacer: TBevel;
bInactiveTabHeaderFontColor: TSpeedButton;
bItemActiveInnerDarkColor: TSpeedButton;
@ -103,7 +105,7 @@ type
pTabGradientTo: TPanel;
cbTabGradientKind: TComboBox;
Label5: TLabel;
Label6: TLabel;
lblTabHeaderFont: TLabel;
pTabHeaderFont: TPanel;
Label8: TLabel;
pPaneBorderDark: TPanel;
@ -222,6 +224,7 @@ type
procedure edItemHotTrackBrightnessChangeChange(Sender: TObject);
procedure edPaneHotTrackBrightnessChangeChange(Sender: TObject);
procedure edTabCornerRadiusChange(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
@ -842,6 +845,13 @@ begin
tbPreview.Invalidate;
end;
procedure TfrmAppearanceEditWindow.edTabCornerRadiusChange(Sender: TObject);
begin
with tbPreview.Appearance.Tab do
CornerRadius := (Sender as TSpinEdit).Value;
tbPreview.Invalidate;
end;
procedure TfrmAppearanceEditWindow.FormActivate(Sender: TObject);
begin
UpdateImages;
@ -888,6 +898,7 @@ begin
SetPanelFont(pTabHeaderFont, TabHeaderFont);
SetPanelColor(pActiveTabHeaderFont, TabHeaderFont.Color);
SetPanelColor(pInactiveTabHeaderFont, InactiveTabHeaderFontColor);
edTabCornerRadius.Value := CornerRadius;
end;
with Pane do