1
0

qml/android: set max screen brightness when displaying QR codes

In some cases this makes it much easier to successfully scan a QR code.
I was trying to scan a PSBT using a laptop camera from my phone screen for 2 minutes, until I realised the screen brightness was the issue.  o.O
This commit is contained in:
SomberNight
2024-08-21 23:37:36 +00:00
parent bd845080b8
commit 7a7b43c0a8
2 changed files with 34 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ Item {
source: qrdata && render ? 'image://qrgen/' + qrdata : ''
visible: !isTextState
Rectangle {
Rectangle { // container for logo inside qr code
visible: root.render && _qrprops.valid
color: 'white'
x: (parent.width - width) / 2
@@ -75,4 +75,13 @@ Item {
}
}
onVisibleChanged: {
if (root.visible) {
// set max brightness to make qr code easier to scan
AppController.setMaxScreenBrightness()
} else {
AppController.resetScreenBrightness()
}
}
}