mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Don't change disk toolbar size and position according to file panels splitter
This commit is contained in:
parent
2782b26b07
commit
aad26e8f14
3 changed files with 46 additions and 17 deletions
|
|
@ -82,6 +82,7 @@ object frmMain: TfrmMain
|
|||
Align = alTop
|
||||
AutoSize = True
|
||||
EdgeBorders = [ebTop, ebBottom]
|
||||
OnResize = pnlDiskResize
|
||||
Visible = False
|
||||
object pnlDskLeft: TPanel
|
||||
AnchorSideLeft.Control = pnlDisk
|
||||
|
|
|
|||
|
|
@ -604,6 +604,7 @@ type
|
|||
procedure miTrayIconExitClick(Sender: TObject);
|
||||
procedure miTrayIconRestoreClick(Sender: TObject);
|
||||
procedure PanelButtonClick(Button: TSpeedButton; FileView: TFileView);
|
||||
procedure pnlDiskResize(Sender: TObject);
|
||||
procedure ShellTreeViewSelect;
|
||||
procedure ShellTreeViewKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
|
|
@ -1713,6 +1714,24 @@ begin
|
|||
SetActiveFrame(FileView);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.pnlDiskResize(Sender: TObject);
|
||||
var
|
||||
AWidth: Integer;
|
||||
begin
|
||||
if not gDriveBarSyncWidth then
|
||||
begin
|
||||
if gDriveBar1 and gDriveBar2 then
|
||||
AWidth:= Max(0, pnlDisk.ClientWidth div 2)
|
||||
else begin
|
||||
AWidth:= Max(0, pnlDisk.ClientWidth);
|
||||
end;
|
||||
pnlDskLeft.Constraints.MinWidth:= AWidth;
|
||||
pnlDskLeft.Constraints.MaxWidth:= AWidth;
|
||||
pnlDskRight.Constraints.MinWidth:= AWidth;
|
||||
pnlDskRight.Constraints.MaxWidth:= AWidth;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ShellTreeViewSelect;
|
||||
begin
|
||||
ShellTreeView.Tag := 1;
|
||||
|
|
@ -4254,10 +4273,13 @@ end;
|
|||
|
||||
procedure TfrmMain.pnlLeftResize(Sender: TObject);
|
||||
begin
|
||||
if gDriveBar1 and gDriveBar2 and not gHorizontalFilePanels then
|
||||
if gDriveBarSyncWidth then
|
||||
begin
|
||||
pnlDskLeft.Constraints.MinWidth:= pnlLeft.Width;
|
||||
pnlDskLeft.Constraints.MaxWidth:= pnlLeft.Width;
|
||||
if gDriveBar1 and gDriveBar2 and not gHorizontalFilePanels then
|
||||
begin
|
||||
pnlDskLeft.Constraints.MinWidth:= pnlLeft.Width;
|
||||
pnlDskLeft.Constraints.MaxWidth:= pnlLeft.Width;
|
||||
end;
|
||||
end;
|
||||
|
||||
// Put splitter after left panel.
|
||||
|
|
@ -4357,22 +4379,25 @@ procedure TfrmMain.pnlRightResize(Sender: TObject);
|
|||
var
|
||||
AWidth: Integer;
|
||||
begin
|
||||
if gDriveBar1 and not gHorizontalFilePanels then
|
||||
if gDriveBarSyncWidth then
|
||||
begin
|
||||
if gDriveBar2 then
|
||||
AWidth := pnlRight.Width + 1
|
||||
else begin
|
||||
AWidth := pnlNotebooks.Width - 2;
|
||||
if gDriveBar1 and not gHorizontalFilePanels then
|
||||
begin
|
||||
if gDriveBar2 then
|
||||
AWidth := pnlRight.Width + 1
|
||||
else begin
|
||||
AWidth := pnlNotebooks.Width - 2;
|
||||
end;
|
||||
if AWidth < 0 then AWidth := 0;
|
||||
pnlDskRight.Constraints.MinWidth := AWidth;
|
||||
pnlDskRight.Constraints.MaxWidth := AWidth;
|
||||
end
|
||||
else if gHorizontalFilePanels and not gDriveBar2 then
|
||||
begin
|
||||
AWidth := Max(0, pnlNotebooks.Width - 2);
|
||||
pnlDskRight.Constraints.MinWidth := AWidth;
|
||||
pnlDskRight.Constraints.MaxWidth := AWidth;
|
||||
end;
|
||||
if AWidth < 0 then AWidth := 0;
|
||||
pnlDskRight.Constraints.MinWidth := AWidth;
|
||||
pnlDskRight.Constraints.MaxWidth := AWidth;
|
||||
end
|
||||
else if gHorizontalFilePanels and not gDriveBar2 then
|
||||
begin
|
||||
AWidth := Max(0, pnlNotebooks.Width - 2);
|
||||
pnlDskRight.Constraints.MinWidth := AWidth;
|
||||
pnlDskRight.Constraints.MaxWidth := AWidth;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -5521,6 +5546,7 @@ begin
|
|||
dskRight.Parent := pnlDskRight;
|
||||
end;
|
||||
|
||||
pnlDiskResize(pnlDisk);
|
||||
pnlRightResize(pnlRight);
|
||||
|
||||
dskLeft.GlyphSize:= gDiskIconsSize;
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ var
|
|||
gDriveBar1,
|
||||
gDriveBar2,
|
||||
gDriveBarFlat,
|
||||
gDriveBarSyncWidth,
|
||||
gDrivesListButton,
|
||||
gDirectoryTabs,
|
||||
gCurDir,
|
||||
|
|
@ -1874,6 +1875,7 @@ begin
|
|||
gDriveBar2 := True;
|
||||
gDriveBarFlat := True;
|
||||
gDrivesListButton := True;
|
||||
gDriveBarSyncWidth := False;
|
||||
gDirectoryTabs := True;
|
||||
gCurDir := True;
|
||||
gTabHeader := True;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue