mirror of https://github.com/kivy/kivy.git
Merge branch 'master' of ssh://github.com/kivy/kivy
This commit is contained in:
commit
c399eb17d2
|
@ -54,7 +54,10 @@ class MouseMotionEvent(MotionEvent):
|
|||
self.ud._drawelement = de
|
||||
if de is not None:
|
||||
self.push()
|
||||
self.scale_for_screen(win.system_size[0], win.system_size[1], rotation=win.rotation)
|
||||
self.scale_for_screen(
|
||||
win.system_size[0],
|
||||
win.system_size[1],
|
||||
rotation=win.rotation)
|
||||
de[1].pos = self.x - 10, self.y - 10
|
||||
self.pop()
|
||||
|
||||
|
|
|
@ -74,7 +74,8 @@ Let's say you want to save angle and pressure of the touch, if available::
|
|||
|
||||
Or with modules variables::
|
||||
|
||||
$ python main.py -m recorder,attrs=is_touch:sx:sy:angle:pressure,profile_mask=pos:angle:pressure
|
||||
$ python main.py -m recorder,attrs=is_touch:sx:sy:angle:pressure,\
|
||||
profile_mask=pos:angle:pressure
|
||||
|
||||
Known limitations
|
||||
-----------------
|
||||
|
@ -100,6 +101,7 @@ from kivy.logger import Logger
|
|||
from ast import literal_eval
|
||||
from functools import partial
|
||||
|
||||
|
||||
class RecorderMotionEvent(MotionEvent):
|
||||
|
||||
def depack(self, args):
|
||||
|
@ -191,17 +193,16 @@ class Recorder(EventDispatcher):
|
|||
(time() - self.record_time, etype, motionevent.uid, args), ))
|
||||
self.counter += 1
|
||||
|
||||
def on_keyboard(self, etype, window, key, scancode=None, unicode=None, modifier=None):
|
||||
def on_keyboard(self, etype, window, key, **kwargs):
|
||||
if not self.record:
|
||||
return
|
||||
self.record_fd.write('%r\n' % (
|
||||
(time() - self.record_time, etype, 0, {
|
||||
'key': key,
|
||||
'scancode': scancode,
|
||||
'unicode': unicode,
|
||||
'modifier': modifier,
|
||||
'is_touch': False
|
||||
}),))
|
||||
'scancode': kwargs.get('scancode'),
|
||||
'unicode': kwargs.get('unicode'),
|
||||
'modifier': kwargs.get('modifier'),
|
||||
'is_touch': False}), ))
|
||||
self.counter += 1
|
||||
|
||||
def release(self):
|
||||
|
|
|
@ -113,8 +113,6 @@ if 'KIVY_DOC' not in os.environ:
|
|||
|
||||
directives.register_directive('video', VideoDirective)
|
||||
|
||||
|
||||
|
||||
Builder.load_string('''
|
||||
#:import parse_color kivy.parser.parse_color
|
||||
|
||||
|
@ -313,7 +311,17 @@ Builder.load_string('''
|
|||
Color:
|
||||
rgb: .2, .2, .2
|
||||
Line:
|
||||
points: [self.x, self.y, self.right, self.y, self.right, self.top, self.x, self.top, self.x, self.y]
|
||||
points: [\
|
||||
self.x,\
|
||||
self.y,\
|
||||
self.right,\
|
||||
self.y,\
|
||||
self.right,\
|
||||
self.top,\
|
||||
self.x,\
|
||||
self.top,\
|
||||
self.x,\
|
||||
self.y]
|
||||
|
||||
<RstTransition>:
|
||||
size_hint_y: None
|
||||
|
@ -349,6 +357,7 @@ Builder.load_string('''
|
|||
class RstVideoPlayer(VideoPlayer):
|
||||
pass
|
||||
|
||||
|
||||
class RstDocument(ScrollView):
|
||||
'''Base widget used to store an Rst document. See module documentation for
|
||||
more information.
|
||||
|
@ -852,7 +861,8 @@ class _Visitor(nodes.NodeVisitor):
|
|||
elif cls is nodes.reference:
|
||||
name = node.get('name', node.get('refuri'))
|
||||
self.text += '[ref=%s][color=%s]' % (name,
|
||||
self.root.colors.get('link', self.root.colors.get('paragraph')))
|
||||
self.root.colors.get('link',
|
||||
self.root.colors.get('paragraph')))
|
||||
if 'refname' in node and 'name' in node:
|
||||
self.root.refs_assoc[node['name']] = node['refname']
|
||||
|
||||
|
@ -994,7 +1004,9 @@ class _Visitor(nodes.NodeVisitor):
|
|||
elif cls is role_video:
|
||||
width = node['width'] if 'width' in node.attlist() else 400
|
||||
height = node['height'] if 'height' in node.attlist() else 300
|
||||
video = RstVideoPlayer(source=node['source'], size_hint=(None, None),
|
||||
video = RstVideoPlayer(
|
||||
source=node['source'],
|
||||
size_hint=(None, None),
|
||||
size=(width, height))
|
||||
anchor = AnchorLayout(size_hint_y=None, height=height + 20)
|
||||
anchor.add_widget(video)
|
||||
|
|
Loading…
Reference in New Issue