Skip to content

Commit

Permalink
revert to older virtualtreeview due to various bug on new virtualtree…
Browse files Browse the repository at this point in the history
…view
  • Loading branch information
riderkick committed May 9, 2015
1 parent e8f195f commit e9440c3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 31 deletions.
12 changes: 2 additions & 10 deletions mangadownloader/forms/frmMain.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ object MainForm: TMainForm
Height = 484
Top = 12
Width = 614
ActivePage = tsDownload
ActivePage = tsFavorites
Align = alClient
BorderSpacing.Top = 4
BorderSpacing.Right = 4
BorderSpacing.Bottom = 4
Font.Style = [fsBold]
ParentFont = False
TabIndex = 0
TabIndex = 3
TabOrder = 0
OnChange = pcMainChange
object tsDownload: TTabSheet
Expand All @@ -66,7 +66,6 @@ object MainForm: TMainForm
BorderSpacing.Top = 4
BorderSpacing.Right = 4
BorderSpacing.Bottom = 3
Colors.UnfocusedColor = clMedGray
DefaultText = 'Node'
DragOperations = [doMove]
Header.AutoSizeIndex = 0
Expand Down Expand Up @@ -384,13 +383,11 @@ object MainForm: TMainForm
Top = 2
Width = 562
Anchors = [akTop, akLeft, akRight, akBottom]
Colors.UnfocusedColor = clMedGray
Colors.UnfocusedSelectionColor = clHighlight
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <>
Header.DefaultHeight = 17
Header.Height = 17
Header.MainColumn = -1
IncrementalSearch = isVisibleOnly
Margin = 2
Expand Down Expand Up @@ -1375,7 +1372,6 @@ object MainForm: TMainForm
BorderSpacing.Left = 2
BorderSpacing.Top = 4
BorderSpacing.Right = 4
Colors.UnfocusedColor = clMedGray
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
Expand Down Expand Up @@ -2294,12 +2290,10 @@ object MainForm: TMainForm
BorderSpacing.Right = 2
BorderSpacing.Bottom = 2
BorderSpacing.Around = 2
Colors.UnfocusedColor = clMedGray
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <>
Header.DefaultHeight = 17
Header.Height = 17
Header.MainColumn = -1
IncrementalSearch = isVisibleOnly
Margin = 0
Expand Down Expand Up @@ -2593,12 +2587,10 @@ object MainForm: TMainForm
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Right = 2
BorderSpacing.Around = 2
Colors.UnfocusedColor = clMedGray
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <>
Header.DefaultHeight = 17
Header.Height = 17
Header.MainColumn = -1
HintMode = hmHint
IncrementalSearch = isAll
Expand Down
41 changes: 20 additions & 21 deletions mangadownloader/forms/frmMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ TMainForm = class(TForm)
var Ghosted: Boolean; var ImageIndex: Integer);
procedure vtDownloadGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: String);
procedure vtDownloadHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo
);
procedure vtDownloadHeaderClick(Sender: TVTHeader; Column: TColumnIndex;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure vtDownloadInitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
procedure vtDownloadKeyDown(Sender : TObject; var Key : Word;
Expand All @@ -447,8 +447,8 @@ TMainForm = class(TForm)
var Ghosted: Boolean; var ImageIndex: Integer);
procedure vtFavoritesGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: String);
procedure vtFavoritesHeaderClick(Sender: TVTHeader;
HitInfo: TVTHeaderHitInfo);
procedure vtFavoritesHeaderClick(Sender: TVTHeader; Column: TColumnIndex;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure vtFavoritesInitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
procedure vtMangaListChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
Expand Down Expand Up @@ -3369,22 +3369,20 @@ procedure TMainForm.vtDownloadGetText(Sender: TBaseVirtualTree;
end;

procedure TMainForm.vtDownloadHeaderClick(Sender: TVTHeader;
HitInfo: TVTHeaderHitInfo);
Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X, Y: Integer
);
begin
if (not (HitInfo.Column = 2)) and (DLManager.containers.Count > 1) then
if (not (Column = 2)) and (DLManager.containers.Count > 1) then
begin
with HitInfo do try
DLManager.SortColumn := Column;
DLManager.SortDirection := not DLManager.SortDirection;
vtDownload.Header.SortDirection := TSortDirection(DLManager.SortDirection);
vtDownload.Header.SortColumn := Column;
//DLManager.Sort(Column);
DLManager.SortNatural(Column); //Natural Sorting
options.WriteInteger('misc', 'SortDownloadColumn', vtDownload.Header.SortColumn);
options.WriteBool('misc', 'SortDownloadDirection', DLManager.SortDirection);
finally
vtDownload.Repaint;
end;
DLManager.SortColumn := Column;
DLManager.SortDirection := not DLManager.SortDirection;
vtDownload.Header.SortDirection := TSortDirection(DLManager.SortDirection);
vtDownload.Header.SortColumn := Column;
//DLManager.Sort(Column);
DLManager.SortNatural(Column); //Natural Sorting
options.WriteInteger('misc', 'SortDownloadColumn', vtDownload.Header.SortColumn);
options.WriteBool('misc', 'SortDownloadDirection', DLManager.SortDirection);
vtDownload.Repaint;
end;
end;

Expand Down Expand Up @@ -3521,12 +3519,13 @@ procedure TMainForm.vtFavoritesGetText(Sender: TBaseVirtualTree;
end;

procedure TMainForm.vtFavoritesHeaderClick(Sender: TVTHeader;
HitInfo: TVTHeaderHitInfo);
Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X, Y: Integer
);
begin
if (not (HitInfo.Column = 0)) and (not FavoriteManager.isRunning) and (FavoriteManager.Count > 1) then
if (not (Column = 0)) and (not FavoriteManager.isRunning) and (FavoriteManager.Count > 1) then
begin
FavoriteManager.isRunning := True;
with HitInfo do try
try
FavoriteManager.SortColumn := Column;
FavoriteManager.sortDirection := not FavoriteManager.sortDirection;
vtFavorites.Header.SortColumn := Column;
Expand Down

0 comments on commit e9440c3

Please sign in to comment.