From ac8b3969cb8d8d6829930b6685598580b7dfde7f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 3 Feb 2021 18:12:12 +0800 Subject: [PATCH] bugfix --- kivyblocks/form.py | 16 ++++++++++++---- kivyblocks/register.py | 8 ++++++-- readme/.opencv-android编译出错.md.swp | Bin 12288 -> 0 bytes 3 files changed, 18 insertions(+), 6 deletions(-) delete mode 100644 readme/.opencv-android编译出错.md.swp diff --git a/kivyblocks/form.py b/kivyblocks/form.py index c97cb20..467e26d 100644 --- a/kivyblocks/form.py +++ b/kivyblocks/form.py @@ -190,11 +190,15 @@ class InputBox(BoxLayout): self.input_widget = self.uidef['wclass'](**options) if self.options.get('readonly'): self.input_widget.disabled = True + if self.options.get('value'): + self.input_widget.setValue(self.options.get('value')) + elif self.options.get('default_value'): + self.input_widget.setValue(self.options.get('default_value')) + self.input_widget.widget_id = self.options['name'] self.add_widget(self.input_widget) self.initflag = True self.input_widget.bind(on_focus=self.on_focus) - self.input_widget.setValue(self.options.get('default','')) self.dispatch('on_ready', self) def check(self): @@ -338,15 +342,19 @@ class StrSearchForm(BoxLayout): def __init__(self,img_url=None,**options): self.name = options.get('name','search_string') BoxLayout.__init__(self,orientation='horizontal',size_hint_y=None,height=CSize(3)) - self.input_widget = TextInput( + self.input_widget = StrInput( text='', multiline=False, allow_copy=True, - font_size=CSize(1), + halign='middle', + font_size=1, size_hint_y=None, - height=CSize(3)) + size_hint_x=1, + height=2) self.add_widget(self.input_widget) self.register_event_type('on_submit') + v = options.get('value',options.get('default_value','')) + self.input_widget.setValue(v) self.input_widget.bind(on_text_validate=self.submit_input) def getValue(self): diff --git a/kivyblocks/register.py b/kivyblocks/register.py index 1ae9d6f..d074a21 100644 --- a/kivyblocks/register.py +++ b/kivyblocks/register.py @@ -1,3 +1,4 @@ +import kivy from kivy.utils import platform from .baseWidget import * from .tree import Tree, TextTree, PopupMenu @@ -24,10 +25,13 @@ from .message import Conform from .pagepanel import PagePanel from .markdown import Markdown from .custom_camera import CustomCamera, QrReader -from .camerawithmic import CameraWithMic, ScreenWithMic +from .camerawithmic import CameraWithMic +if kivy.platform in ['win','linux', 'macosx']: + from .camerawithmic import ScreenWithMic r = Factory.register -r('ScreenWithMic', ScreenWithMic) +if kivy.platform in ['win','linux', 'macosx']: + r('ScreenWithMic', ScreenWithMic) r('CameraWithMic', CameraWithMic) r('CustomCamera', CustomCamera) r('QrReader', QrReader) diff --git a/readme/.opencv-android编译出错.md.swp b/readme/.opencv-android编译出错.md.swp deleted file mode 100644 index e72ad0ad4b5f61a66b58c4b47dd2e23deecc4b6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2&u`pB6vroU;b%e66XNhlpiK^5C!44V8wyHyw^C@+t&(i7sbkM>hP6HJ%y`q} z0D?o200}BlBqYQSf#6t)96(hiq)Obm@E#S3qo|wAuG z)ZApl?TP+|vl>djr(MOpAmXk}cM2|5PdeUh;+p)a5|)Px8cf_{Gj{m>ogXXq`c1s#D7LqpInk2BVV z?mos?3Ox*6f&DQk^W(+L7kgO(mVhN-30MM_fF#WQmY%~##ZYAV7&ZgS<8RgG>EdZr^)G-$}|xG*PT zZM-m~VIHLzBGvE#*h)O(uW>copE?k0W$2EPGSmlYQO}n6QJi`ZcJs6sVa`@xu8dd4 z9pz6RgyjBvVcK3pEz?i#w8GP&m#OdF(~J z7>ib}*n;dA&zmB_aC8YxoxG0#n9?}w5Qas)Kqz{1zw4jXQ2}f?d4$)vkHx=%X;p5z zOdMgGkZ0)LhRO_PWx|9KV$TQ}*H}ZY$D#BB@}nRWG1o;P)KM~`u9V%7GwfwHGD5e% z`+ED**7kd!?`&Pk+lcB5UXPy^+USb8Xlm0l<1{K_KTHEY#_HMDTr!^DqtQreLvWMF zhWxC(Ba}8{HAaPZ8E*iN@Z8p%PPFGwH&*7(G!|R)jg_;Dt=F6N<)!1TlP5ETiQeDK(Ws6Oj550v{YlZZT!J z>5?y_1PN3mb7u=v1Ans}=dXDp9xTSPqbPVUir{w_zyEgqgPjjQy7kSqn?HTE^Y+#4 RZ{NB3