Merge branch 'AnchorDockingFlatHeaderButtons' into 'main'

Anchor docking flat header buttons

See merge request freepascal.org/lazarus/lazarus!146
This commit is contained in:
Maxim Ganetsky 2023-04-24 14:53:52 +00:00
commit f14bab7211
4 changed files with 243 additions and 130 deletions

View File

@ -159,6 +159,8 @@ type
function GetDrawDetails: TThemedElementDetails; override;
procedure CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; {%H-}WithThemeSpace: Boolean); override;
public
property OnPaint;
end;
TAnchorDockMinimizeButton = class(TCustomSpeedButton)
@ -166,6 +168,8 @@ type
function GetDrawDetails: TThemedElementDetails; override;
procedure CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; {%H-}WithThemeSpace: Boolean); override;
public
property OnPaint;
end;
@ -197,12 +201,13 @@ type
TAnchorDockHeader = class(TCustomPanel)
private
FCloseButton: TCustomSpeedButton;
FMinimizeButton: TCustomSpeedButton;
FCloseButton: TAnchorDockCloseButton;
FMinimizeButton: TAnchorDockMinimizeButton;
FHeaderPosition: TADLHeaderPosition;
FFocused: Boolean;
FUseTimer: Boolean;
FMouseTimeStartX,FMouseTimeStartY:Integer;
procedure ButtonPaint(Sender: TObject);
procedure CloseButtonClick(Sender: TObject);
procedure MinimizeButtonClick(Sender: TObject);
procedure HeaderPositionItemClick(Sender: TObject);
@ -228,8 +233,8 @@ type
procedure PopupMenuPopup(Sender: TObject); virtual;
public
constructor Create(TheOwner: TComponent); override;
property CloseButton: TCustomSpeedButton read FCloseButton;
property MinimizeButton: TCustomSpeedButton read FMinimizeButton;
property CloseButton: TAnchorDockCloseButton read FCloseButton;
property MinimizeButton: TAnchorDockMinimizeButton read FMinimizeButton;
property HeaderPosition: TADLHeaderPosition read FHeaderPosition write SetHeaderPosition;
property BevelOuter default bvNone;
end;
@ -529,6 +534,7 @@ type
FShowHeaderCaption: boolean;
FSplitterWidth: integer;
FDockSitesCanBeMinimized: boolean;
FFlatHeadersButtons: boolean;
procedure SetAllowDragging(AValue: boolean);
procedure SetDockOutsideMargin(AValue: integer);
procedure SetDockParentMargin(AValue: integer);
@ -549,6 +555,7 @@ type
procedure SetHeaderFilled(AValue: boolean);
procedure SetHeaderHighlightFocused(AValue: boolean);
procedure SetDockSitesCanBeMinimized(AValue: boolean);
procedure SetFlatHeadersButtons(AValue: boolean);
public
property DragTreshold: integer read FDragTreshold write SetDragTreshold;
property DockOutsideMargin: integer read FDockOutsideMargin write SetDockOutsideMargin;
@ -568,6 +575,7 @@ type
property HeaderFilled: boolean read FHeaderFilled write SetHeaderFilled;
property HeaderHighlightFocused: boolean read FHeaderHighlightFocused write SetHeaderHighlightFocused;
property DockSitesCanBeMinimized: boolean read FDockSitesCanBeMinimized write SetDockSitesCanBeMinimized;
property FlatHeadersButtons: boolean read FFlatHeadersButtons write SetFlatHeadersButtons;
property FloatingWindowsOnTop: boolean read FFloatingWindowsOnTop write SetFloatingWindowsOnTop;
property MultiLinePages: boolean read FMultiLinePages write SetMultiLinePages;
procedure IncreaseChangeStamp; inline;
@ -628,6 +636,7 @@ type
FHeaderFilled: boolean;
FHeaderHighlightFocused: boolean;
FDockSitesCanBeMinimized: boolean;
FFlatHeadersButtons: boolean;
FIdleConnected: Boolean;
FManagerClass: TAnchorDockManagerClass;
FMainDockForm: TCustomForm;
@ -705,6 +714,7 @@ type
procedure SetHeaderFilled(AValue: boolean);
procedure SetHeaderHighlightFocused(AValue: boolean);
procedure SetDockSitesCanBeMinimized(AValue: boolean);
procedure SetFlatHeadersButtons(AValue: boolean);
procedure SetFloatingWindowsOnTop(AValue: boolean);
procedure SetMultiLinePages(AValue: boolean);
@ -836,6 +846,7 @@ type
property HeaderFilled: boolean read FHeaderFilled write SetHeaderFilled default true;
property HeaderHighlightFocused: boolean read FHeaderHighlightFocused write SetHeaderHighlightFocused default false;
property DockSitesCanBeMinimized: boolean read FDockSitesCanBeMinimized write SetDockSitesCanBeMinimized default false;
property FlatHeadersButtons: boolean read FFlatHeadersButtons write SetFlatHeadersButtons default false;
property SplitterWidth: integer read FSplitterWidth write SetSplitterWidth default 4;
property ScaleOnResize: boolean read FScaleOnResize write SetScaleOnResize default true; // scale children when resizing a site
@ -1475,6 +1486,13 @@ begin
IncreaseChangeStamp;
end;
procedure TAnchorDockSettings.SetFlatHeadersButtons(AValue: boolean);
begin
if FFlatHeadersButtons=AValue then Exit;
FFlatHeadersButtons:=AValue;
IncreaseChangeStamp;
end;
procedure TAnchorDockSettings.Assign(Source: TAnchorDockSettings);
begin
FChangeStamp := Source.FChangeStamp;
@ -1483,6 +1501,7 @@ begin
FDockOutsideMargin := Source.FDockOutsideMargin;
FDockParentMargin := Source.FDockParentMargin;
FDockSitesCanBeMinimized := Source.FDockSitesCanBeMinimized;
FlatHeadersButtons := Source.FlatHeadersButtons;
FDragTreshold := Source.FDragTreshold;
FFloatingWindowsOnTop := Source.FFloatingWindowsOnTop;
FHeaderAlignLeft := Source.FHeaderAlignLeft;
@ -1513,6 +1532,7 @@ begin
DockOutsideMargin := Config.GetValue('DockOutsideMargin',10);
DockParentMargin := Config.GetValue('DockParentMargin',10);
DockSitesCanBeMinimized := Config.GetValue('DockSitesCanBeMinimized',False);
FlatHeadersButtons := Config.GetValue('FlatHeadersButtons',False);
DragTreshold := Config.GetValue('DragThreshold',4);
FloatingWindowsOnTop := Config.GetValue('FloatingWindowsOnTop',false);
HeaderAlignLeft := Config.GetValue('HeaderAlignLeft',120);
@ -1537,6 +1557,7 @@ begin
Config.SetDeleteValue(Path+'DockOutsideMargin',DockOutsideMargin,10);
Config.SetDeleteValue(Path+'DockParentMargin',DockParentMargin,10);
Config.SetDeleteValue(Path+'DockSitesCanBeMinimized',DockSitesCanBeMinimized,False);
Config.SetDeleteValue(Path+'FlatHeadersButtons',FlatHeadersButtons,False);
Config.SetDeleteValue(Path+'DragThreshold',DragTreshold,4);
Config.SetDeleteValue(Path+'FloatingWindowsOnTop',FloatingWindowsOnTop,false);
Config.SetDeleteValue(Path+'HeaderAlignLeft',HeaderAlignLeft,120);
@ -1561,6 +1582,7 @@ begin
Config.SetDeleteValue('DockOutsideMargin',DockOutsideMargin,10);
Config.SetDeleteValue('DockParentMargin',DockParentMargin,10);
Config.SetDeleteValue('DockSitesCanBeMinimized',DockSitesCanBeMinimized,False);
Config.SetDeleteValue('FlatHeadersButtons',DockSitesCanBeMinimized,False);
Config.SetDeleteValue('DragThreshold',DragTreshold,4);
Config.SetDeleteValue('FloatingWindowsOnTop',FloatingWindowsOnTop,false);
Config.SetDeleteValue('HeaderAlignLeft',HeaderAlignLeft,120);
@ -1585,6 +1607,7 @@ begin
and (DockOutsideMargin=Settings.DockOutsideMargin)
and (DockParentMargin=Settings.DockParentMargin)
and (DockSitesCanBeMinimized=Settings.DockSitesCanBeMinimized)
and (FlatHeadersButtons=Settings.FlatHeadersButtons)
and (DragTreshold=Settings.DragTreshold)
and (FloatingWindowsOnTop=Settings.FloatingWindowsOnTop)
and (HeaderAlignLeft=Settings.HeaderAlignLeft)
@ -1611,6 +1634,7 @@ begin
DockOutsideMargin := Config.GetValue(Path+'DockOutsideMargin',10);
DockParentMargin := Config.GetValue(Path+'DockParentMargin',10);
DockSitesCanBeMinimized := Config.GetValue(Path+'DockSitesCanBeMinimized',false);
FlatHeadersButtons := Config.GetValue(Path+'FlatHeadersButtons',false);
DragTreshold := Config.GetValue(Path+'DragThreshold',4);
FloatingWindowsOnTop := Config.GetValue(Path+'FloatingWindowsOnTop',false); ;
HeaderAlignLeft := Config.GetValue(Path+'HeaderAlignLeft',120);
@ -2894,6 +2918,15 @@ begin
OptionsChanged;
end;
procedure TAnchorDockMaster.SetFlatHeadersButtons(AValue: boolean);
begin
if FFlatHeadersButtons=AValue then Exit;
FFlatHeadersButtons:=AValue;
InvalidateHeaders;
EnableAllAutoSizing;
OptionsChanged;
end;
procedure TAnchorDockMaster.SetFloatingWindowsOnTop(AValue: boolean);
begin
if FFloatingWindowsOnTop = AValue then Exit;
@ -3139,6 +3172,7 @@ begin
FRestoreLayouts:=TAnchorDockRestoreLayouts.Create;
FHeaderHighlightFocused:=false;
FDockSitesCanBeMinimized:=false;
FFlatHeadersButtons:=False;
FOverlappingForm:=nil;
FAllClosing:=False;
FHeaderStyleName2ADHeaderStyle:=THeaderStyleName2ADHeaderStylesMap.create;
@ -3819,6 +3853,14 @@ begin
DockOutsideMargin := Settings.DockOutsideMargin;
DockParentMargin := Settings.DockParentMargin;
DockSitesCanBeMinimized := Settings.DockSitesCanBeMinimized;
{$IF DEFINED(MSWINDOWS)}
if Win32MajorVersion>=10 then
FlatHeadersButtons := Settings.FlatHeadersButtons
else
FlatHeadersButtons := False;
{$ELSE}
FlatHeadersButtons := False;
{$ENDIF}
DragTreshold := Settings.DragTreshold;
FloatingWindowsOnTop := Settings.FloatingWindowsOnTop;
PageAreaInPercent := Settings.PageAreaInPercent;
@ -3842,6 +3884,7 @@ begin
Settings.DockOutsideMargin := DockOutsideMargin;
Settings.DockParentMargin := DockParentMargin;
Settings.DockSitesCanBeMinimized := DockSitesCanBeMinimized;
Settings.FlatHeadersButtons := FlatHeadersButtons;
Settings.DragTreshold := DragTreshold;
Settings.FloatingWindowsOnTop := FloatingWindowsOnTop;
Settings.PageAreaInPercent := PageAreaInPercent;
@ -6473,6 +6516,40 @@ begin
@CloseButtonClick);
end;
procedure TAnchorDockHeader.ButtonPaint(Sender: TObject);
function BtnPart(btn: TCustomSpeedButton): TThemedElementDetails;
begin
ThemeServices.GetElementDetails(tbPushButtonNormal);
end;
var
//LCanvas: TCanvas;
AStyle: TTextStyle;
btn: TCustomSpeedButton;
txt:String;
rect:TRect;
begin
if DockMaster.FlatHeadersButtons and (Sender is TCustomSpeedButton) then begin
btn:=sender as TCustomSpeedButton;
try
AStyle:=btn.Canvas.TextStyle;
AStyle.Layout:=tlCenter;
AStyle.Alignment:=taCenter;
AStyle.ShowPrefix:=True;
rect:=btn.ClientRect;
InflateRect(rect,-1,-1);
btn.Canvas.Font.Name:='Segoe MDL2 Assets';
if sender is TAnchorDockMinimizeButton then begin
//txt:=#$EE#$9C#$98{E718};//Pin
txt:=#$EE#$A1#$80{E840};//pinned
end else
txt:=#$EE#$9C#$91{E711};//cross
btn.Canvas.TextRect(rect, rect.TopLeft.X, rect.TopLeft.Y,txt,AStyle);
finally
end;
end;
end;
procedure TAnchorDockHeader.CloseButtonClick(Sender: TObject);
var
HeaderParent:TAnchorDockHostSite;
@ -6839,6 +6916,9 @@ begin
ShowHint:=true;
Hint:=adrsClose;
OnClick:=@CloseButtonClick;
{$IF DEFINED(MSWINDOWS)}
if Win32MajorVersion>=10 then OnPaint:=@ButtonPaint;
{$ENDIF}
AutoSize:=true;
end;
FMinimizeButton:=TAnchorDockMinimizeButton.Create(Self);
@ -6849,6 +6929,9 @@ begin
ShowHint:=true;
Hint:=adrsMinimize;
OnClick:=@MinimizeButtonClick;
{$IF DEFINED(MSWINDOWS)}
if Win32MajorVersion>=10 then OnPaint:=@ButtonPaint;
{$ENDIF}
AutoSize:=true;
end;
Align:=alTop;
@ -6881,7 +6964,10 @@ function WindowPart: TThemedWindow;
end;
begin
Result := ThemeServices.GetElementDetails(WindowPart);
if DockMaster.FlatHeadersButtons then
result := inherited
else
Result := ThemeServices.GetElementDetails(WindowPart);
end;
procedure SizeCorrector(var current,recomend:integer);
@ -6912,7 +6998,7 @@ end;
procedure TAnchorDockCloseButton.CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean);
begin
with ThemeServices.GetDetailSize(ThemeServices.GetElementDetails(twSmallCloseButtonNormal)) do
with ThemeServices.GetDetailSize(ThemeServices.GetElementDetails({$IFDEF LCLWIN32}twCloseButtonNormal{$ELSE}twSmallCloseButtonNormal{$ENDIF})) do
begin
PreferredWidth:=cx;
PreferredHeight:=cy;
@ -6947,7 +7033,10 @@ function WindowPart: TThemedWindow;
end;
begin
Result := ThemeServices.GetElementDetails(WindowPart);
if DockMaster.FlatHeadersButtons then
result := inherited
else
Result := ThemeServices.GetElementDetails(WindowPart);
end;
procedure TAnchorDockMinimizeButton.CalculatePreferredSize(var PreferredWidth,

View File

@ -1,10 +1,11 @@
object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
Left = 0
Height = 561
Height = 842
Top = 0
Width = 424
ClientHeight = 561
ClientWidth = 424
Width = 636
ClientHeight = 842
ClientWidth = 636
DesignTimePPI = 144
ParentFont = False
TabOrder = 0
DesignLeft = 517
@ -13,12 +14,12 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = DragThresholdSpinEdit
AnchorSideTop.Side = asrCenter
Left = 10
Height = 13
Top = 10
Width = 95
BorderSpacing.Left = 10
BorderSpacing.Top = 10
Left = 15
Height = 25
Top = 13
Width = 158
BorderSpacing.Left = 15
BorderSpacing.Top = 15
Caption = 'DragThresholdLabel'
ParentColor = False
ParentFont = False
@ -29,15 +30,15 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 10
Height = 47
Top = 23
Width = 404
Left = 15
Height = 70
Top = 38
Width = 606
Max = 20
OnChange = DragThresholdTrackBarChange
Position = 0
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 10
BorderSpacing.Right = 15
ParentFont = False
ParentShowHint = False
ShowHint = True
@ -48,12 +49,12 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
Left = 111
Height = 21
Top = 6
Width = 60
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Left = 182
Height = 33
Top = 9
Width = 90
BorderSpacing.Left = 9
BorderSpacing.Top = 9
MaxValue = 20
ParentFont = False
TabOrder = 0
@ -63,11 +64,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = DragThresholdLabel
AnchorSideTop.Control = DragThresholdTrackBar
AnchorSideTop.Side = asrBottom
Left = 10
Height = 13
Top = 80
Width = 87
BorderSpacing.Top = 10
Left = 15
Height = 25
Top = 123
Width = 145
BorderSpacing.Top = 15
Caption = 'SplitterWidthLabel'
ParentColor = False
ParentFont = False
@ -78,10 +79,10 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = DragThresholdTrackBar
AnchorSideRight.Side = asrBottom
Left = 10
Height = 47
Top = 93
Width = 404
Left = 15
Height = 70
Top = 148
Width = 606
Min = 1
OnChange = SplitterWidthTrackBarChange
Position = 1
@ -95,11 +96,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = DragThresholdLabel
AnchorSideTop.Control = SplitterWidthTrackBar
AnchorSideTop.Side = asrBottom
Left = 10
Height = 17
Top = 144
Width = 137
BorderSpacing.Top = 4
Left = 15
Height = 29
Top = 224
Width = 214
BorderSpacing.Top = 6
Caption = 'ScaleOnResizeCheckBox'
ParentFont = False
ParentShowHint = False
@ -110,10 +111,10 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = ScaleOnResizeCheckBox
AnchorSideTop.Control = ScaleOnResizeCheckBox
AnchorSideTop.Side = asrBottom
Left = 10
Height = 17
Top = 161
Width = 128
Left = 15
Height = 29
Top = 253
Width = 202
Caption = 'ShowHeaderCheckBox'
OnChange = ShowHeaderCheckBoxChange
ParentFont = False
@ -125,11 +126,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = ScaleOnResizeCheckBox
AnchorSideTop.Control = ShowHeaderCheckBox
AnchorSideTop.Side = asrBottom
Left = 25
Height = 17
Top = 178
Width = 165
BorderSpacing.Left = 15
Left = 37
Height = 29
Top = 282
Width = 264
BorderSpacing.Left = 22
Caption = 'ShowHeaderCaptionCheckBox'
ParentFont = False
ParentShowHint = False
@ -140,10 +141,10 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = ShowHeaderCaptionCheckBox
AnchorSideTop.Control = ShowHeaderCaptionCheckBox
AnchorSideTop.Side = asrBottom
Left = 25
Height = 17
Top = 195
Width = 214
Left = 37
Height = 29
Top = 311
Width = 347
Caption = 'HideHeaderCaptionForFloatingCheckBox'
ParentFont = False
ParentShowHint = False
@ -157,14 +158,14 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 110
Height = 21
Top = 246
Width = 304
Left = 174
Height = 33
Top = 398
Width = 447
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Right = 10
ItemHeight = 13
BorderSpacing.Left = 9
BorderSpacing.Right = 15
ItemHeight = 25
OnDrawItem = HeaderStyleComboBoxDrawItem
ParentFont = False
Style = csDropDownList
@ -174,11 +175,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = ShowHeaderCheckBox
AnchorSideTop.Control = HeaderStyleComboBox
AnchorSideTop.Side = asrCenter
Left = 20
Height = 13
Top = 250
Width = 84
BorderSpacing.Left = 10
Left = 30
Height = 25
Top = 402
Width = 135
BorderSpacing.Left = 15
Caption = 'HeaderStyleLabel'
ParentColor = False
ParentFont = False
@ -187,10 +188,10 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = HideHeaderCaptionForFloatingCheckBox
AnchorSideTop.Control = HideHeaderCaptionForFloatingCheckBox
AnchorSideTop.Side = asrBottom
Left = 25
Height = 17
Top = 212
Width = 141
Left = 37
Height = 29
Top = 340
Width = 219
Caption = 'FlattenHeadersCheckBox'
ParentFont = False
ParentShowHint = False
@ -201,10 +202,10 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = FlattenHeadersCheckBox
AnchorSideTop.Control = FlattenHeadersCheckBox
AnchorSideTop.Side = asrBottom
Left = 25
Height = 17
Top = 229
Width = 131
Left = 37
Height = 29
Top = 369
Width = 207
Caption = 'FilledHeadersCheckBox'
ParentFont = False
ParentShowHint = False
@ -215,10 +216,10 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = FilledHeadersCheckBox
AnchorSideTop.Control = HeaderStyleComboBox
AnchorSideTop.Side = asrBottom
Left = 25
Height = 17
Top = 267
Width = 148
Left = 37
Height = 29
Top = 431
Width = 240
Caption = 'HighlightFocusedCheckBox'
ParentFont = False
ParentShowHint = False
@ -230,11 +231,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = SplitterWidthLabel
AnchorSideTop.Side = asrCenter
Left = 103
Height = 21
Top = 76
Width = 60
BorderSpacing.Left = 6
Left = 169
Height = 33
Top = 119
Width = 90
BorderSpacing.Left = 9
MaxValue = 10
MinValue = 1
ParentFont = False
@ -244,13 +245,13 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
end
object HeaderAlignTopLabel: TLabel
AnchorSideLeft.Control = DragThresholdLabel
AnchorSideTop.Control = DockSitesCanBeMinimized
AnchorSideTop.Control = FlatHeadersButtons
AnchorSideTop.Side = asrBottom
Left = 10
Height = 13
Top = 311
Width = 101
BorderSpacing.Top = 10
Left = 15
Height = 25
Top = 533
Width = 168
BorderSpacing.Top = 15
Caption = 'HeaderAlignTopLabel'
ParentColor = False
ParentFont = False
@ -261,17 +262,17 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = DragThresholdTrackBar
AnchorSideRight.Side = asrBottom
Left = 10
Height = 47
Top = 324
Width = 404
Left = 15
Height = 70
Top = 558
Width = 606
Frequency = 10
Max = 150
OnChange = HeaderAlignTopTrackBarChange
PageSize = 10
Position = 0
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 10
BorderSpacing.Left = 15
ParentFont = False
ParentShowHint = False
ShowHint = True
@ -282,11 +283,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = HeaderAlignTopLabel
AnchorSideTop.Side = asrCenter
Left = 117
Height = 21
Top = 307
Width = 60
BorderSpacing.Left = 6
Left = 192
Height = 33
Top = 529
Width = 90
BorderSpacing.Left = 9
MaxValue = 150
ParentFont = False
TabOrder = 12
@ -296,11 +297,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = DragThresholdLabel
AnchorSideTop.Control = HeaderAlignTopTrackBar
AnchorSideTop.Side = asrBottom
Left = 10
Height = 13
Top = 381
Width = 102
BorderSpacing.Top = 10
Left = 15
Height = 25
Top = 643
Width = 168
BorderSpacing.Top = 15
Caption = 'HeaderAlignLeftLabel'
ParentColor = False
ParentFont = False
@ -311,17 +312,17 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = DragThresholdTrackBar
AnchorSideRight.Side = asrBottom
Left = 10
Height = 47
Top = 394
Width = 404
Left = 15
Height = 70
Top = 668
Width = 606
Frequency = 10
Max = 200
OnChange = HeaderAlignLeftTrackBarChange
PageSize = 10
Position = 0
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 10
BorderSpacing.Left = 15
ParentFont = False
ParentShowHint = False
ShowHint = True
@ -332,11 +333,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = HeaderAlignLeftLabel
AnchorSideTop.Side = asrCenter
Left = 118
Height = 21
Top = 377
Width = 60
BorderSpacing.Left = 6
Left = 192
Height = 33
Top = 639
Width = 90
BorderSpacing.Left = 9
MaxValue = 200
ParentFont = False
TabOrder = 14
@ -346,10 +347,10 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = FilledHeadersCheckBox
AnchorSideTop.Control = HighlightFocusedCheckBox
AnchorSideTop.Side = asrBottom
Left = 25
Height = 17
Top = 284
Width = 142
Left = 37
Height = 29
Top = 460
Width = 234
Caption = 'DockSitesCanBeMinimized'
ParentFont = False
ParentShowHint = False
@ -360,11 +361,11 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = ShowHeaderCheckBox
AnchorSideTop.Control = HeaderAlignLeftTrackBar
AnchorSideTop.Side = asrBottom
Left = 10
Height = 17
Top = 445
Width = 137
BorderSpacing.Top = 4
Left = 15
Height = 29
Top = 744
Width = 219
BorderSpacing.Top = 6
Caption = 'MultiLinePagesCheckBox'
ParentFont = False
ParentShowHint = False
@ -375,15 +376,29 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
AnchorSideLeft.Control = DragThresholdLabel
AnchorSideTop.Control = MultiLinePagesCheckBox
AnchorSideTop.Side = asrBottom
Left = 10
Height = 17
Top = 466
Width = 133
BorderSpacing.Top = 4
Left = 15
Height = 29
Top = 779
Width = 218
BorderSpacing.Top = 6
Caption = 'FloatingWindowsOnTop'
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 18
end
object FlatHeadersButtons: TCheckBox
AnchorSideLeft.Control = FilledHeadersCheckBox
AnchorSideTop.Control = DockSitesCanBeMinimized
AnchorSideTop.Side = asrBottom
Left = 37
Height = 29
Top = 489
Width = 179
Caption = 'FlatHeadersButtons'
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 19
end
end

View File

@ -22,6 +22,7 @@ type
{ TAnchorDockOptionsFrame }
TAnchorDockOptionsFrame = class(TFrame)
FlatHeadersButtons: TCheckBox;
DragThresholdLabel: TLabel;
DragThresholdSpinEdit: TSpinEdit;
DragThresholdTrackBar: TTrackBar;
@ -202,7 +203,7 @@ begin
HeaderAlignTopSpinEdit.Visible:=true;
HeaderAlignTopTrackBar.Visible:=false;
HeaderAlignTopSpinEdit.AnchorToNeighbour(akTop,6,DockSitesCanBeMinimized);
HeaderAlignTopSpinEdit.AnchorToNeighbour(akTop,6,FlatHeadersButtons);
HeaderAlignTopLabel.AnchorVerticalCenterTo(HeaderAlignTopSpinEdit);
UpdateHeaderAlignTopLabel;
@ -233,6 +234,7 @@ begin
HeaderAlignLeftLabel.AnchorToNeighbour(akTop,6,HeaderAlignTopTrackBar);
UpdateHeaderAlignLeftLabel;
end;
FlatHeadersButtons.Enabled:={$IF DEFINED(MSWINDOWS)}True{$ELSE}False{$ENDIF};
UpdateHeaderOptions;
finally
EnableAlign;
@ -350,6 +352,7 @@ begin
TheSettings.SplitterWidth:=SplitterWidthTrackBar.Position;
end;
TheSettings.DockSitesCanBeMinimized:=DockSitesCanBeMinimized.Checked;
TheSettings.FlatHeadersButtons:=FlatHeadersButtons.Checked;
TheSettings.FloatingWindowsOnTop:=FloatingWindowsOnTop.Checked;
TheSettings.HeaderFilled:=FilledHeadersCheckBox.Checked;
TheSettings.HeaderFlatten:=FlattenHeadersCheckBox.Checked;
@ -441,6 +444,10 @@ begin
DockSitesCanBeMinimized.Caption:=adrsAllowDockSitesToBeMinimized;
DockSitesCanBeMinimized.Hint:=adrsAllowDockSitesToBeMinimized;
FlatHeadersButtons.Checked:=TheSettings.FlatHeadersButtons;
FlatHeadersButtons.Caption:=adrsFlatHeadersButtons;
FlatHeadersButtons.Hint:=adrsFlatHeadersButtonsHint;
MultiLinePagesCheckBox.Caption:=adrsMultiLinePages;
MultiLinePagesCheckBox.Hint:=adrsMultiLinePagesHint;
MultiLinePagesCheckBox.Checked:=TheSettings.MultiLinePages;

View File

@ -88,6 +88,8 @@ resourcestring
adrsMultiLinePagesHint = 'Tabs of pages can be shown in multiple lines';
adrsFloatingWindowsOnTop = 'Floating windows on top';
adrsFloatingWindowsOnTopHint = 'Show floating windows on top of main form';
adrsFlatHeadersButtons = 'Flat header buttons';
adrsFlatHeadersButtonsHint = 'Flat buttons in headers of docked controls';
implementation