Skip to content

Commit

Permalink
fix focus on messgebox
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlm committed Nov 29, 2024
1 parent 21972f8 commit 99393d3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/Consolonia.Core/Controls/MessageBox.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;

Check warning on line 1 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[RedundantUsingDirective] Using directive is not required by the code and can be safely removed" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(1,1)
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;

Check warning on line 5 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[RedundantUsingDirective] Using directive is not required by the code and can be safely removed" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(5,1)
using Avalonia.Interactivity;
using CommunityToolkit.Mvvm.ComponentModel;

Expand Down Expand Up @@ -43,14 +45,17 @@ public MessageBox()

InitializeComponent();

if (OkButton.IsVisible)
OkButton.Focus();
else if (CancelButton.IsVisible)
CancelButton.Focus();
else if (YesButton.IsVisible)
YesButton.Focus();
else if (NoButton.IsVisible)
NoButton.Focus();
this.AttachedToVisualTree += (s, e) =>

Check notice on line 48 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[ArrangeThisQualifier] Qualifier 'this.' is redundant" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(48,13)

Check warning on line 48 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 'e' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(48,46)

Check warning on line 48 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 's' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(48,43)
{
if (OkButton.IsVisible)
OkButton.AttachedToVisualTree += (s2, e2) => OkButton.Focus();

Check warning on line 51 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 'e2' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(51,59)

Check warning on line 51 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 's2' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(51,55)
else if (YesButton.IsVisible)
YesButton.AttachedToVisualTree += (s2, e2) => YesButton.Focus();

Check warning on line 53 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 'e2' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(53,60)

Check warning on line 53 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 's2' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(53,56)
else if (CancelButton.IsVisible)
CancelButton.AttachedToVisualTree += (s2, e2) => CancelButton.Focus();

Check warning on line 55 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 'e2' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(55,63)
else if (NoButton.IsVisible)
NoButton.AttachedToVisualTree += (s2, e2) => NoButton.Focus();

Check warning on line 57 in src/Consolonia.Core/Controls/MessageBox.axaml.cs

View workflow job for this annotation

GitHub Actions / build

"[UnusedParameter.Local] Parameter 'e2' is never used" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Controls/MessageBox.axaml.cs(57,59)
};
}

public Mode Mode
Expand Down

0 comments on commit 99393d3

Please sign in to comment.