mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
QR code decode from screen is now using singleton form
This commit is contained in:
parent
2a89a63baf
commit
d5e9d0cab2
1 changed files with 16 additions and 1 deletions
|
@ -40,6 +40,21 @@ namespace ShareX
|
|||
{
|
||||
public partial class QRCodeForm : Form
|
||||
{
|
||||
private static QRCodeForm instance;
|
||||
|
||||
public static QRCodeForm Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance == null || instance.IsDisposed)
|
||||
{
|
||||
instance = new QRCodeForm();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
private bool isReady;
|
||||
|
||||
public QRCodeForm(string text = null)
|
||||
|
@ -75,7 +90,7 @@ public static QRCodeForm OpenFormDecodeFromFile(string filePath)
|
|||
|
||||
public static QRCodeForm OpenFormDecodeFromScreen()
|
||||
{
|
||||
QRCodeForm form = new QRCodeForm();
|
||||
QRCodeForm form = Instance;
|
||||
form.tcMain.SelectedTab = form.tpDecode;
|
||||
form.DecodeFromScreen();
|
||||
return form;
|
||||
|
|
Loading…
Reference in a new issue