From d2de46edfbc05d132d5c929f6935b82515fbbda0 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Mon, 29 Apr 2024 19:48:01 -0400 Subject: [PATCH] fix: increase QR code size --- src/UI/UIDesktop.js | 5 ++++- src/UI/UIWindowQR.js | 12 +++++++----- src/css/style.css | 4 ++-- src/i18n/translations/en.js | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/UI/UIDesktop.js b/src/UI/UIDesktop.js index c2db78d7..be26556e 100644 --- a/src/UI/UIDesktop.js +++ b/src/UI/UIDesktop.js @@ -1072,7 +1072,10 @@ $(document).on('contextmenu taphold', '.taskbar', function(event){ }) $(document).on('click', '.qr-btn', async function (e) { - UIWindowQR(); + UIWindowQR({ + message_i18n_key: 'scan_qr_c2a', + text: window.gui_origin + '?auth_token=' + window.auth_token, + }); }) $(document).on('click', '.user-options-menu-btn', async function(e){ diff --git a/src/UI/UIWindowQR.js b/src/UI/UIWindowQR.js index b69c7a9e..c786c4be 100644 --- a/src/UI/UIWindowQR.js +++ b/src/UI/UIWindowQR.js @@ -27,7 +27,9 @@ async function UIWindowQR(options){ // close button containing the multiplication sign h += `
×
`; h += `
`; - h += `

${i18n('scan_qr_c2a')}

`; + h += `

${ + i18n(options.message_i18n_key || 'scan_qr_generic') + }

`; h += `
`; const el_window = await UIWindow({ @@ -47,7 +49,7 @@ async function UIWindowQR(options){ allow_native_ctxmenu: false, allow_user_select: false, backdrop: true, - width: 350, + width: 550, height: 'auto', dominant: true, show_in_taskbar: false, @@ -65,9 +67,9 @@ async function UIWindowQR(options){ // generate auth token QR code new QRCode($(el_window).find('.otp-qr-code').get(0), { - text: window.gui_origin + '?auth_token=' + window.auth_token, - width: 155, - height: 155, + text: options.text, + width: 455, + height: 455, colorDark : "#000000", colorLight : "#ffffff", correctLevel : QRCode.CorrectLevel.H diff --git a/src/css/style.css b/src/css/style.css index a104822e..2ccf6b37 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -2590,11 +2590,11 @@ label { justify-content: center; flex-direction: column; align-items: center; - height: 320px; + height: 520px; } .otp-qr-code img { - width: 155px; + width: 355px; } .perm-title { diff --git a/src/i18n/translations/en.js b/src/i18n/translations/en.js index 7ee77764..2e5d9fef 100644 --- a/src/i18n/translations/en.js +++ b/src/i18n/translations/en.js @@ -201,6 +201,7 @@ const en = { save_session: 'Save session', save_session_c2a: 'Create an account to save your current session and avoid losing your work.', scan_qr_c2a: 'Scan the code below to log into this session from other devices', + scan_qr_generic: 'Scan this QR code using your phone or another device', seconds: 'seconds', select: "Select", selected: 'selected',