Skip to content

Commit 8ca54ad

Browse files
committed
fix: #807
1 parent 03b978f commit 8ca54ad

File tree

3 files changed

+5
-30
lines changed

3 files changed

+5
-30
lines changed

Ui/View/Host/ProtocolHosts/FileTransmitHost.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
ItemsSource="{Binding RemoteItems}"
108108
SelectedItem="{Binding SelectedRemoteItem}"
109109
SelectionChanged="TvFileList_OnSelectionChanged"
110-
PreviewMouseDown="TvFileList_OnPreviewMouseDown"
111110
PreviewKeyDown="TvFileList_OnKeyDown"
112111
MouseDoubleClick="TvFileList_OnMouseDoubleClick"
113112
PreviewMouseRightButtonDown="FileList_OnPreviewMouseRightButtonDown"
@@ -638,9 +637,9 @@
638637

639638

640639

641-
<Grid Name="GridLoading" Visibility="{Binding GridLoadingVisibility}">
640+
<!--<Grid Name="GridLoading" Visibility="{Binding GridLoadingVisibility}">
642641
<Grid Background="Black" Opacity="{Binding GridLoadingBgOpacity}"></Grid>
643642
<Control Style="{StaticResource BusyAnimationStyle}" Background="Transparent"/>
644-
</Grid>
643+
</Grid>-->
645644
</Grid>
646645
</protocolHosts1:HostBase>

Ui/View/Host/ProtocolHosts/FileTransmitHost.xaml.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ private FileTransmitHost(ProtocolBase protocolServer) : base(protocolServer, fal
5454

5555
_vmRemote.PropertyChanged += (sender, args) =>
5656
{
57-
if (args.PropertyName == nameof(VmFileTransmitHost.SelectedRemoteItem))
57+
if (args.PropertyName == nameof(VmFileTransmitHost.SelectedRemoteItem)
58+
&& _vmRemote.SelectedRemoteItem != null)
5859
{
59-
TvFileList.ScrollIntoView(TvFileList.SelectedItem);
60+
TvFileList.ScrollIntoView(_vmRemote.SelectedRemoteItem);
6061
}
6162
};
6263

@@ -168,11 +169,6 @@ private void FileList_OnPreviewMouseRightButtonDown(object sender, MouseButtonEv
168169
_vmRemote.FileList_OnPreviewMouseRightButtonDown(sender, e);
169170
}
170171

171-
private void TvFileList_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
172-
{
173-
_vmRemote.TvFileList_OnPreviewMouseDown(sender, e);
174-
}
175-
176172
private void TvFileList_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
177173
{
178174
_vmRemote.CmdEndRenaming.Execute();

Ui/View/Host/ProtocolHosts/VmFileTransmitHost.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -278,26 +278,6 @@ private void ShowFolder(string path, int mode = 0, bool showIoMessage = true)
278278
t.Start();
279279
}
280280

281-
public void TvFileList_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
282-
{
283-
ListView? view = null;
284-
ScrollContentPresenter? p = null;
285-
if (sender is ListView lv)
286-
{
287-
view = lv;
288-
var ip = MyVisualTreeHelper.FindVisualChild<ItemsPresenter>(view);
289-
p = MyVisualTreeHelper.FindVisualChild<ScrollContentPresenter>((DependencyObject)ip!);
290-
}
291-
if (view == null || p == null)
292-
return;
293-
var curSelectedItem = MyVisualTreeHelper.GetItemOnPosition(p, e.GetPosition(p));
294-
if (curSelectedItem == null)
295-
{
296-
((ListView)sender).SelectedItem = null;
297-
}
298-
e.Handled = false;
299-
}
300-
301281
public void FileList_OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
302282
{
303283
ListView? view = null;

0 commit comments

Comments
 (0)