enhance: cleanup unused resources
Some checks are pending
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions
Localization Check / localization-check (push) Waiting to run

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-18 22:00:35 +08:00
parent b78f6b0ea8
commit aff003fd6d
No known key found for this signature in database
8 changed files with 51 additions and 26 deletions

View file

@ -19,7 +19,7 @@ namespace SourceGit.Views
get => GetValue(IsScrollerVisibleProperty);
set => SetValue(IsScrollerVisibleProperty, value);
}
public static readonly StyledProperty<string> SearchFilterProperty =
AvaloniaProperty.Register<LauncherTabBar, string>(nameof(SearchFilter));
@ -140,7 +140,7 @@ namespace SourceGit.Views
var stroke = new Pen(this.FindResource("Brush.Border0") as IBrush);
context.DrawGeometry(fill, stroke, geo);
}
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
base.OnPropertyChanged(change);
@ -148,7 +148,7 @@ namespace SourceGit.Views
if (change.Property == SearchFilterProperty)
UpdateSelectablePages();
}
private void ScrollTabs(object _, PointerWheelEventArgs e)
{
if (!e.KeyModifiers.HasFlag(KeyModifiers.Shift))
@ -270,12 +270,18 @@ namespace SourceGit.Views
e.Handled = true;
}
private void OnTabsDropdownOpened(object sender, EventArgs e)
{
UpdateSelectablePages();
}
private void OnTabsDropdownClosed(object sender, EventArgs e)
{
SelectablePages.Clear();
SearchFilter = string.Empty;
}
private void OnTabsDropdownKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
@ -294,7 +300,7 @@ namespace SourceGit.Views
}
}
}
private void OnTabsDropdownSearchBoxKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Down && TabsDropdownList.ItemCount > 0)
@ -355,7 +361,7 @@ namespace SourceGit.Views
SelectablePages.Add(page);
}
}
private bool _pressedTab = false;
private Point _pressedTabPosition = new Point();
private bool _startDragTab = false;