Add a 'Copy' button to the fax UI (#22027)
* Add a 'Copy' button to the fax UI * Add ValidatePrototypeId attribute Co-authored-by: Kara <lunarautomaton6@gmail.com> --------- Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ namespace Content.Client.Fax.UI;
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class FaxWindow : DefaultWindow
|
||||
{
|
||||
public event Action? CopyButtonPressed;
|
||||
public event Action? SendButtonPressed;
|
||||
public event Action? RefreshButtonPressed;
|
||||
public event Action<string>? PeerSelected;
|
||||
@@ -17,6 +18,7 @@ public sealed partial class FaxWindow : DefaultWindow
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
CopyButton.OnPressed += _ => CopyButtonPressed?.Invoke();
|
||||
SendButton.OnPressed += _ => SendButtonPressed?.Invoke();
|
||||
RefreshButton.OnPressed += _ => RefreshButtonPressed?.Invoke();
|
||||
PeerSelector.OnItemSelected += args =>
|
||||
@@ -25,6 +27,7 @@ public sealed partial class FaxWindow : DefaultWindow
|
||||
|
||||
public void UpdateState(FaxUiState state)
|
||||
{
|
||||
CopyButton.Disabled = !state.CanCopy;
|
||||
SendButton.Disabled = !state.CanSend;
|
||||
FromLabel.Text = state.DeviceName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user