-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacview.kv
281 lines (255 loc) · 7.46 KB
/
pacview.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
#:kivy 2.0.0
#:import AppRecycleView apprecycleview
#:import HighlightLabel highlight_label
#:set LIST_ITEM_HEIGHT 54
#:set LIST_WIDTH 250
#:set BAR_WIDTH 10
#:set FILTER_BAR_HEIGHT 30
# default button/acccordion colors:
#:set HIGHLIGHT_COLOR (50/255, 164/255, 206/255)
#:set NORMAL_COLOR (88/255, 88/255, 88/255)
#:include imagebutton.kv
#:include breadcrumb.kv
#:import BreadCrumb breadcrumb
#:include dialog.kv
#:import YesNoDialog dialog
<PackageDesc@Label>:
size_hint: None, None
width: 170
text_size: self.size
halign: 'left'
valign: 'top'
padding: 5,5
<PackageData@Label>:
size_hint_y: None
height: self.texture_size[1]
text_size: self.width, None
halign: 'left'
valign: 'top'
padding: 5,5
<WrapHighlightLabel@HighlightLabel>:
markup: True
highlight_color: (*HIGHLIGHT_COLOR, 1)
size_hint_y: None
height: self.texture_size[1]
text_size: self.width, None
halign: 'left'
valign: 'top'
padding: 5,5
<DescriptionRow@BoxLayout>:
desc: ''
data: ''
orientation: 'horizontal'
size_hint_y: None
height: max(pkg_desc.height, pkg_data.height)
opacity: 0 if root.data == '' else 1
PackageDesc:
id: pkg_desc
text: root.desc
height: pkg_data.height
PackageData:
id: pkg_data
text: root.data
min_height: 20
<WrapDescriptionRow>:
pkg_data: pkg_data
orientation: 'horizontal'
size_hint_y: None
height: max(pkg_desc.height, pkg_data.height)
PackageDesc:
id: pkg_desc
text: root.desc
height: pkg_data.height
WrapHighlightLabel:
id: pkg_data
text: root.data
min_height: 20
on_ref_clicked: root.ref_clicked(args[1])
<OptionButton@Button>:
size_hint_y: None
height: FILTER_BAR_HEIGHT
<SlimSpinner@Spinner>:
size_hint_y: None
height: FILTER_BAR_HEIGHT
option_cls: 'OptionButton'
<PackageView>:
highlight_labels: [hl_url, hl_depends_on, hl_required_by, hl_opt_installed, hl_opt_not_installed]
breadcrumb: breadcrumb
orientation: 'vertical'
Label:
canvas.before:
Color:
rgba: (*HIGHLIGHT_COLOR, 1)
Rectangle:
size: self.size
pos: self.pos
size_hint_y: None
height: 50
text_size: self.size
text: root.package['Name']
halign: 'center'
valign: 'center'
font_size: 30
BoxLayout:
orientation: 'vertical'
padding: 10
opacity: 0 if len(root.package['Name']) == 0 else 1
DescriptionRow:
desc: 'Description'
data: root.package['Description']
WrapDescriptionRow:
id: hl_url
desc: 'URL'
data: root.package['URL']
on_ref_clicked: root.on_ref_clicked('URL', args[1])
DescriptionRow:
desc: 'Packager'
data: root.package['Packager']
WrapDescriptionRow:
id: hl_depends_on
desc: 'Depends on'
data: root.package['DependsOn']
on_ref_clicked: root.on_ref_clicked('DependsOn', args[1])
WrapDescriptionRow:
id: hl_required_by
desc: 'Required by'
data: root.package['RequiredBy']
on_ref_clicked: root.on_ref_clicked('RequiredBy', args[1])
WrapDescriptionRow:
id: hl_opt_installed
desc: 'Installed optional'
data: root.package['InstalledOptions']
on_ref_clicked: root.on_ref_clicked('InstalledOptions', args[1])
WrapDescriptionRow:
id: hl_opt_not_installed
desc: 'Not installed optional'
data: root.package['UninstalledOptions']
on_ref_clicked: root.on_ref_clicked('UninstalledOptions', args[1])
DescriptionRow:
desc: 'Installed Size'
data: root.package['InstalledSize']
DescriptionRow:
desc: 'Installed Date'
data: root.package['InstallDate']
Widget:
BreadCrumb:
id: breadcrumb
<PackageListItemLabel@Label>:
size_hint: None,None
text_size: self.size
padding_x: 5
shorten: True
<PackageListItem>:
orientation: 'vertical'
size_hint: None,None
size: LIST_WIDTH,LIST_ITEM_HEIGHT
canvas.before:
Color:
rgba: (*HIGHLIGHT_COLOR, 1) if root.selected else root.background_color
Rectangle:
size: self.size
pos: self.pos
PackageListItemLabel:
text: root.Name
size: root.width, 30
halign: 'left'
valign: 'bottom'
bold: True
font_size: 18
PackageListItemLabel:
text: root.Version
size: root.width, LIST_ITEM_HEIGHT - 30
halign: 'right'
valign: 'top'
color: (0.9,0.9,0.9,1)
<PackageListView>:
child_layout: child_layout
viewclass: 'PackageListItem'
scroll_type: ['bars','content']
bar_width: BAR_WIDTH
scroll_wheel_distance: LIST_ITEM_HEIGHT
do_scroll_x: False
SelectableRecycleBoxLayout:
id: child_layout
size_hint_x: None
width: LIST_WIDTH
orientation: 'vertical'
default_size: None, LIST_ITEM_HEIGHT
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
multiselect: False
touch_multiselect: False
<PacView>:
listview: listview
view_selector: view_selector
selected_package: selected_package
filter_textbox: filter_textbox
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: FILTER_BAR_HEIGHT
Label:
size_hint_x: None
width: self.texture_size[0]
text: "Package Type:"
padding: 5,0
SlimSpinner:
id: view_selector
size_hint_x: None
width: 150
values: ('Explicit', 'All', 'Obsolete', 'Not Required')
Widget:
size_hint_x: None
width: 10
Label:
size_hint_x: None
width: self.texture_size[0]
text: "Package Name:"
padding: 5,0
TextInput:
id: filter_textbox
background_color: (*NORMAL_COLOR, 1)
foreground_color: (1, 1, 1, 1)
cursor_color: (*HIGHLIGHT_COLOR, 1)
multiline: False
hint_text: 'Enter text to filter names'
ImageButton:
size_hint_x: None
width: 40
on_release: root.delete_selected_package()
source: 'img/garbage_can.png'
disabled: not root.can_delete
Widget:
size_hint_y: None
height: 2
canvas:
Color:
rgb: HIGHLIGHT_COLOR
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
orientation: 'horizontal'
BoxLayout:
orientation: 'vertical'
size_hint_x: None
width: LIST_WIDTH + BAR_WIDTH
PackageListView:
id: listview
Label:
size_hint: None, None
size: LIST_WIDTH, 30
text: root.listview.title
Widget:
size_hint_x: None
width: 2
canvas:
Color:
rgb: HIGHLIGHT_COLOR
Rectangle:
pos: self.pos
size: self.size
PackageView:
id: selected_package