From 07fe06b311c5f25f2c09e8f60340a3c36bab43bc Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Sat, 19 Apr 2025 21:39:39 +0200 Subject: [PATCH] Notification bar buttons --- appstore.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/appstore.py b/appstore.py index 903ac1b5..8477537b 100644 --- a/appstore.py +++ b/appstore.py @@ -279,8 +279,13 @@ def connect_wifi(): import time -# Constants +# Redefined from above +TFT_HOR_RES=320 +TFT_VER_RES=240 + + +# Constants NOTIFICATION_BAR_HEIGHT=24 BUTTON_WIDTH=100 BUTTON_HEIGHT=40 @@ -459,6 +464,12 @@ def create_notification_bar(): battery_label.set_text("100%") battery_label.align(lv.ALIGN.RIGHT_MID, 0, 0) battery_label.set_style_text_color(COLOR_TEXT_WHITE, 0) + openbutton = lv.button(notification_bar) + openbutton.align(lv.ALIGN.TOP_MID, -20, -14) + openbutton.add_event_cb(lambda event: open_drawer(), lv.EVENT.CLICKED, None) + closebutton = lv.button(notification_bar) + closebutton.align(lv.ALIGN.TOP_MID, 20, -14) + closebutton.add_event_cb(lambda event: close_drawer(), lv.EVENT.CLICKED, None) # Timer to update time every second def update_time(timer): ticks = time.ticks_ms()