1
0

qml: add config setting for max brightness on qr display

This commit is contained in:
Josh Geden
2024-11-23 21:44:02 -08:00
committed by Sander van Grieken
parent a084ccc74c
commit 6331448860
5 changed files with 36 additions and 4 deletions

View File

@@ -231,6 +231,24 @@ Pane {
}
}
RowLayout {
Layout.columnSpan: 2
Layout.fillWidth: true
spacing: 0
Switch {
id: setMaxBrightnessOnQrDisplay
onCheckedChanged: {
if (activeFocus)
Config.setMaxBrightnessOnQrDisplay = checked
}
}
Label {
Layout.fillWidth: true
text: qsTr('Set display to max brightness when displaying QR codes')
wrapMode: Text.Wrap
}
}
PrefsHeading {
Layout.columnSpan: 2
text: qsTr('Wallet behavior')
@@ -423,10 +441,8 @@ Pane {
}
}
}
}
}
}
Component {
@@ -447,6 +463,7 @@ Pane {
useFallbackAddress.checked = Config.useFallbackAddress
enableDebugLogs.checked = Config.enableDebugLogs
alwaysAllowScreenshots.checked = Config.alwaysAllowScreenshots
setMaxBrightnessOnQrDisplay.checked = Config.setMaxBrightnessOnQrDisplay
useRecoverableChannels.checked = Config.useRecoverableChannels
syncLabels.checked = AppController.isPluginEnabled('labels')
}

View File

@@ -78,10 +78,11 @@ Item {
onVisibleChanged: {
if (root.visible) {
// set max brightness to make qr code easier to scan
AppController.setMaxScreenBrightness()
if (AppController.isMaxBrightnessOnQrDisplayEnabled()) {
AppController.setMaxScreenBrightness()
}
} else {
AppController.resetScreenBrightness()
}
}
}