Skip to content

Commit 5379167

Browse files
authored
Optimize brightness settings page. (#264)
1 parent 6d0ee40 commit 5379167

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

core/src/trezor/lvglui/scrs/homescreen.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,6 +3187,15 @@ def on_click(self, event_obj):
31873187

31883188

31893189
class BacklightSetting(AnimScreen):
3190+
@classmethod
3191+
def page_is_visible(cls) -> bool:
3192+
try:
3193+
if cls._instance is not None and cls._instance.is_visible():
3194+
return True
3195+
except Exception:
3196+
pass
3197+
return False
3198+
31903199
def __init__(self, prev_scr=None):
31913200
if not hasattr(self, "_init"):
31923201
self._init = True

core/src/trezor/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ def lcd_resume(timeouts_ms: int | None = None) -> bool:
177177
uart.ctrl_wireless_charge(False)
178178
if display.backlight() != device.get_brightness() or timeouts_ms:
179179
global AUTO_POWER_OFF
180-
display.backlight(device.get_brightness())
180+
from trezor.lvglui.scrs.homescreen import BacklightSetting
181+
182+
if not BacklightSetting.page_is_visible():
183+
display.backlight(device.get_brightness())
181184
AUTO_POWER_OFF = False
182185
from trezor.lvglui.scrs import fingerprints
183186

0 commit comments

Comments
 (0)