Merge branch 'master' of ssh://github.com/kivy/kivy

This commit is contained in:
Mathieu Virbel 2012-08-07 12:15:54 +02:00
commit bfebfad1ed
13 changed files with 335 additions and 342 deletions

View File

@ -1,4 +1,4 @@
#:kivy 1.0
Button:
text: 'Hello world in template 1'
text: 'Hello world in template 1'

View File

@ -1,4 +1,4 @@
#:kivy 1.0
Button:
text: 'Hello world'
text: 'Hello world'

View File

@ -24,5 +24,5 @@
text_size: self.size
color: (1, 1, 1, .8)
text: 'Kivy %s - Audio sample' % kivy.__version__
valign: 'middle'
valign: 'middle'

View File

@ -33,12 +33,12 @@
id: content
<KivyImageScatter>:
scale_min: 1
scale_min: 1
Image:
source: 'data/logo/kivy-icon-512.png'
<ButtonsScatter>:
scale_min: 1
scale_min: 1
canvas:
Color:
rgba: .5, .5, .5, .2
@ -142,269 +142,262 @@
pos: self.pos
[VSeparator@Widget]:
size_hint_x: None
width: 10
canvas:
Color:
rgba: .8, .8, .8, .3
Rectangle:
size: 1, self.height
pos: self.center_x, self.y
size_hint_x: None
width: 10
canvas:
Color:
rgba: .8, .8, .8, .3
Rectangle:
size: 1, self.height
pos: self.center_x, self.y
[HSeparator@Label]:
size_hint_y: None
height: 45
text: ctx.text if 'text' in ctx else ''
text_size: self.size
valign: 'middle'
halign: 'center'
canvas.before:
Color:
rgba: .2, .2, .2, .8
Rectangle:
size: self.size
pos: self.pos
size_hint_y: None
height: 45
text: ctx.text if 'text' in ctx else ''
text_size: self.size
valign: 'middle'
halign: 'center'
canvas.before:
Color:
rgba: .2, .2, .2, .8
Rectangle:
size: self.size
pos: self.pos
<StandardWidgets>:
BoxLayout:
pos_hint: {'x': 0, 'y': 0}
BoxLayout:
pos_hint: {'x': 0, 'y': 0}
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
HSeparator:
text: 'Buttons'
HSeparator:
text: 'Buttons'
Button:
text: 'Button ' + self.state
Button:
text: 'Button ' + self.state
Button:
text: 'Button ' + self.state
state: 'down'
Button:
text: 'Button ' + self.state
state: 'down'
ToggleButton:
text: 'Toggle ' + self.state
ToggleButton:
text: 'Toggle ' + self.state
HSeparator:
text: 'Toggle buttons with group'
HSeparator:
text: 'Toggle buttons with group'
ToggleButton:
text: 'Toggle 1'
group: 'tgroup'
ToggleButton:
text: 'Toggle 1'
group: 'tgroup'
ToggleButton:
text: 'Toggle 2'
group: 'tgroup'
ToggleButton:
text: 'Toggle 2'
group: 'tgroup'
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
HSeparator:
text: 'Sliders'
HSeparator:
text: 'Sliders'
Slider:
value: 33
size_hint_y: None
height: 50
Slider:
value: 33
size_hint_y: None
height: 50
Slider:
value: 66
size_hint_y: None
height: 50
Slider:
value: 66
size_hint_y: None
height: 50
BoxLayout:
BoxLayout:
Slider:
orientation: 'vertical'
value: 33
Slider:
orientation: 'vertical'
value: 33
Slider:
orientation: 'vertical'
value: 66
Slider:
orientation: 'vertical'
value: 66
HSeparator:
text: 'Progress Bar'
HSeparator:
text: 'Progress Bar'
ProgressBar:
value: (20 * root.value) % (1 + self.max)
size_hint_y: None
height: 50
ProgressBar:
value: (20 * root.value) % (1 + self.max)
size_hint_y: None
height: 50
HSeparator:
text: 'Switch'
HSeparator:
text: 'Switch'
Switch:
size_hint_y: None
height: 50
Switch:
size_hint_y: None
height: 50
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
HSeparator:
text: 'Text inputs'
HSeparator:
text: 'Text inputs'
TextInput:
text: 'Monoline textinput'
size_hint_y: None
height: 30
TextInput:
text: 'Monoline textinput'
size_hint_y: None
height: 50
TextInput:
text: 'This is a password'
size_hint_y: None
height: 30
password: True
TextInput:
text: 'This is a password'
size_hint_y: None
height: 50
password: True
TextInput:
text: 'Readonly textinput'
size_hint_y: None
height: 30
readonly: True
TextInput:
text: 'Readonly textinput'
size_hint_y: None
height: 50
readonly: True
TextInput:
text: 'Multiline textinput\nSecond line'
TextInput:
text: 'Multiline textinput\nSecond line'
HSeparator:
text: 'Spinner'
HSeparator:
text: 'Checkbox'
Spinner:
size_hint_y: None
height: 44
values: ('Work', 'Home', 'Other', 'Custom')
text: 'Home'
GridLayout:
rows: 1
CheckBox
CheckBox
HSeparator:
text: 'Checkbox'
GridLayout:
rows: 1
CheckBox:
active: True
CheckBox
GridLayout:
cols: 2
CheckBox:
group: 'group1'
active: True
CheckBox:
group: 'group1'
GridLayout:
cols: 2
CheckBox:
group: 'group1'
CheckBox:
group: 'group1'
CheckBox:
group: 'group2'
CheckBox:
group: 'group2'
<ComplexWidgets>:
BoxLayout:
pos_hint: {'x': 0, 'y': 0}
BoxLayout:
pos_hint: {'x': 0, 'y': 0}
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
HSeparator:
text: 'Accordions'
HSeparator:
text: 'Accordions'
Accordion:
Accordion:
AccordionItem:
title: 'Panel 1'
Label:
text: 'This is a label fit to the content view'
AccordionItem:
title: 'Panel 1'
Label:
text: 'This is a label fit to the content view'
AccordionItem:
title: 'Panel 2'
Button:
text: 'A button, what else?'
AccordionItem:
title: 'Panel 2'
Button:
text: 'A button, what else?'
AccordionItem:
title: 'Panel 3'
Label:
text: 'This is a label fit to the content view'
AccordionItem:
title: 'Panel 3'
Label:
text: 'This is a label fit to the content view'
Accordion:
Accordion:
orientation: 'vertical'
orientation: 'vertical'
AccordionItem:
title: 'Panel 1'
Label:
text: 'This is a label fit to the content view'
AccordionItem:
title: 'Panel 1'
Label:
text: 'This is a label fit to the content view'
AccordionItem:
title: 'Panel 2'
Button:
text: 'A button, what else?'
AccordionItem:
title: 'Panel 2'
Button:
text: 'A button, what else?'
AccordionItem:
title: 'Panel 3'
Label:
text: 'This is a label fit to the content view'
AccordionItem:
title: 'Panel 3'
Label:
text: 'This is a label fit to the content view'
VSeparator
VSeparator
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
HSeparator:
text: 'File choosers'
HSeparator:
text: 'File choosers'
FileChooserListView
FileChooserListView
FileChooserIconView
FileChooserIconView
<TreeViewWidgets>:
treeview1: treeview1
treeview2: treeview2
treeview1: treeview1
treeview2: treeview2
BoxLayout:
pos_hint: {'x': 0, 'y': 0}
BoxLayout:
pos_hint: {'x': 0, 'y': 0}
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
HSeparator:
text: 'Treeview with root'
HSeparator:
text: 'Treeview with root'
TreeView:
id: treeview1
TreeView:
id: treeview1
Button:
text: 'Remove first node'
size_hint_y: None
height: 50
on_release: treeview1.remove_node(treeview1.root.nodes[0]) if not treeview1.root.is_leaf else None
Button:
text: 'Remove first node'
size_hint_y: None
height: 50
on_release: treeview1.remove_node(treeview1.root.nodes[0]) if not treeview1.root.is_leaf else None
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 10
HSeparator:
text: 'Treeview without root'
HSeparator:
text: 'Treeview without root'
TreeView:
id: treeview2
hide_root: True
TreeView:
id: treeview2
hide_root: True
Button:
text: 'Remove first node'
size_hint_y: None
height: 50
on_release: treeview2.remove_node(treeview2.root.nodes[0]) if not treeview2.root.is_leaf else None
Button:
text: 'Remove first node'
size_hint_y: None
height: 50
on_release: treeview2.remove_node(treeview2.root.nodes[0]) if not treeview2.root.is_leaf else None

View File

@ -1,9 +1,9 @@
#:kivy 1.0
#
Widget:
Button:
text: "Hello World"
Button:
text: "Hello World"
Button:
text: "I'm another label"
pos: (200, 200)
Button:
text: "I'm another label"
pos: (200, 200)

View File

@ -1,25 +1,25 @@
Camera:
canvas:
Color:
rgb: (1, 1, 1)
Rectangle:
texture: self.texture
size: (320, 240)
Color:
rgb: (.5, 0, 1)
Rectangle:
texture: self.texture
pos: (320, 0)
size: (320, 240)
Color:
rgb: (0, 1, 0)
Rectangle:
texture: self.texture
pos: (320, 240)
size: (320, 240)
Color:
rgb: (1, 0, 0)
Rectangle:
texture: self.texture
pos: (0, 240)
size: (320, 240)
canvas:
Color:
rgb: (1, 1, 1)
Rectangle:
texture: self.texture
size: (320, 240)
Color:
rgb: (.5, 0, 1)
Rectangle:
texture: self.texture
pos: (320, 0)
size: (320, 240)
Color:
rgb: (0, 1, 0)
Rectangle:
texture: self.texture
pos: (320, 240)
size: (320, 240)
Color:
rgb: (1, 0, 0)
Rectangle:
texture: self.texture
pos: (0, 240)
size: (320, 240)

View File

@ -1,36 +1,36 @@
Widget:
Video:
id: myvideo
source: '/home/tito/code/pymt/examples/apps/videoplayer/softboy.avi'
play: mybutton.state == 'down'
canvas:
Color:
rgb: (1, 1, 1)
BorderImage:
texture: self.texture
size: self.texture_size
Video:
id: myvideo
source: '/home/tito/code/pymt/examples/apps/videoplayer/softboy.avi'
play: mybutton.state == 'down'
canvas:
Color:
rgb: (1, 1, 1)
BorderImage:
texture: self.texture
size: self.texture_size
Image:
source: 'kivy.jpg'
canvas:
PushMatrix:
Rotate:
angle: 1
BorderImage:
border: 250, 250, 250, 250
texture: self.texture
size: self.texture_size
PopMatrix:
Image:
source: 'kivy.jpg'
canvas:
PushMatrix:
Rotate:
angle: 1
BorderImage:
border: 250, 250, 250, 250
texture: self.texture
size: self.texture_size
PopMatrix:
Button:
id: mybutton
text: 'Push me'
pos: 100, 100
Button:
id: mybutton
text: 'Push me'
pos: 100, 100
Slider:
width: myvideo.width
height: 25
min: 0
max: myvideo.duration
value: myvideo.position
pos: myvideo.pos
Slider:
width: myvideo.width
height: 25
min: 0
max: myvideo.duration
value: myvideo.position
pos: myvideo.pos

View File

@ -1,6 +1,6 @@
Widget:
Scatter:
size: image.texture_size
Image:
id: image
source: 'kivy.jpg'
Scatter:
size: image.texture_size
Image:
id: image
source: 'kivy.jpg'

View File

@ -1,27 +1,27 @@
Widget:
canvas:
canvas:
StencilPush
StencilPush
# create a rectangle mask, from pos 100, 100, with a 100, 100 size.
Rectangle:
pos: 100, 100
size: 100, 100
# create a rectangle mask, from pos 100, 100, with a 100, 100 size.
Rectangle:
pos: 100, 100
size: 100, 100
StencilUse
StencilUse
# we want to show a big green rectangle, however, the previous stencil
# mask will crop us :)
Color:
rgb: 0, 1, 0
Rectangle:
size: 900, 900
# we want to show a big green rectangle, however, the previous stencil
# mask will crop us :)
Color:
rgb: 0, 1, 0
Rectangle:
size: 900, 900
StencilUnUse
StencilUnUse
# Remove the mask previously set
Rectangle:
pos: 100, 100
size: 100, 100
# Remove the mask previously set
Rectangle:
pos: 100, 100
size: 100, 100
StencilPop
StencilPop

View File

@ -1,42 +1,42 @@
BoxLayout:
orientation: 'vertical'
spacing: 5
padding: 5
orientation: 'vertical'
spacing: 5
padding: 5
Video:
id: myvideo
source: '../widgets/softboy.avi'
allow_stretch: True
on_eos: self.play = True; print 'woot we are looping!'
Video:
id: myvideo
source: '../widgets/softboy.avi'
allow_stretch: True
on_eos: self.play = True; print 'woot we are looping!'
BoxLayout:
size_hint_y: None
height: 30
BoxLayout:
size_hint_y: None
height: 30
Label:
id: mylabel
text: str(myvideo.position)
Label:
id: mylabel
text: str(myvideo.position)
Slider:
value: myvideo.position
max: myvideo.duration
on_value: print args[1]
Slider:
value: myvideo.position
max: myvideo.duration
on_value: print args[1]
BoxLayout:
size_hint_y: None
height: 50
spacing: 5
BoxLayout:
size_hint_y: None
height: 50
spacing: 5
ToggleButton:
group: 'video'
text: 'Play'
state: 'down' if myvideo.play else 'normal'
on_press: myvideo.play = True
ToggleButton:
group: 'video'
text: 'Play'
state: 'down' if myvideo.play else 'normal'
on_press: myvideo.play = True
ToggleButton:
group: 'video'
text: 'Stop'
state: 'down' if not myvideo.play else 'normal'
on_press: myvideo.play = False
ToggleButton:
group: 'video'
text: 'Stop'
state: 'down' if not myvideo.play else 'normal'
on_press: myvideo.play = False

View File

@ -1,9 +1,9 @@
#:kivy 1.0
<ShaderWidget>:
canvas:
Color:
rgb: 1, 0, 0
Rectangle:
pos: self.pos
size: self.size
canvas:
Color:
rgb: 1, 0, 0
Rectangle:
pos: self.pos
size: self.size

View File

@ -1,12 +1,12 @@
#:kivy 1.0
<ShaderWidget>:
canvas:
Color:
rgb: 1, 1, 1
Rectangle:
texture: self.texture
pos: self.pos
size: self.size
canvas:
Color:
rgb: 1, 1, 1
Rectangle:
texture: self.texture
pos: self.pos
size: self.size
<ScatterImage>:
size: image.size

View File

@ -1,16 +1,16 @@
#:kivy 1.0.4
<ScrollView>:
canvas:
Color:
rgb: 1, 0, 0
Rectangle:
pos: self.pos
size: self.size
canvas:
Color:
rgb: 1, 0, 0
Rectangle:
pos: self.pos
size: self.size
<GridLayout>:
canvas:
Color:
rgb: 1, 1, 0
Rectangle:
pos: self.pos
size: self.size
canvas:
Color:
rgb: 1, 1, 0
Rectangle:
pos: self.pos
size: self.size