-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkwgui.kv
executable file
·236 lines (212 loc) · 5.36 KB
/
kwgui.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
##### :kivy 1.8
############ Root (first-tier)
# these are commented because, if not, "MainForm" could appear as a
# property (not a child) of RootWindow. It's children status is given by
# adding MainForm in the .py through .add_widget()
#<RootWindow>
# MainForm
############## Forms (second-tier)
<MainForm@BoxLayout>:
orientation: 'vertical'
padding: 20
size: self.size
pos: self.pos
SearchBox:
id: search_box
size_hint: 1, None
height: "50dp"
BoxLayout:
BoxLayout:
size_hint: 20, 1
orientation: 'vertical'
#RedLbl:
# label_text: "Current Keywords"
# size_hint: 1, None
# height: "40dp"
#ScrollView:
KeywordPanel:
id: keyword_panel
TrashCan
#FloatingKeyword:
# text: "keyword 1"
# pos: (50, self.parent.height/2.)
#pos: (50, 500)
#pos_hint: {"x": 0.5, "y":0.5}
# font_size: 20
#FloatingKeyword:
# text: "keyword 2"
# pos: (200, 300)
# font_size: 15
ImagesPanel:
id: images_panel
size_hint: 80, 1
orientation: 'vertical'
GridLayout:
rows: 3
AsyncImage:
source: 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcT7CaS5AwDH6xDxxErz7KRxphA7M6wgkKOTjJ4eQdINCRYt25MSvtZqpw'
#AsyncImage:
# source: 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSlBwqQ4jggvaULgaiiXQTf7atA6RAiZdrYX_OZgtbjXBX-4DtMDL_Af-AA'
#BoxLayout:
# size_hint: 60, 1
# orientation: 'vertical'
#RedLbl:
# label_text: "Images"
# size_hint: 1, None
# height: "40dp"
BoxLayout
NavigationControls:
id: navigation_controls
#search_box: search_box
#BoxLayout:
# size_hint: 1, None
# height: "30dp"
# Btn:
# text: "<<"
# Btn:
# text: "||"
# Btn:
# text: "o"
# Btn:
# text: ">>"
############# utilities (3rd tier)
<Btn>
background_color: 1, 0, 0, 1
size_hint: 1, None
size: 1, "30dp"
<BlackBtn>
background_color: 0, 0, 0, 1
#size_hint: 1, None
#height: "30dp"
<CustomLayout@FloatLayout>
canvas.before:
Color:
rgba: 0, 1, 0, 1
Rectangle:
pos: self.pos
size: self.size
<Lbl>
canvas.before:
Color:
rgb: 0, 0, 0
Rectangle:
pos: self.pos
size: self.size
<CheckableItem>
CheckBox:
size_hint: None, 1
size: "20dp", 1
Label:
id: label
text: root.item_label
<RedLbl>
label_text: "red label"
text: "[color=ff3333][b]{label}[/b][/color]".format(label=root.label_text)
markup: True
<EntryField>
orientation: 'vertical'
text: input_from_user.text
#on_text_validate: None
Lbl:
text: root.field_label
size_hint: 1, None
height: "20dp"
TextInput:
id: input_from_user
text: root.user_input
size_hint: 1, None
height: "30dp"
multiline: False
#on_text_validate: root.on_enter()
<DraggableWidget>:
size_hint: None, None
###### Policies
<FloatingKeyword@DraggableWidget>:
text: "keyword"
#size: (50,50)
size: lbl.texture_size
font_size: 15#12
color: (1,1,1,1)
#canvas:
# Color:
# rgb: [0.2, 0.2, 0.2]
# Ellipse:
# pos: self.pos
# size: self.size
Label:
id: lbl
size: self.texture_size
#size: root.size
text: root.text
font_size: root.font_size
color: root.color
<TrashCan@BoxLayout>:
#img_size: "100dp"
#size: self.parent.size[0], self.img_size
#size_hint: None, None
#pos_hint: {"x":1., "y":0}
#opacity: 0.5
#my_parent: self.parent
canvas.before:
Color:
rgb: 1, 0, 0
Rectangle:
pos: self.pos
size: self.size
#BoxLayout
#Image:
# id: Img
# source:"trashcan.png"
# size: root.img_size, root.img_size
# size_hint: None, None
#BoxLayout
<KeywordPanel>:
size: 100, 100
on_size: self.reposition_children
on_pos: self.reposition_children
#on_size: self.reposition_children
#on_pos: self.reposition_children
#my_size: self.size
#canvas.before:
# Color:
# rgb: 0, 0, 0
# Rectangle:
# pos: self.pos
# size: self.size
#<ImagesPanel>:
#on_size: self.reposition_children
<SearchBox@BoxLayout>:
#text: search_keywords.text
text: input_from_user.text
TextInput:
id: input_from_user
size_hint: 90, None
height: "30dp"
multiline: False
hint_text: "Enter search keywords"
keyboard_suggestions: True
on_text_validate: root.button_pressed()
Btn:
id: search_button
text: "Search"
size_hint: 10, None
on_press: root.button_pressed()
<NavigationControls>:
size_hint: 1, None
height: "30dp"
#Btn:
# id: back_button
# text: "<<"
# on_press: root.go_back()
Btn:
id: pause_button
text: "||"
on_press: root.toggle_pause()
Btn:
id: stop_button
text: "o"
on_press: root.toggle_stop()
#Btn:
# id: forward_button
# text: ">>"
# on_press: go_forward()