annotate cagou/plugins/plugin_wid_file_sharing.kv @ 201:45a3392b9d26

plugin file sharing: use density independant pixels for Menu
author Goffi <goffi@goffi.org>
date Fri, 25 May 2018 11:52:56 +0200
parents 62198e00a2b7
children 890b48e41998
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
192
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This program is free software: you can redistribute it and/or modify
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it under the terms of the GNU Affero General Public License as published by
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # the Free Software Foundation, either version 3 of the License, or
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # (at your option) any later version.
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # GNU Affero General Public License for more details.
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # You should have received a copy of the GNU Affero General Public License
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 #:import ModernMenu kivy.garden.modernmenu.ModernMenu
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
18
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
19
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 <ModeBtn>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 width: self.texture_size[0] + sp(20)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 size_hint: None, 1
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
23
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
24
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 <FileSharing>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
26 float_layout: float_layout
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 layout: layout
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
28 FloatLayout:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 id: float_layout
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
30 ScrollView:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 size_hint: 1, 1
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32 pos_hint: {'x': 0, 'y': 0}
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 do_scroll_x: False
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 scroll_type: ['bars', 'content']
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 bar_width: dp(6)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
36 StackLayout:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
37 id: layout
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
38 size_hint: 1, None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
39 height: self.minimum_height
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
40 spacing: 0
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
42
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
43 <ItemWidget>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
44 size_hint: None, None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
45 width: self.base_width
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
46 height: self.minimum_height
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
47 orientation: 'vertical'
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
48
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
49
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
50 <PathWidget>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
51 shared: False
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
52 Symbol:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
53 size_hint: 1, None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
54 height: dp(80)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
55 symbol: 'folder-open-empty' if root.is_dir else 'doc'
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
56 margin: dp(40)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
57 color: (1, 0, 0, 1) if root.shared else (0, 0, 0, 1) if root.is_dir else app.c_prim_dark
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
58 Label:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
59 size_hint: None, None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
60 width: dp(100)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
61 font_size: sp(14)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
62 text_size: dp(95), None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
63 size: self.texture_size
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
64 text: root.name
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
65 halign: 'center'
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
66
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
67
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
68 <LocalPathWidget>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
69 shared: root.filepath in root.sharing_wid.shared_paths
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
70
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
71
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
72 <DeviceWidget>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
73 Symbol:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
74 size_hint: 1, None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
75 height: dp(80)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
76 symbol: 'desktop'
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
77 margin: dp(40)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
78 color: 0, 0, 0, 1
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
79 Label:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
80 size_hint: None, None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
81 width: dp(100)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
82 font_size: sp(14)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
83 text_size: dp(95), None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
84 size: self.texture_size
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
85 text: root.name
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
86 halign: 'center'
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
87
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
88
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
89 <CategorySeparator>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
90 size_hint: 1, None
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
91 height: sp(20)
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
92
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
93
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
94 <Menu>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
95 creation_direction: -1
201
45a3392b9d26 plugin file sharing: use density independant pixels for Menu
Goffi <goffi@goffi.org>
parents: 192
diff changeset
96 radius: dp(25)
192
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
97 creation_timeout: .4
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
98 cancel_color: app.c_sec_light[:3] + [0.3]
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
99 color: app.c_sec
201
45a3392b9d26 plugin file sharing: use density independant pixels for Menu
Goffi <goffi@goffi.org>
parents: 192
diff changeset
100 line_width: dp(2)
192
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
101
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
102 <ModernMenuLabel>:
62198e00a2b7 plugin file sharing: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
103 bg_color: app.c_sec[:3] + [0.9]
201
45a3392b9d26 plugin file sharing: use density independant pixels for Menu
Goffi <goffi@goffi.org>
parents: 192
diff changeset
104 padding: dp(5), dp(5)
45a3392b9d26 plugin file sharing: use density independant pixels for Menu
Goffi <goffi@goffi.org>
parents: 192
diff changeset
105 radius: dp(100)