mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Merge pull request #1255 from Scrxtchy/Clipboard-QR
Automatically fill QR window with Clipboard Content
This commit is contained in:
commit
bb3fbf637d
1 changed files with 22 additions and 2 deletions
|
@ -53,11 +53,31 @@ public QRCodeForm(string text = null)
|
|||
{
|
||||
EditMode = true;
|
||||
txtQRCode.Visible = true;
|
||||
txtQRCode.Text = "Text";
|
||||
if (Clipboard.ContainsText())
|
||||
{
|
||||
text = Clipboard.GetText();
|
||||
if (!string.IsNullOrEmpty(text) && URLHelpers.IsValidURLRegex(text))
|
||||
{
|
||||
txtQRCode.Text = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
default_Text();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
default_Text();
|
||||
}
|
||||
txtQRCode.SelectAll();
|
||||
}
|
||||
}
|
||||
|
||||
private void default_Text()
|
||||
{
|
||||
txtQRCode.Text = "Input text to convert";
|
||||
}
|
||||
|
||||
private void txtQRCode_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
qrMain.Text = txtQRCode.Text;
|
||||
|
@ -138,4 +158,4 @@ private void tsmiSaveAs_Click(object sender, EventArgs e)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue