Minor Check UI improvements (#851)

* Minor Check UI improvements

* Move Check warning below status box

* Hover text on status message

* Full status in tooltip

* Add ellipsis to status text

* null ref assignment

* OneWay

* trigger StatusFirstLine property changed

* Better status property block

* wrong op
This commit is contained in:
Deterous
2025-05-22 23:46:53 +09:00
committed by GitHub
parent f637e629a3
commit a942e6142a
4 changed files with 31 additions and 14 deletions

View File

@@ -174,10 +174,29 @@ namespace MPF.Frontend.ViewModels
{
_status = value;
TriggerPropertyChanged(nameof(Status));
TriggerPropertyChanged(nameof(StatusFirstLine));
}
}
private string _status;
/// <summary>
/// Currently displayed status trimmed to one line
/// </summary>
public string StatusFirstLine
{
get
{
if (string.IsNullOrEmpty(Status))
return string.Empty;
var statusLines = Status.Split('\n');
if (statusLines.Length > 1)
return statusLines[0] + " (...)";
return statusLines[0];
}
}
/// <summary>
/// Indicates the status of the check dump button
/// </summary>
@@ -506,13 +525,7 @@ namespace MPF.Frontend.ViewModels
/// </summary>
private void ProgressUpdated(object? sender, ResultEventArgs value)
{
var message = value?.Message;
// Update the label with only the first line of output
if (message != null && message.Contains("\n"))
Status = message.Split('\n')[0] + " (...)";
else
Status = message ?? string.Empty;
Status = value?.Message ?? string.Empty;
}
/// <summary>