M5: Windows client moderation UI; add C ABI getters for account list, user mute/deafen, channel topic

This commit is contained in:
2026-06-17 16:31:29 +02:00
parent 3990f63f0f
commit 9b321d0d4f
24 changed files with 1723 additions and 30 deletions

View File

@@ -0,0 +1,60 @@
namespace VoiceCat.App.Forms;
/// <summary>
/// A small reusable modal that prompts for a single line of text (e.g., kick/ban reason).
/// Returns DialogResult.OK with Text set, or DialogResult.Cancel.
/// </summary>
public sealed class InputDialog : Form
{
private readonly TextBox _txtInput;
public string TextValue => _txtInput.Text.Trim();
public InputDialog(string caption, string label, string defaultText = "")
{
var lbl = new Label
{
Text = label,
AutoSize = true,
Location = new Point(12, 12),
TabIndex = 0,
};
_txtInput = new TextBox
{
Text = defaultText,
Location = new Point(12, 36),
Size = new Size(360, 23),
TabIndex = 1,
};
var btnOk = new Button
{
Text = "&OK",
DialogResult = DialogResult.OK,
Location = new Point(216, 72),
Size = new Size(75, 27),
TabIndex = 2,
};
var btnCancel = new Button
{
Text = "&Cancel",
DialogResult = DialogResult.Cancel,
Location = new Point(297, 72),
Size = new Size(75, 27),
TabIndex = 3,
};
AcceptButton = btnOk;
CancelButton = btnCancel;
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(384, 112);
Controls.AddRange([lbl, _txtInput, btnOk, btnCancel]);
FormBorderStyle = FormBorderStyle.FixedDialog;
MaximizeBox = false;
MinimizeBox = false;
StartPosition = FormStartPosition.CenterParent;
Text = caption;
}
}