mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Fix issue #1159: Defaults editor in table editor partly hidden in bottom columns. Moves the defaults editor various calculated pixels to left and top so it fits into the client area.
This commit is contained in:
@@ -1045,8 +1045,7 @@ begin
|
||||
|
||||
FPanel := TPanel.Create(Tree);
|
||||
FPanel.Parent := FTree;
|
||||
FPanel.Left := TextBounds.Left;
|
||||
FPanel.Top := TextBounds.Top;
|
||||
SetBounds(TextBounds);
|
||||
FPanel.Width := 200;
|
||||
FPanel.ParentBackground := False;
|
||||
// usefull but looks ugly:
|
||||
@@ -1145,9 +1144,27 @@ end;
|
||||
|
||||
|
||||
procedure TColumnDefaultEditorLink.SetBounds(R: TRect); stdcall;
|
||||
var
|
||||
TreeBottom, TreeRight,
|
||||
PanelTop, PanelLeft: Integer;
|
||||
TreeRect: TRect;
|
||||
begin
|
||||
FPanel.Top := R.Top;
|
||||
FPanel.Left := R.Left;
|
||||
TreeRect := FTree.BoundsRect;
|
||||
|
||||
PanelTop := R.Top;
|
||||
TreeBottom := TreeRect.Bottom - TreeRect.Top -
|
||||
(FTree as TVirtualStringtree).Header.Height - 20; // Column header and scrollbar
|
||||
if R.Top + FPanel.Height > TreeBottom then
|
||||
PanelTop := Max(0, TreeBottom - FPanel.Height);
|
||||
|
||||
PanelLeft := R.Left;
|
||||
TreeRight := TreeRect.Right - TreeRect.Left - 20;
|
||||
mainform.LogSQL(inttostr(treeright));
|
||||
if R.Left + FPanel.Width > TreeRight then
|
||||
PanelLeft := Max(0, TreeRight - FPanel.Width);
|
||||
|
||||
FPanel.Top := PanelTop;
|
||||
FPanel.Left := PanelLeft;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user