UPD: Use Notebook.Multiline property, remove old workaround.

This commit is contained in:
cobines 2010-10-28 16:25:40 +00:00
commit d88aed82d4
2 changed files with 3 additions and 43 deletions

View file

@ -644,6 +644,7 @@ procedure TfrmMain.FormCreate(Sender: TObject);
function CreateNotebook(aParent: TWinControl; aSide: TFilePanelSelect): TFileViewNotebook;
begin
Result := TFileViewNotebook.Create(aParent, aSide);
Result.Options := [nboHidePageListPopup];
Result.OnCloseTabClicked := @NotebookCloseTabClicked;
Result.OnMouseDown := @nbPageMouseDown;
@ -702,10 +703,6 @@ begin
lastWindowState:=WindowState;
// frost_asm end
// Tabs
nbLeft.Options:=[nboHidePageListPopup];
nbRight.Options:=[nboHidePageListPopup];
actShowSysFiles.Checked:=uGlobs.gShowSystemFiles;
AllowDropFiles := not uDragDropEx.IsExternalDraggingSupported;
@ -3373,7 +3370,8 @@ procedure TfrmMain.UpdateWindowView;
NoteBook.Options := NoteBook.Options - [nboShowCloseButtons];
end;
NoteBook.MultilineTabs := tb_multiple_lines in gDirTabOptions;
if nbcMultiline in NoteBook.GetCapabilities then
NoteBook.MultiLine := tb_multiple_lines in gDirTabOptions;
case gDirTabPosition of
tbpos_top: NoteBook.TabPosition := tpTop;

View file

@ -74,8 +74,6 @@ type
function GetFileViewOnPage(Index: Integer): TFileView;
function GetPage(Index: Integer): TFileViewPage;
procedure SetMultilineTabs(aMultiline: Boolean);
procedure DragOverEvent(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
procedure DragDropEvent(Sender, Source: TObject; X, Y: Integer);
@ -105,7 +103,6 @@ type
property OnDblClick;
property OnMouseDown;
property OnMouseUp;
property MultilineTabs: Boolean write SetMultilineTabs;
end;
implementation
@ -261,32 +258,6 @@ begin
Result := TFileViewPage(CustomPage(Index));
end;
procedure TFileViewNotebook.SetMultilineTabs(aMultiline: Boolean);
begin
if (nbcMultiline in GetCapabilities) and
// If different then current setting
(aMultiline <> (nboMultiline in Options)) then
begin
if aMultiline then
Options := Options + [nboMultiLine]
else
Options := Options - [nboMultiLine];
// Workaround: nboMultiline property is currently not updated by LCL.
// Force update and realign all pages.
TWSCustomNotebookClass(Self.WidgetSetClass).UpdateProperties(Self);
if ClientRectNeedsInterfaceUpdate then
begin
// Change sizes of pages, because multiline tabs may
// take up different amount of space than single line.
InvalidateClientRectCache(True);
ReAlign;
end;
end;
end;
function TFileViewNotebook.AddPage(aCaption: String): TFileViewPage;
begin
Result := InsertPage(PageCount, aCaption);
@ -319,15 +290,6 @@ begin
Pages.Delete(Index);
if (nboMultiLine in Options) and
ClientRectNeedsInterfaceUpdate then
begin
// The height of the tabs (nr of lines) has changed.
// Recalculate size of each page.
InvalidateClientRectCache(False);
ReAlign;
end;
ShowTabs:= ((PageCount > 1) or (tb_always_visible in gDirTabOptions)) and gDirectoryTabs;
{$IFNDEF LCLGTK2}