Skip to content

Commit

Permalink
WifiQr - Size slider added for QR Code size.
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKotschenreuther committed Dec 11, 2023
1 parent cff73cd commit 25019c6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion WebTools/Pages/WifiQr.razor
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@
<label>Wifi config encoded for QR Code</label>
<InputTextArea @bind-Value="_wifiConfigString" class="form-control" readonly></InputTextArea>
</div>
<div class="form-group col my-1">
<input type="range" name="qrCodeSize" on @bind="_qrCodeSize" @oninput="SetSize" min="100" max="1000" step="50" />
<label for="qrCodeSize">@_qrCodeSize px</label>
</div>
<div>
<Barcode @ref="_barcode" TextToEncode="@_wifiConfigString" Format="BarcodeFormat.QR_CODE" Height="200" Width="200"></Barcode>
<Barcode @ref="_barcode" TextToEncode="@_wifiConfigString" Format="BarcodeFormat.QR_CODE" Height="@_qrCodeSize" Width="@_qrCodeSize"></Barcode>
</div>
</div>

Expand All @@ -55,6 +59,7 @@

private Barcode? _barcode;
private string _wifiConfigString = String.Empty;
private int _qrCodeSize = 400;

private Timer? _timer;

Expand All @@ -76,4 +81,9 @@
this.StateHasChanged();
}
}

private void SetSize(ChangeEventArgs e)
{
_qrCodeSize = Convert.ToInt32(e.Value);
}
}

0 comments on commit 25019c6

Please sign in to comment.