Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/UniGetUI.Avalonia/Models/PackageCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/// </summary>
public sealed class PackageWrapper : INotifyPropertyChanged, IDisposable
{
private static readonly HttpClient _iconHttpClient = new(CoreTools.GenericHttpClientParameters)

Check warning on line 26 in src/UniGetUI.Avalonia/Models/PackageCollections.cs

View workflow job for this annotation

GitHub Actions / test-codebase

This call site is reachable on all platforms. 'CoreTools.GenericHttpClientParameters' is only supported on: 'windows' 10.0.19041 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
{
Timeout = TimeSpan.FromSeconds(8),
};
Expand Down Expand Up @@ -113,7 +113,7 @@
/// See issue #4617 — defense-in-depth signal that an upgrade may be redirecting the
/// download to a different domain than the user originally trusted.
/// </summary>
private void MaybeStartInstallerHostCheck()

Check warning on line 116 in src/UniGetUI.Avalonia/Models/PackageCollections.cs

View workflow job for this annotation

GitHub Actions / Linux (Avalonia)

Member 'MaybeStartInstallerHostCheck' does not access instance data and can be marked as static (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1822)
{
#if WINDOWS
if (!Package.IsUpgradable) return;
Expand Down Expand Up @@ -327,8 +327,8 @@
Sorter.Checked => w.IsChecked ? "0" : "1",
Sorter.Name => w.Package.Name,
Sorter.Id => w.Package.Id,
Sorter.Version => w.Package.NormalizedVersion.ToString(),
Sorter.NewVersion => w.Package.NormalizedNewVersion.ToString(),
Sorter.Version => w.Package.NormalizedVersion.ToString() ?? string.Empty,
Sorter.NewVersion => w.Package.NormalizedNewVersion.ToString() ?? string.Empty,
Sorter.Source => w.Package.Source.AsString_DisplayName,
_ => w.Package.Name,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ public CheckboxButtonCard()
StateChanged?.Invoke(this, EventArgs.Empty);
Button.IsEnabled = (_checkbox.IsChecked ?? false) ? true : _buttonAlwaysOn;
_textblock.Opacity = (_checkbox.IsChecked ?? false) ? 1 : 0.7;
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
if (_textblock.Text is not null)
{
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
}
};
Button.Click += (s, e) => Click?.Invoke(s, e);
ApplyAutomationMetadata(_checkbox, _textblock.Text);
Expand Down
14 changes: 11 additions & 3 deletions src/UniGetUI.Avalonia/Views/Controls/Settings/CheckboxCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ protected virtual void _checkbox_Toggled(object? sender, RoutedEventArgs e)
StateChanged?.Invoke(this, EventArgs.Empty);
_textblock.Opacity = (_checkbox.IsChecked ?? false) ? 1 : 0.7;
SyncToggleItemStatus();
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
if (_textblock.Text is not null)
{
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
}
var cmd = StateChangedCommand;
if (cmd?.CanExecute(null) == true)
cmd.Execute(null);
Expand All @@ -133,9 +136,11 @@ protected void SyncToggleItemStatus()
AutomationProperties.SetItemStatus(_checkbox, state);
// Name with state suffix: guarantees VoiceOver announces state on macOS
// where ToggleSwitch AX role may not expose IsChecked natively
string baseName = _textblock.Text;
string? baseName = _textblock.Text;
if (!string.IsNullOrEmpty(baseName))
{
AutomationProperties.SetName(_checkbox, $"{baseName}, {state}");
}
}
}

Expand Down Expand Up @@ -197,6 +202,9 @@ protected override void _checkbox_Toggled(object? sender, RoutedEventArgs e)
StateChanged?.Invoke(this, EventArgs.Empty);
_textblock.Opacity = (_checkbox.IsChecked ?? false) ? 1 : 0.7;
SyncToggleItemStatus();
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
if (_textblock.Text is not null)
{
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ await SecureSettings.TrySet(
cmd.Execute(null);
_textblock.Opacity = (_checkbox.IsChecked ?? false) ? 1 : 0.7;
_checkbox.IsChecked = SecureSettings.Get(setting_name) ^ IS_INVERTED ^ ForceInversion;
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
if (_textblock.Text is not null)
{
AccessibilityAnnouncementService.AnnounceToggle(_textblock.Text, _checkbox.IsChecked ?? false);
}
_loading.IsVisible = false;
_checkbox.IsEnabled = true;
}
Expand Down
Loading