bugfix
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
@ -75,7 +75,7 @@ from .threadcall import HttpClient
|
||||||
from .i18n import I18n
|
from .i18n import I18n
|
||||||
from .widget_css import WidgetCSS
|
from .widget_css import WidgetCSS
|
||||||
from .ready import WidgetReady
|
from .ready import WidgetReady
|
||||||
from .utils import CSize, SUPER
|
from .utils import CSize
|
||||||
from .swipebehavior import SwipeBehavior
|
from .swipebehavior import SwipeBehavior
|
||||||
from .widgetExt.inputext import MyDropDown
|
from .widgetExt.inputext import MyDropDown
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ def ScatterBox(WidgetCSS, WidgetReady, ScatterLayout):
|
||||||
class Box(WidgetCSS, WidgetReady, BoxLayout):
|
class Box(WidgetCSS, WidgetReady, BoxLayout):
|
||||||
def __init__(self, **kw):
|
def __init__(self, **kw):
|
||||||
try:
|
try:
|
||||||
SUPER(Box, self, kw)
|
super(Box, self).__init__(**kw)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('Box(',kw,') Error')
|
print('Box(',kw,') Error')
|
||||||
raise e
|
raise e
|
||||||
|
@ -157,9 +157,7 @@ class VBox(Box):
|
||||||
Box.__init__(self, **kw)
|
Box.__init__(self, **kw)
|
||||||
|
|
||||||
class SwipeBox(SwipeBehavior, Box):
|
class SwipeBox(SwipeBehavior, Box):
|
||||||
def __init__(self, **kw):
|
pass
|
||||||
SUPER(SwipeBox, self, kw)
|
|
||||||
|
|
||||||
|
|
||||||
class Text(Label):
|
class Text(Label):
|
||||||
lang=StringProperty('')
|
lang=StringProperty('')
|
||||||
|
@ -182,7 +180,7 @@ class Text(Label):
|
||||||
if not kwargs.get('text'):
|
if not kwargs.get('text'):
|
||||||
kwargs['text'] = kwargs.get('otext','')
|
kwargs['text'] = kwargs.get('otext','')
|
||||||
|
|
||||||
SUPER(Text, self, kwargs)
|
super(Text, self).__init__(**kwargs)
|
||||||
if self._i18n:
|
if self._i18n:
|
||||||
self.i18n.addI18nWidget(self)
|
self.i18n.addI18nWidget(self)
|
||||||
if self.wrap:
|
if self.wrap:
|
||||||
|
@ -277,6 +275,7 @@ class Modal(VBox):
|
||||||
self._target = None
|
self._target = None
|
||||||
super(Modal, self).__init__(**kw)
|
super(Modal, self).__init__(**kw)
|
||||||
self.set_size_position()
|
self.set_size_position()
|
||||||
|
print('size_hint=', self.size_hint, kw)
|
||||||
self._target.bind(size=self.set_size_position)
|
self._target.bind(size=self.set_size_position)
|
||||||
self.register_event_type('on_open')
|
self.register_event_type('on_open')
|
||||||
self.register_event_type('on_pre_open')
|
self.register_event_type('on_pre_open')
|
||||||
|
@ -299,7 +298,7 @@ class Modal(VBox):
|
||||||
|
|
||||||
return super().on_touch_down(touch)
|
return super().on_touch_down(touch)
|
||||||
|
|
||||||
def on_target(self):
|
def on_target(self, o, target):
|
||||||
w = Window
|
w = Window
|
||||||
if self.target is not None:
|
if self.target is not None:
|
||||||
w = Factory.Blocks.getWidgetById(self.target)
|
w = Factory.Blocks.getWidgetById(self.target)
|
||||||
|
@ -324,9 +323,9 @@ class Modal(VBox):
|
||||||
self.width = self.size_hint_x * self._target.width
|
self.width = self.size_hint_x * self._target.width
|
||||||
if self.size_hint_y:
|
if self.size_hint_y:
|
||||||
self.height = self.size_hint_y * self._target.height
|
self.height = self.size_hint_y * self._target.height
|
||||||
print(self.width, self.height,
|
print("size with target:", self.width, self.height,
|
||||||
self.size_hint_x, self.size_hint_y,
|
self.size_hint, self.size_hint,
|
||||||
self._target.size
|
"target size=", self._target.size
|
||||||
)
|
)
|
||||||
self.set_modal_position()
|
self.set_modal_position()
|
||||||
|
|
||||||
|
@ -392,7 +391,7 @@ class TimedModal(Modal):
|
||||||
show_time = NumericProperty(0)
|
show_time = NumericProperty(0)
|
||||||
def __init__(self, **kw):
|
def __init__(self, **kw):
|
||||||
self.time_task = None
|
self.time_task = None
|
||||||
SUPER(TimedModal, self, kw)
|
super(TimedModal, self).__init__(**kw)
|
||||||
|
|
||||||
def open(self, *args, **kw):
|
def open(self, *args, **kw):
|
||||||
if self.time_task is not None:
|
if self.time_task is not None:
|
||||||
|
|
|
@ -204,7 +204,7 @@ x = ClassX{klass_cnt}()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if url.startswith('file://'):
|
if url.startswith('file://'):
|
||||||
return self.script.dispatch(url, **params)
|
return self.script.dispatch(url, params)
|
||||||
elif url.startswith('http://') or url.startswith('https://'):
|
elif url.startswith('http://') or url.startswith('https://'):
|
||||||
try:
|
try:
|
||||||
hc = HttpClient()
|
hc = HttpClient()
|
||||||
|
|
|
@ -60,10 +60,13 @@ class BlocksApp(App):
|
||||||
with codecs.open(config.css.css_filename, 'r', 'utf-8') as f:
|
with codecs.open(config.css.css_filename, 'r', 'utf-8') as f:
|
||||||
d = json.load(f)
|
d = json.load(f)
|
||||||
self.buildCsses(d)
|
self.buildCsses(d)
|
||||||
if config.css.css_url:
|
try:
|
||||||
hc = HttpClient()
|
if config.css.css_url:
|
||||||
d = hc.get(self.realurl(config.css.css_url))
|
hc = HttpClient()
|
||||||
self.buildCsses(d)
|
d = hc.get(self.realurl(config.css.css_url))
|
||||||
|
self.buildCsses(d)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def on_rotate(self,*largs):
|
def on_rotate(self,*largs):
|
||||||
self.current_rotation = Window.rotation
|
self.current_rotation = Window.rotation
|
||||||
|
@ -76,10 +79,19 @@ class BlocksApp(App):
|
||||||
register_css(k,v)
|
register_css(k,v)
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
i18n = I18n()
|
config = getConfig()
|
||||||
|
self.workers = Workers(maxworkers=config.maxworkers or 80)
|
||||||
|
self.workers.start()
|
||||||
|
try:
|
||||||
|
i18n = I18n()
|
||||||
|
except:
|
||||||
|
i18n = None
|
||||||
self.platform = platform
|
self.platform = platform
|
||||||
self.is_desktop = platform in ['win', 'linux', 'macosx']
|
self.is_desktop = platform in ['win', 'linux', 'macosx']
|
||||||
config = getConfig()
|
self.default_params = {}
|
||||||
|
if config.default_params:
|
||||||
|
self.default_params.update(config.default_params)
|
||||||
|
|
||||||
self.public_headers = {
|
self.public_headers = {
|
||||||
"platform":self.platform
|
"platform":self.platform
|
||||||
}
|
}
|
||||||
|
@ -88,8 +100,6 @@ class BlocksApp(App):
|
||||||
Window.bind(on_request_close=self.on_close)
|
Window.bind(on_request_close=self.on_close)
|
||||||
Window.bind(on_rotate=self.on_rotate)
|
Window.bind(on_rotate=self.on_rotate)
|
||||||
Window.bind(size=self.device_info)
|
Window.bind(size=self.device_info)
|
||||||
self.workers = Workers(maxworkers=config.maxworkers or 80)
|
|
||||||
self.workers.start()
|
|
||||||
self.load_csses()
|
self.load_csses()
|
||||||
self.running = True
|
self.running = True
|
||||||
if config.root:
|
if config.root:
|
||||||
|
@ -163,7 +173,7 @@ class BlocksApp(App):
|
||||||
}
|
}
|
||||||
self.public_headers.update(device)
|
self.public_headers.update(device)
|
||||||
|
|
||||||
def on_close(self, *args):
|
def on_close(self, *args, **kwargs):
|
||||||
self.workers.running = False
|
self.workers.running = False
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ form options
|
||||||
"method"
|
"method"
|
||||||
}
|
}
|
||||||
"cols":"1"
|
"cols":"1"
|
||||||
|
"inputwidth",
|
||||||
"labelwidth":
|
"labelwidth":
|
||||||
"textsize":
|
"textsize":
|
||||||
"inputheight":
|
"inputheight":
|
||||||
|
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |