feature: supports to search/filter tags (#215)

This commit is contained in:
leo 2024-06-27 21:43:15 +08:00
parent 575f902a5d
commit f8c4137c78
No known key found for this signature in database
6 changed files with 50 additions and 7 deletions

View file

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using Avalonia;
@ -279,6 +280,18 @@ namespace SourceGit.Views
e.Handled = true;
}
private void OnTagPropertyChanged(object sender, AvaloniaPropertyChangedEventArgs e)
{
if (e.Property == DataGrid.ItemsSourceProperty && DataContext is ViewModels.Repository vm)
{
if (vm.VisibleTags == null)
return;
var desiredHeight = tagsList.RowHeight * vm.VisibleTags.Count;
tagsList.Height = Math.Min(200, desiredHeight);
}
}
private void OnToggleFilter(object sender, RoutedEventArgs e)
{
if (sender is ToggleButton toggle)