Mercurial > libervia-desktop-kivy
annotate cagou/kv/menu.kv @ 491:203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 08 Apr 2023 13:44:32 +0200 |
parents | 3c9ba4a694ef |
children |
rev | line source |
---|---|
51 | 1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client |
461 | 2 # Copyright (C) 2016-2021 Jérôme Poisson (goffi@goffi.org) |
51 | 3 |
4 # This program is free software: you can redistribute it and/or modify | |
5 # it under the terms of the GNU Affero General Public License as published by | |
6 # the Free Software Foundation, either version 3 of the License, or | |
7 # (at your option) any later version. | |
8 | |
9 # This program is distributed in the hope that it will be useful, | |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 # GNU Affero General Public License for more details. | |
13 | |
14 # You should have received a copy of the GNU Affero General Public License | |
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
17 #:import _ sat.core.i18n._ |
275
1f88e7781fd0
menu: added a padding to MenusWidget to align on left margin
Goffi <goffi@goffi.org>
parents:
222
diff
changeset
|
18 #:import C cagou.core.constants.Const |
51 | 19 |
20 <AboutContent>: | |
21 text_size: self.size | |
131
36fc269e2a32
core: changed default background color to white
Goffi <goffi@goffi.org>
parents:
126
diff
changeset
|
22 color: 1, 1, 1, 1 |
51 | 23 halign: "center" |
24 valign: "middle" | |
25 | |
26 <AboutPopup>: | |
27 title_align: "center" | |
28 size_hint: 0.8, 0.8 | |
85
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
51
diff
changeset
|
29 |
376 | 30 <ExtraMenuItem>: |
85
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
51
diff
changeset
|
31 size_hint: 1, None |
376 | 32 height: dp(30) |
85
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
51
diff
changeset
|
33 |
376 | 34 <ExtraSideMenu>: |
35 bg_color: 0.23, 0.23, 0.23, 1 | |
36 ExtraMenuItem: | |
37 text: _("About") | |
491
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
38 on_press: root.on_about() |
376 | 39 Widget: |
40 # to push content to the top | |
181
9d7a9866b495
core: use secondary color for main menu highlight
Goffi <goffi@goffi.org>
parents:
168
diff
changeset
|
41 |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
42 <TransferMenu>: |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
43 items_layout: items_layout |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
44 orientation: "vertical" |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
45 bg_color: app.c_prim |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
46 size_hint: 1, 0.5 |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
47 padding: [app.MARGIN_LEFT, 3, app.MARGIN_RIGHT, 0] |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
48 spacing: dp(5) |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
49 transfer_info: transfer_info |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
50 upload_btn: upload_btn |
491
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
51 on_encrypted: self.update_transfer_info() |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
52 canvas.after: |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
53 Color: |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
54 rgba: app.c_prim_dark |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
55 Line: |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
56 points: 0, self.y + self.height, self.width + self.x, self.y + self.height |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
57 width: 1 |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
58 BoxLayout: |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
59 size_hint: 1, None |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
60 height: dp(50) |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
61 spacing: dp(10) |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
62 Widget: |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
63 SymbolToggleLabel |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
64 id: upload_btn |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
65 symbol: "upload" |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
66 text: _(u"upload") |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
67 group: "transfer" |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
68 state: "down" |
491
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
69 on_state: root.update_transfer_info() |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
70 SymbolToggleLabel |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
71 id: send_btn |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
72 symbol: "loop-alt" |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
73 text: _(u"send") |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
74 group: "transfer" |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
75 Widget: |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
76 Label: |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
77 id: transfer_info |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
78 size_hint: 1, None |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
79 padding: 0, dp(5) |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
80 markup: True |
452
ee4913d35c55
menu (TransferMenu): fixed transfer_info background:
Goffi <goffi@goffi.org>
parents:
417
diff
changeset
|
81 text_size: self.width, None |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
82 size: self.texture_size |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
83 halign: 'center' |
417
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
84 canvas.before: |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
85 Color: |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
86 rgba: app.c_prim_dark |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
87 RoundedRectangle: |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
88 pos: self.pos |
5b50b7ef2617
menu (TransferMenu): UI improvments:
Goffi <goffi@goffi.org>
parents:
415
diff
changeset
|
89 size: self.size |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
90 ScrollView: |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
91 do_scroll_x: False |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
92 StackLayout: |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
93 size_hint: 1, None |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
94 padding: 20, 0 |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
95 spacing: 15, 5 |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
96 id: items_layout |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
97 |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
98 <TransferItem>: |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
99 orientation: "vertical" |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
100 size_hint: None, None |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
101 size: dp(50), dp(90) |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
102 IconButton: |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
103 source: root.plug_info['icon_medium'] |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
104 allow_stretch: True |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
105 size_hint: 1, None |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
106 height: dp(50) |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
107 Label: |
415 | 108 color: 0, 0, 0, 1 |
97
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
109 text: root.plug_info['name'] |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
110 text_size: self.size |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
111 halign: "center" |
5d2289127bb7
menu (upload): better menu using dedicated widget:
Goffi <goffi@goffi.org>
parents:
86
diff
changeset
|
112 valign: "top" |
197
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
113 |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
114 |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
115 <SideMenu>: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
116 orientation: "vertical" |
216
e42e0c45d384
core (menu): allow to specify size in SideMenu:
Goffi <goffi@goffi.org>
parents:
197
diff
changeset
|
117 size_hint: self.size_hint_close |
197
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
118 canvas.before: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
119 Color: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
120 rgba: self.bg_color |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
121 Rectangle: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
122 pos: self.pos |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
123 size: self.size |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
124 |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
125 |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
126 <EntitiesSelectorMenu>: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
127 bg_color: 0, 0, 0, 0.9 |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
128 filter_input: filter_input |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
129 layout: layout |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
130 callback_on_close: True |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
131 Label: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
132 size_hint: 1, None |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
133 text_size: root.width, None |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
134 size: self.texture_size |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
135 padding: dp(5), dp(5) |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
136 color: 1, 1, 1, 1 |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
137 text: root.instructions |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
138 halign: "center" |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
139 TextInput: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
140 id: filter_input |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
141 size_hint: 1, None |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
142 height: dp(32) |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
143 multiline: False |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
144 hint_text: _(u"enter filter here") |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
145 ScrollView: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
146 size_hint: 1, 1 |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
147 BoxLayout: |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
148 id: layout |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
149 orientation: "vertical" |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
150 size_hint: 1, None |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
151 height: self.minimum_height |
c7d15ef4bfa8
core (menu): new EntitiesSelectorMenu:
Goffi <goffi@goffi.org>
parents:
187
diff
changeset
|
152 spacing: dp(5) |