@@ -144,6 +144,18 @@ def create_radio_button(self, parent, text, index):
144144 cb .add_style (style_radio_chk , lv .PART .INDICATOR | lv .STATE .CHECKED )
145145 return cb
146146
147+ def cambutton_cb (self , event ):
148+ print ("cambutton clicked!" )
149+ import captureqr
150+ print ("after import captureqr" )
151+ #while True: this hangs the entire thing - not good...
152+ clip = mpos .clipboard .get ()
153+ print (f"clip is: { clip } " )
154+ if clip and clip .startsWith ("Result:" ):
155+ print ("Got result from QR code scanner!" )
156+ #break
157+ time .sleep (0.25 )
158+
147159 def open_edit_popup (self , setting ):
148160 # Close existing msgbox and keyboard if open
149161 if self .msgbox :
@@ -158,7 +170,7 @@ def open_edit_popup(self, setting):
158170 # Create msgbox
159171 self .msgbox = lv .msgbox ()
160172 self .msgbox .add_title (setting ["title" ])
161- self .msgbox .set_width (lv .pct (80 ))
173+ self .msgbox .set_width (lv .pct (85 ))
162174 self .msgbox .center ()
163175
164176 # Create content container
@@ -192,7 +204,14 @@ def open_edit_popup(self, setting):
192204 self .textarea .add_event_cb (self .show_keyboard , lv .EVENT .CLICKED , None )
193205 self .textarea .add_event_cb (self .show_keyboard , lv .EVENT .FOCUSED , None )
194206 self .textarea .add_event_cb (self .hide_keyboard , lv .EVENT .DEFOCUSED , None )
195-
207+ # Camera for text
208+ self .cambutton = lv .button (self .msgbox )
209+ #self.cambutton.align(lv.ALIGN.TOP_RIGHT,0,0)
210+ self .cambuttonlabel = lv .label (self .cambutton )
211+ self .cambuttonlabel .set_text ("CAM" )
212+ self .cambuttonlabel .center ()
213+ self .cambutton .add_event_cb (self .cambutton_cb , lv .EVENT .CLICKED , None )
214+
196215 # Button container
197216 btn_cont = lv .obj (content )
198217 btn_cont .set_width (lv .pct (100 ))
0 commit comments