mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:19:18 +02:00
anchordocking: do not draw disabled splitters
anchordockingdsgn: disable and make MainIDEBar splitter smaller if AdjustHeight is enabled git-svn-id: trunk@51121 -
This commit is contained in:
parent
8005aedc44
commit
dd5a0c7dd9
@ -169,6 +169,7 @@ type
|
||||
|
||||
TAnchorDockSplitter = class(TCustomSplitter)
|
||||
private
|
||||
FCustomWidth: Boolean;
|
||||
FDockBounds: TRect;
|
||||
FDockParentClientSize: TSize;
|
||||
FDockRestoreBounds: TRect;
|
||||
@ -178,6 +179,7 @@ type
|
||||
protected
|
||||
procedure SetResizeAnchor(const AValue: TAnchorKind); override;
|
||||
procedure PopupMenuPopup(Sender: TObject); virtual;
|
||||
procedure Paint; override;
|
||||
public
|
||||
procedure MoveSplitter(Offset: integer); override;
|
||||
public
|
||||
@ -193,6 +195,7 @@ type
|
||||
procedure SaveLayout(LayoutNode: TAnchorDockLayoutTreeNode);
|
||||
function HasOnlyOneSibling(Side: TAnchorKind; MinPos, MaxPos: integer): TControl;
|
||||
property DockRestoreBounds: TRect read FDockRestoreBounds write FDockRestoreBounds;
|
||||
property CustomWidth: Boolean read FCustomWidth write FCustomWidth;
|
||||
end;
|
||||
TAnchorDockSplitterClass = class of TAnchorDockSplitter;
|
||||
|
||||
@ -2188,10 +2191,13 @@ begin
|
||||
for i:=0 to ComponentCount-1 do begin
|
||||
Splitter:=TAnchorDockSplitter(Components[i]);
|
||||
if not (Splitter is TAnchorDockSplitter) then continue;
|
||||
if Splitter.ResizeAnchor in [akLeft,akRight] then
|
||||
Splitter.Width:=SplitterWidth
|
||||
else
|
||||
Splitter.Height:=SplitterWidth;
|
||||
if not Splitter.CustomWidth then
|
||||
begin
|
||||
if Splitter.ResizeAnchor in [akLeft,akRight] then
|
||||
Splitter.Width:=SplitterWidth
|
||||
else
|
||||
Splitter.Height:=SplitterWidth;
|
||||
end;
|
||||
end;
|
||||
OptionsChanged;
|
||||
end;
|
||||
@ -6199,6 +6205,17 @@ begin
|
||||
UpdatePercentPosition;
|
||||
end;
|
||||
|
||||
procedure TAnchorDockSplitter.Paint;
|
||||
begin
|
||||
if Enabled then
|
||||
inherited Paint
|
||||
else
|
||||
begin
|
||||
Canvas.Brush.Color := clDefault;
|
||||
Canvas.FillRect(ClientRect);
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TAnchorDockSplitter.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
|
@ -270,6 +270,14 @@ begin
|
||||
Exit;
|
||||
|
||||
Site.BoundSplitter.Enabled := not AAdjustHeight;
|
||||
Site.BoundSplitter.CustomWidth := not Site.BoundSplitter.Enabled;
|
||||
if Site.BoundSplitter.Enabled then
|
||||
Site.BoundSplitter.Height := DockMaster.SplitterWidth
|
||||
else
|
||||
begin
|
||||
Site.BoundSplitter.Constraints.MinHeight := 2;
|
||||
Site.BoundSplitter.Height := Site.BoundSplitter.Constraints.MinHeight;
|
||||
end;
|
||||
SiteNewHeight := Site.Parent.ClientHeight - ANewHeight - Site.BoundSplitter.Height;
|
||||
if AAdjustHeight and (Site.Height <> SiteNewHeight) then
|
||||
Site.Height := SiteNewHeight;
|
||||
|
Loading…
Reference in New Issue
Block a user