-
Notifications
You must be signed in to change notification settings - Fork 0
/
twiddletalk.kv
executable file
·53 lines (50 loc) · 1.64 KB
/
twiddletalk.kv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#:kivy 1.7.1
#: import window kivy.core.window.Window
# TwiddleTalk UI
# Layout adapted from SayThis app (https://github.com/brousch/saythis)
<TwiddleTalk>:
orientation: 'vertical'
button_font_size: '30sp'
padding: '8sp','8sp'
canvas:
Rectangle:
source: 'images/background.png'
pos: self.pos
size: self.size
textbox: textbox
Label:
text: 'TwiddleTalk'
font_size: '45sp'
size_hint: 1, None
height: self.texture_size[1] + (2 * root.padding[1])
BoxLayout:
orientation: 'horizontal' if window.width > window.height else 'vertical'
Slider:
id: font_slider
orientation: 'vertical' if window.width > window.height else 'horizontal'
min: 1
max: 100
value: 15
size: ('50sp', 0) if window.width > window.height else (0, '50sp')
size_hint: (None, 1) if window.width > window.height else (1, None)
TextInput:
id: textbox
text: ''
font_size: str(font_slider.value)+'sp'
BoxLayout:
orientation: 'horizontal'
size_hint: 1, None
height: reset_button.height
Button:
id: reset_button
text: 'Reset'
font_size: root.button_font_size
size_hint: 1, None
height: self.texture_size[1] + (2 * root.padding[1])
on_press: root.reset()
Button:
text: 'Exit'
font_size: root.button_font_size
size_hint: 1, None
height: self.texture_size[1] + (2 * root.padding[1])
on_press: root.exit()