Parcourir la source

fix: increase QR code size

KernelDeimos il y a 1 an
Parent
commit
d2de46edfb
4 fichiers modifiés avec 14 ajouts et 8 suppressions
  1. 4 1
      src/UI/UIDesktop.js
  2. 7 5
      src/UI/UIWindowQR.js
  3. 2 2
      src/css/style.css
  4. 1 0
      src/i18n/translations/en.js

+ 4 - 1
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){

+ 7 - 5
src/UI/UIWindowQR.js

@@ -27,7 +27,9 @@ async function UIWindowQR(options){
         // close button containing the multiplication sign
         h += `<div class="qr-code-window-close-btn generic-close-window-button"> &times; </div>`;
         h += `<div class="otp-qr-code">`;
-            h += `<h1 style="text-align: center; font-size: 16px; padding: 10px; font-weight: 400; margin: -10px 10px 20px 10px; -webkit-font-smoothing: antialiased; color: #5f626d;">${i18n('scan_qr_c2a')}</h1>`;
+            h += `<h1 style="text-align: center; font-size: 16px; padding: 10px; font-weight: 400; margin: -10px 10px 20px 10px; -webkit-font-smoothing: antialiased; color: #5f626d;">${
+                i18n(options.message_i18n_key || 'scan_qr_generic')
+            }</h1>`;
         h += `</div>`;
 
         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

+ 2 - 2
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 {

+ 1 - 0
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',