fix: tab splitter visible issue

This commit is contained in:
leo 2024-06-06 17:17:58 +08:00
parent 4610f702b3
commit b0c14ab3e4
No known key found for this signature in database
GPG key ID: B528468E49CD0E58

View file

@ -23,9 +23,21 @@ namespace SourceGit.Converters
return false;
var selected = array[1] as ViewModels.LauncherPage;
var collections = array[2] as AvaloniaList<ViewModels.LauncherPage>;
if (selected == null)
return true;
return selected != null && collections != null && (self == selected || collections.IndexOf(self) + 1 == collections.IndexOf(selected));
var collections = array[2] as AvaloniaList<ViewModels.LauncherPage>;
if (collections == null)
return true;
if (self == selected)
return false;
var selfIdx = collections.IndexOf(self);
if (selfIdx == collections.Count - 1)
return true;
return collections[selfIdx + 1] != selected;
});
}
}