Skip to content

Commit 5391854

Browse files
camtest: improve UI
1 parent 16ae25b commit 5391854

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • internal_filesystem/apps/com.example.camtest/assets

internal_filesystem/apps/com.example.camtest/assets/camtest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ def build_ui():
193193
})
194194
image.set_src(image_dsc)
195195
status_label_cont = lv.obj(appscreen)
196-
status_label_cont.set_size(lv.pct(60),lv.pct(50))
197-
status_label_cont.center()
196+
status_label_cont.set_size(width,height)
197+
status_label_cont.align(lv.ALIGN.LEFT_MID, 0, 0)
198198
status_label_cont.set_style_bg_color(lv.color_white(), 0)
199199
status_label_cont.set_style_bg_opa(66, 0)
200200
status_label_cont.set_style_border_width(0, 0)
@@ -254,6 +254,7 @@ def init_cam():
254254
print(f"camtest.py: webcam exception: {e}")
255255

256256
if cam and keepgoing:
257+
print("Camera initialized, changing UI")
257258
qr_button.remove_flag(lv.obj.FLAG.HIDDEN)
258259
snap_button.remove_flag(lv.obj.FLAG.HIDDEN)
259260
status_label_cont.add_flag(lv.obj.FLAG.HIDDEN)
@@ -267,6 +268,7 @@ def init_cam():
267268
print("camtest.py: stopping...")
268269
if cam:
269270
th.remove_event_cb(try_capture)
271+
270272
if use_webcam:
271273
webcam.deinit(cam)
272274
elif cam:

0 commit comments

Comments
 (0)