mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-15 12:59:13 +00:00
服务器拖动排序:优化逻辑
This commit is contained in:
parent
617d5b1c86
commit
8aa3354b20
1 changed files with 39 additions and 38 deletions
|
@ -1679,17 +1679,14 @@ namespace v2rayN.Forms
|
|||
{
|
||||
targetIndex++;
|
||||
}
|
||||
string activeIndexId = ConfigHandler.GetDefaultServer(ref config).indexId;
|
||||
|
||||
bool isChanged = false;
|
||||
lvServers.BeginUpdate();
|
||||
foreach (ListViewItem listItem in lvServers.SelectedItems)
|
||||
{
|
||||
if (targetIndex == listItem.Index)
|
||||
if (targetIndex != listItem.Index)
|
||||
{
|
||||
targetIndex++;
|
||||
continue;
|
||||
}
|
||||
|
||||
isChanged = true;
|
||||
int origIndex = listItem.Index;
|
||||
bool isFocued = listItem.Focused;
|
||||
|
||||
|
@ -1707,13 +1704,14 @@ namespace v2rayN.Forms
|
|||
{
|
||||
listItem.Focused = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
targetIndex++;
|
||||
}
|
||||
|
||||
if (isChanged)
|
||||
{
|
||||
RefillListViewBackColor(lvServers);
|
||||
lvServers.EndUpdate();
|
||||
|
||||
|
||||
for (int i = 0; i < lvServers.Items.Count; i++)
|
||||
{
|
||||
|
@ -1729,6 +1727,9 @@ namespace v2rayN.Forms
|
|||
RefreshServersMenu();
|
||||
|
||||
//RefreshServers();
|
||||
}
|
||||
|
||||
lvServers.EndUpdate();
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue