Skip to content

Commit ada83dd

Browse files
committed
feat: add virtual scroll config
1 parent 7f0186f commit ada83dd

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

TelegramDownloader/Models/GeneralConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public class GeneralConfig
8585
public bool ShouldShowCaptionPath { get; set; } = false;
8686
public bool ShouldShowLogInTerminal { get; set; } = false;
8787
public bool ShouldShowPaginatedFileChannel { get; set; } = false;
88+
public bool hasFileManagerVirtualScroll { get; set; } = false;
8889
public List<long> FavouriteChannels { get; set; } = new List<long>();
8990
public WebDavModel webDav { get; set; } = new WebDavModel();
9091

TelegramDownloader/Pages/Config.razor

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,23 @@
7878
</div>
7979

8080

81+
</div>
82+
83+
<div>
84+
<div class="form-check form-switch">
85+
<InputCheckbox @bind-Value="Model!.hasFileManagerVirtualScroll" class="form-check-input" type="checkbox" id="hasFileManagerVirtualScroll" />
86+
<label class="form-check-label" for="hasFileManagerVirtualScroll">File manager virtual scroll</label>
87+
</div>
88+
89+
8190
</div>
8291

8392
<div>
8493
<div class="input-group mb-3">
8594
<span class="input-group-text"><i class="bi bi-upload"></i></span>
8695
<div class="form-floating">
8796
<NumberInput TValue="int" @bind-Value="Model!.MaxImageUploadSizeInMb" Min="0" Max="10" EnableMinMax="true" class="form-control" id="MaxImageUploadSizeInMb" placeholder="Max. Image Size" />
88-
<label for="MaxImageUploadSizeInMb">Max. Image File Size to send as Image (if 0, All images will be sent as a file)</label>
97+
<label for="MaxImageUploadSizeInMb">Max. Image File Size (Mb) to send as Image (if 0, All images will be sent as a file)</label>
8998
</div>
9099

91100
</div>
@@ -96,7 +105,7 @@
96105
<span class="input-group-text"><i class="bi bi-download"></i></span>
97106
<div class="form-floating">
98107
<NumberInput TValue="int" @bind-Value="Model!.MaxPreloadFileSizeInMb" Min="0" Max="10000" EnableMinMax="true" class="form-control" id="MaxPreloadFileSizeInMb" placeholder="Max. preload file size" />
99-
<label for="MaxPreloadFileSizeInMb">downloads the entire file when it weighs less than indicated</label>
108+
<label for="MaxPreloadFileSizeInMb">downloads the entire file when it weighs less than indicated (Mb)</label>
100109
</div>
101110

102111
</div>

TelegramDownloader/Pages/Partials/impl/FileManagerImpl.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@inject NavigationManager MyNavigationManager;
1818

1919

20-
<SfFileManager ID="remotefm" @ref="fm" TValue="FileManagerDirectoryContent" ShowThumbnail="false" SelectedItemsChanged="itemsChanged" AllowDragAndDrop="false" EnablePersistence="false" EnableVirtualization="true">
20+
<SfFileManager ID="remotefm" @ref="fm" TValue="FileManagerDirectoryContent" ShowThumbnail="false" SelectedItemsChanged="itemsChanged" AllowDragAndDrop="false" EnablePersistence="false" EnableVirtualization="@hasVirtualScroll">
2121

2222

2323
<FileManagerEvents TValue="FileManagerDirectoryContent"
@@ -58,6 +58,7 @@
5858
public string chatName { get; set; }
5959
public static string[] selectedItems = new string[] { "" };
6060
public static bool downloadToServer = true;
61+
public static bool hasVirtualScroll { get; set; } = false;
6162
LocalFileManager lfm { get; set; }
6263
private VideoPlayerModal videoPlayer { get; set; } = default!;
6364

@@ -97,6 +98,7 @@
9798

9899
protected override async Task OnInitializedAsync()
99100
{
101+
hasVirtualScroll = GeneralConfigStatic.config.hasFileManagerVirtualScroll;
100102
if (!isShared)
101103
{
102104
isMyChannel = ts.isMyChat(Convert.ToInt64(id));

0 commit comments

Comments
 (0)