-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkanjiorigin.kv
104 lines (86 loc) · 3.18 KB
/
kanjiorigin.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
#:kivy 1.9.1
#<ActionLabel@ActionItem+Label>:
# text_size: self.width - dp(6), self.height
# halign: 'center'
# valign: 'middle'
# minimum_width: '60sp'
<ActionLabel>:
# text_size: self.width - dp(6), self.height
halign: 'center'
valign: 'middle'
minimum_width: '40sp'
<-ScaleButton@Button>:
padding: [dp(20), dp(10)]
font_size: self.height *.3
state_image: self.background_normal if self.state == 'normal' else self.background_down
disabled_image: self.background_disabled_normal if self.state == 'normal' else self.background_disabled_down
# +.00001 to prevent division by 0 error on Android
_scale: 1. if self.texture_size[0] < self.width else (float(self.width) / (self.texture_size[0]+.00001))
canvas:
Color:
rgba: self.background_color
BorderImage:
border: self.border
pos: self.pos
size: self.size
source: self.disabled_image if self.disabled else self.state_image
PushMatrix
Scale:
origin: self.center
x: self._scale or 1.
y: self._scale or 1.
Color:
rgba: self.disabled_color if self.disabled else self.color
Rectangle:
texture: self.texture
size: self.texture_size
pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.)
PopMatrix
<KanjiOriginScreen>:
# ScrollView:
# do_scroll_x: False
# do_scroll_y: False if root.fullscreen else (content.height > root.height - dp(16))
# AnchorLayout:
# size_hint_y: None
# height: root.height if root.fullscreen else max(root.height, content.height)
BoxLayout: # GridLayout
id: content
orientation: 'vertical'
#cols: 1
spacing: '20dp' # '16dp'
padding: '8dp' if root.fullscreen else ['40dp', '52dp'] # padding: '8dp'
size_hint: (1, 1)# if root.fullscreen else (.8, None)
#height: self.height if root.fullscreen else self.minimum_height
BoxLayout:
orientation: 'vertical'
canvas.before:
Color:
rgb: .6, .6, .6
Rectangle:
size: self.size
source: 'data/background.png'
#BoxLayout:
# size: self.size
# orientation: 'horizontal'
ActionBar:
ActionView:
id: av
ActionPrevious:
id: actp
ac_prev: app
#app_icon: 'path/' #App icon
with_previous: (False if sm.current_screen.name == 'MainMenu' else True) if sm.current_screen else False
title: ('Home' if not sm.current_screen.name == 'MainMenu' else '') if sm.current_screen else ''
# 'Home' + ('' if not app.current_title else ' - {}'.format(app.current_title))
on_release: self.ac_prev.screen_changer() # if not sm.current_screen.name == 'MainMenu': app.go_screen(0)
ActionLabel:
#Label:
id:lbl1
text: "Study: {} | {}".format(app.actionbar_status[0], app.actionbar_status[1])
ActionLabel:
id:lbl2
text: "Seen: {} / {}".format(app.actionbar_status[2], app.actionbar_status[3])
ScreenManager:
id: sm
on_current_screen:
idx = app.screen_names.index(args[1].name)