Hide title when title width is equal to 0

pull/3530/head
2dust 2023-03-20 15:23:29 +08:00
parent 30bc9ded29
commit b1a82d95c2
1 changed files with 11 additions and 4 deletions

View File

@ -197,7 +197,7 @@ namespace v2rayN.Views
{ {
WindowState = WindowState.Minimized; WindowState = WindowState.Minimized;
} }
if (!_config.guiItem.enableHWA) if (!_config.guiItem.enableHWA)
{ {
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
@ -445,8 +445,15 @@ namespace v2rayN.Views
var item2 = (MyDGTextColumn)lstProfiles.Columns[k]; var item2 = (MyDGTextColumn)lstProfiles.Columns[k];
if (item2.ExName == item.Name) if (item2.ExName == item.Name)
{ {
item2.Width = item.Width; if (item.Width <= 0)
item2.DisplayIndex = i + 1; {
item2.Visibility = Visibility.Hidden;
}
else
{
item2.Width = item.Width;
item2.DisplayIndex = i + 1;
}
} }
} }
} }
@ -471,7 +478,7 @@ namespace v2rayN.Views
lvColumnItem.Add(new() lvColumnItem.Add(new()
{ {
Name = item2.ExName, Name = item2.ExName,
Width = Convert.ToInt32(item2.ActualWidth), Width = item2.Visibility == Visibility.Visible ? Convert.ToInt32(item2.ActualWidth) : 0,
Index = item2.DisplayIndex Index = item2.DisplayIndex
}); });
} }