-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkivytutor.kv
143 lines (132 loc) · 4.15 KB
/
kivytutor.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#:import COLOR kivy.utils.get_color_from_hex
#:set RED "#F94A69"
#:set GREEN "#06A5AB"
<WrappedLabel@Label>:
size_hint_y: None
height: self.texture_size[1] + (self.texture_size[1]/2)
markup: True
font_name: "Roboto"
<Button>:
font_name: "Roboto"
font_size: min(self.height, self.width) / 4
bold: True
background_normal: "./images/button_normal.png"
background_down: "./images/button_down.png"
background_color: COLOR("#0066BA")
border: (2, 2, 2, 2)
<KivyTutorRoot>:
orientation: "vertical"
kivy_screen_manager: kivy_screen_manager
math_screen: math_screen
ActionBar:
ActionView:
ActionPrevious:
title: ""
with_previous: False
ActionOverflow:
ActionButton:
text: "Settings"
on_press: app.open_settings()
ScreenManager:
id: kivy_screen_manager
StartScreen:
name: "start_screen"
AboutScreen:
id: about_screen
name: "about_screen"
MathScreen:
id: math_screen
name: "math_screen"
<StartScreen@Screen>:
BoxLayout:
# Settings
orientation: "vertical"
padding: root.width * .02, root.height * .02
spacing: min(root.width, root.height) * .02
WrappedLabel:
text: "[b]Kivy Math Tutor[/b]"
font_size: min(root.height, root.width) / 10
Button:
text: "Addition"
on_release: app.root.changeScreen(self.text.lower())
Button:
text: "Subtraction"
on_release: app.root.changeScreen(self.text.lower())
Button:
text: "Multiplication"
on_release: app.root.changeScreen(self.text.lower())
Button:
text: "Division"
on_release: app.root.changeScreen(self.text.lower())
Button:
text: "Mix!"
on_release: app.root.changeScreen(self.text.lower())
background_color: COLOR(GREEN)
Button:
text: "About this App"
on_release: app.root.changeScreen(self.text.lower())
background_color: COLOR(RED)
<MathScreen>:
question_text: question_text
answer_text: answer_text
BoxLayout:
orientation: "vertical"
padding: root.width * .02, root.height * .02
spacing: 10
WrappedLabel:
id: question_text
text: "some dummy text"
font_size: min(root.height, root.width) / 10
BoxLayout:
orientation: "horizontal"
size_hint_y: None
WrappedLabel:
id: answer_text
text: ""
font_size: min(root.height, root.width) / 10
Button:
id: clearn_btn
text: "[b]Clear[/b]"
background_color: COLOR(RED)
markup: True
size_hint: .3, None
height: question_text.texture_size[1]
on_release: answer_text.text = ""
KeyPad:
<MathPopup>:
size_hint: .8, .8
title: "Result"
title_size: root.height * .05
seperator_color: COLOR(GREEN)
auto_dissmiss: False
message: message
wrapped_button: wrapped_button
BoxLayout:
orientation: "vertical"
padding: root.width * .02, root.height * .02
spacing: min(root.width, root.height) * .02
Label:
id: message
text: "sldkjfskldjflsdjfkljdslfj"
halign: "center"
markup: True
font_size: root.height / 10
text_size: self.width, None
center_y: .5
Button:
id: wrapped_button
text: "Close"
size_hint: 1, None
height: root.height / 8
on_release: root.dismiss()
<AboutScreen@Screen>:
BoxLayout:
padding: root.width * .02, root.height * .02
Label:
text: app.getText()
halign: "center"
markup: True
font_size: root.height / 20
text_size: self.width, None
center_y: .5
on_ref_press: app.on_ref_press(*args)