You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Wifi app: improve different screensize handling
This commit is contained in:
@@ -250,9 +250,9 @@ class PasswordPage(Activity):
|
||||
label.align(lv.ALIGN.TOP_MID,0,5)
|
||||
print("PasswordPage: Creating password textarea")
|
||||
self.password_ta=lv.textarea(password_page)
|
||||
self.password_ta.set_size(200,30)
|
||||
self.password_ta.set_width(lv.pct(90))
|
||||
self.password_ta.set_one_line(True)
|
||||
self.password_ta.align_to(label, lv.ALIGN.OUT_BOTTOM_MID, 5, 0)
|
||||
self.password_ta.align_to(label, lv.ALIGN.OUT_BOTTOM_MID, 0, 0)
|
||||
self.password_ta.add_event_cb(lambda *args: self.show_keyboard(), lv.EVENT.CLICKED, None)
|
||||
print("PasswordPage: Creating Connect button")
|
||||
self.connect_button=lv.button(password_page)
|
||||
@@ -313,12 +313,12 @@ class PasswordPage(Activity):
|
||||
mpos.ui.anim.smooth_show(self.keyboard)
|
||||
focusgroup = lv.group_get_default()
|
||||
if focusgroup:
|
||||
focusgroup.focus_next() # move the focus to the keypad to save the user a "next" button press (optional but nice)
|
||||
focusgroup.focus_next() # move the focus to the keyboard to save the user a "next" button press (optional but nice)
|
||||
|
||||
def hide_keyboard(self):
|
||||
mpos.ui.anim.smooth_hide(self.keyboard)
|
||||
self.connect_button.remove_flag(lv.obj.FLAG.HIDDEN)
|
||||
self.cancel_button.remove_flag(lv.obj.FLAG.HIDDEN)
|
||||
mpos.ui.anim.smooth_hide(self.keyboard)
|
||||
|
||||
def handle_keyboard_events(self, event):
|
||||
target_obj=event.get_target_obj() # keyboard
|
||||
|
||||
Reference in New Issue
Block a user