mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Redo resizing of console window so that command line panel can be properly autosized.
This commit is contained in:
parent
78599ef1e6
commit
7e6dbefd67
2 changed files with 61 additions and 64 deletions
|
|
@ -1,10 +1,10 @@
|
|||
object frmMain: TfrmMain
|
||||
Left = 88
|
||||
Left = 378
|
||||
Height = 370
|
||||
Top = 116
|
||||
Top = 100
|
||||
Width = 760
|
||||
Caption = 'Double Commander'
|
||||
ClientHeight = 350
|
||||
ClientHeight = 343
|
||||
ClientWidth = 760
|
||||
Color = clForm
|
||||
KeyPreview = True
|
||||
|
|
@ -53,6 +53,7 @@ object frmMain: TfrmMain
|
|||
ClientWidth = 760
|
||||
FullRepaint = False
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
object pnlDisk: TPanel
|
||||
Left = 235
|
||||
Height = 26
|
||||
|
|
@ -120,24 +121,24 @@ object frmMain: TfrmMain
|
|||
end
|
||||
object pnlNotebooks: TPanel
|
||||
Left = 0
|
||||
Height = 219
|
||||
Height = 212
|
||||
Top = 46
|
||||
Width = 760
|
||||
Align = alClient
|
||||
ClientHeight = 219
|
||||
ClientHeight = 212
|
||||
ClientWidth = 760
|
||||
FullRepaint = False
|
||||
TabOrder = 1
|
||||
object pnlLeft: TPanel
|
||||
AnchorSideBottom.Control = PanelAllProgress
|
||||
Left = 1
|
||||
Height = 11
|
||||
Height = 86
|
||||
Top = 1
|
||||
Width = 511
|
||||
Align = alLeft
|
||||
BorderSpacing.Right = 3
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 11
|
||||
ClientHeight = 86
|
||||
ClientWidth = 511
|
||||
TabOrder = 0
|
||||
OnDblClick = pnlLeftRightDblClick
|
||||
|
|
@ -251,13 +252,13 @@ object frmMain: TfrmMain
|
|||
end
|
||||
object pnlRight: TPanel
|
||||
Left = 515
|
||||
Height = 11
|
||||
Height = 86
|
||||
Top = 1
|
||||
Width = 244
|
||||
Align = alClient
|
||||
BorderSpacing.Left = 3
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 11
|
||||
ClientHeight = 86
|
||||
ClientWidth = 244
|
||||
TabOrder = 1
|
||||
OnDblClick = pnlLeftRightDblClick
|
||||
|
|
@ -364,48 +365,54 @@ object frmMain: TfrmMain
|
|||
end
|
||||
end
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
object ConsoleSplitter: TSplitter
|
||||
AnchorSideLeft.Control = pnlNotebooks
|
||||
AnchorSideRight.Control = pnlNotebooks
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = pnlCommand
|
||||
Cursor = crVSplit
|
||||
Left = 1
|
||||
Height = 4
|
||||
Top = 45
|
||||
Height = 3
|
||||
Top = 119
|
||||
Width = 758
|
||||
Align = alBottom
|
||||
Align = alNone
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
OnChangeBounds = ConsoleSplitterChangeBounds
|
||||
ResizeAnchor = akBottom
|
||||
Visible = False
|
||||
end
|
||||
object pnlCommand: TPanel
|
||||
Left = 1
|
||||
Height = 169
|
||||
Top = 49
|
||||
Height = 89
|
||||
Top = 122
|
||||
Width = 758
|
||||
Align = alBottom
|
||||
Anchors = [akLeft, akRight]
|
||||
AutoSize = True
|
||||
BevelOuter = bvLowered
|
||||
ClientHeight = 169
|
||||
ClientHeight = 89
|
||||
ClientWidth = 758
|
||||
FullRepaint = False
|
||||
TabOrder = 2
|
||||
object Panel1: TPanel
|
||||
object pnlCmdLine: TPanel
|
||||
Left = 1
|
||||
Height = 25
|
||||
Top = 143
|
||||
Height = 33
|
||||
Top = 55
|
||||
Width = 756
|
||||
Align = alBottom
|
||||
Align = alClient
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
ChildSizing.TopBottomSpacing = 2
|
||||
ClientHeight = 25
|
||||
ClientHeight = 33
|
||||
ClientWidth = 756
|
||||
TabOrder = 0
|
||||
TabOrder = 1
|
||||
object lblCommandPath: TLabel
|
||||
AnchorSideTop.Control = edtCommand
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 0
|
||||
Height = 14
|
||||
Top = 5
|
||||
Width = 23
|
||||
Height = 20
|
||||
Top = 6
|
||||
Width = 30
|
||||
Caption = 'Path'
|
||||
ParentColor = False
|
||||
ShowAccelChar = False
|
||||
|
|
@ -413,16 +420,16 @@ object frmMain: TfrmMain
|
|||
object edtCommand: TComboBox
|
||||
AnchorSideLeft.Control = lblCommandPath
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Panel1
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideTop.Control = pnlCmdLine
|
||||
AnchorSideRight.Control = pnlCmdLine
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 27
|
||||
Height = 21
|
||||
Left = 34
|
||||
Height = 29
|
||||
Top = 2
|
||||
Width = 729
|
||||
Width = 722
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 4
|
||||
ItemHeight = 13
|
||||
ItemHeight = 0
|
||||
OnEnter = edtCommandEnter
|
||||
OnExit = edtCommandExit
|
||||
OnKeyDown = edtCommandKeyDown
|
||||
|
|
@ -432,15 +439,15 @@ object frmMain: TfrmMain
|
|||
end
|
||||
object nbConsole: TPageControl
|
||||
Left = 1
|
||||
Height = 142
|
||||
Height = 54
|
||||
Top = 1
|
||||
Width = 756
|
||||
TabStop = False
|
||||
ActivePage = pgConsole
|
||||
Align = alClient
|
||||
Align = alTop
|
||||
ShowTabs = False
|
||||
TabIndex = 0
|
||||
TabOrder = 1
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
object pgConsole: TTabSheet
|
||||
end
|
||||
|
|
@ -461,22 +468,17 @@ object frmMain: TfrmMain
|
|||
OnMouseUp = MainSplitterMouseUp
|
||||
end
|
||||
object PanelAllProgress: TPanel
|
||||
AnchorSideLeft.Control = pnlNotebooks
|
||||
AnchorSideTop.Control = pnlNotebooks
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = pnlNotebooks
|
||||
AnchorSideBottom.Control = Splitter1
|
||||
AnchorSideBottom.Control = ConsoleSplitter
|
||||
Left = 4
|
||||
Height = 32
|
||||
Top = 12
|
||||
Top = 87
|
||||
Width = 752
|
||||
Align = alBottom
|
||||
BorderSpacing.Left = 3
|
||||
BorderSpacing.Right = 3
|
||||
BorderSpacing.Bottom = 1
|
||||
BorderSpacing.Bottom = 3
|
||||
BorderSpacing.CellAlignHorizontal = ccaRightBottom
|
||||
BorderSpacing.CellAlignVertical = ccaCenter
|
||||
BidiMode = bdRightToLeft
|
||||
ClientHeight = 32
|
||||
ClientWidth = 752
|
||||
ParentBidiMode = False
|
||||
|
|
@ -502,7 +504,7 @@ object frmMain: TfrmMain
|
|||
object pnlKeys: TPanel
|
||||
Left = 0
|
||||
Height = 20
|
||||
Top = 330
|
||||
Top = 323
|
||||
Width = 760
|
||||
Align = alBottom
|
||||
Anchors = [akLeft, akRight]
|
||||
|
|
@ -516,6 +518,7 @@ object frmMain: TfrmMain
|
|||
ClientWidth = 760
|
||||
FullRepaint = False
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object btnF3: TSpeedButton
|
||||
Left = 0
|
||||
Height = 20
|
||||
|
|
@ -595,7 +598,7 @@ object frmMain: TfrmMain
|
|||
AnchorSideBottom.Control = PanelAllProgress
|
||||
Left = 0
|
||||
Height = 61
|
||||
Top = 269
|
||||
Top = 262
|
||||
Width = 760
|
||||
Align = alBottom
|
||||
Font.Height = -16
|
||||
|
|
@ -608,7 +611,7 @@ object frmMain: TfrmMain
|
|||
TabOrder = 4
|
||||
TabStop = False
|
||||
Visible = False
|
||||
Gutter.Width = 59
|
||||
Gutter.Width = 61
|
||||
Gutter.MouseActions = <
|
||||
item
|
||||
Shift = []
|
||||
|
|
@ -1110,7 +1113,7 @@ object frmMain: TfrmMain
|
|||
Width = 24
|
||||
end
|
||||
object SynGutterLineNumber1: TSynGutterLineNumber
|
||||
Width = 19
|
||||
Width = 21
|
||||
MouseActions = <>
|
||||
MarkupInfo.Background = clBtnFace
|
||||
MarkupInfo.Foreground = clNone
|
||||
|
|
@ -1217,7 +1220,7 @@ object frmMain: TfrmMain
|
|||
Cursor = crVSplit
|
||||
Left = 0
|
||||
Height = 4
|
||||
Top = 265
|
||||
Top = 258
|
||||
Width = 760
|
||||
Align = alBottom
|
||||
ResizeAnchor = akBottom
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ type
|
|||
mnuFileAssoc: TMenuItem;
|
||||
nbConsole: TPageControl;
|
||||
pgConsole: TTabSheet;
|
||||
Panel1: TPanel;
|
||||
pnlCmdLine: TPanel;
|
||||
MainSplitter: TPanel;
|
||||
pmButtonMenu: TKASBarMenu;
|
||||
MainToolBar: TKASToolBar;
|
||||
|
|
@ -276,7 +276,7 @@ type
|
|||
seLogWindow: TSynEdit;
|
||||
btnRightEqualLeft: TSpeedButton;
|
||||
btnLeftEqualRight: TSpeedButton;
|
||||
Splitter1: TSplitter;
|
||||
ConsoleSplitter: TSplitter;
|
||||
tbDelete: TMenuItem;
|
||||
tbEdit: TMenuItem;
|
||||
mnuMain: TMainMenu;
|
||||
|
|
@ -468,6 +468,7 @@ type
|
|||
Shift: TShiftState);
|
||||
procedure edtCommandEnter(Sender: TObject);
|
||||
procedure edtCommandExit(Sender: TObject);
|
||||
procedure ConsoleSplitterChangeBounds(Sender: TObject);
|
||||
procedure tbCopyClick(Sender: TObject);
|
||||
procedure tbEditClick(Sender: TObject);
|
||||
procedure FramePanelOnWatcherNotifyEvent(Sender: TObject; NotifyData: PtrInt);
|
||||
|
|
@ -3322,8 +3323,6 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmMain.ToggleConsole;
|
||||
var
|
||||
NewSize: Integer;
|
||||
begin
|
||||
if gTermWindow then
|
||||
begin
|
||||
|
|
@ -3343,8 +3342,6 @@ begin
|
|||
Cons.CmdBox:= cmdConsole;
|
||||
Cons.Resume;
|
||||
end;
|
||||
|
||||
NewSize := Panel1.Height + nbConsole.Height;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
@ -3355,20 +3352,10 @@ begin
|
|||
end;
|
||||
if Assigned(Cons) then
|
||||
FreeAndNil(Cons);
|
||||
|
||||
NewSize := Panel1.Height;
|
||||
end;
|
||||
|
||||
nbConsole.Visible:= gTermWindow;
|
||||
Splitter1.Visible:= gTermWindow;
|
||||
|
||||
// Bevel size is not taken into account when setting ClientHeight.
|
||||
if pnlCommand.BevelInner <> bvNone then
|
||||
NewSize := NewSize + pnlCommand.BevelWidth * 2;
|
||||
if pnlCommand.BevelOuter <> bvNone then
|
||||
NewSize := NewSize + pnlCommand.BevelWidth * 2;
|
||||
|
||||
pnlCommand.ClientHeight := NewSize;
|
||||
ConsoleSplitter.Visible:= gTermWindow;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ToggleFileSystemWatcher;
|
||||
|
|
@ -3624,6 +3611,13 @@ begin
|
|||
pnlCommand.Hide;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ConsoleSplitterChangeBounds(Sender: TObject);
|
||||
begin
|
||||
nbConsole.Height := nbConsole.Height +
|
||||
// How much splitter was moved upwards.
|
||||
(pnlCommand.Top - ConsoleSplitter.Top - ConsoleSplitter.Height);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.tbCopyClick(Sender: TObject);
|
||||
var
|
||||
I: Integer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue