Fixed the QR Code flickering and also the qr code will be bigger and centralized.

This commit is contained in:
Im Nix 2024-01-16 00:23:17 -03:00 committed by GitHub
parent 752cc40697
commit d161027870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1601,21 +1601,25 @@ void qrmenu_setup() {
delay(500); // Prevent switching after menu loads up delay(500); // Prevent switching after menu loads up
} }
boolean isOn = false;
void qrmenu_loop() { void qrmenu_loop() {
if (check_next_press()) { if (check_next_press()) {
cursor++; cursor++;
cursor = cursor % ( sizeof(qrcodes) / sizeof(QRCODE) ); cursor = cursor % ( sizeof(qrcodes) / sizeof(QRCODE) );
qrmenu_drawmenu(); qrmenu_drawmenu();
isOn = false;
delay(250); delay(250);
} }
if (check_select_press()) { if (check_select_press()) {
if(qrcodes[cursor].url.length() == 0){ @@ -1614,8 +1617,9 @@ void qrmenu_loop() {
rstOverride = false;
isSwitching = true; isSwitching = true;
current_proc = 1; current_proc = 1;
}else{ }else{
isOn = true;
DISP.fillScreen(WHITE); DISP.fillScreen(WHITE);
DISP.qrcode(qrcodes[cursor].url, 0, 0, 80, 5); DISP.qrcode(qrcodes[cursor].url, 0, 0, 80, 5);
DISP.qrcode(qrcodes[cursor].url, (DISP.width() - DISP.height()) / 2, 0, DISP.height(), 5);
} }
} }
} }