annotate src/cagou/kv/xmlui.kv @ 105:ce6ef88f2cff

chat: avatar improvments: - avatar source is not set anymore in kv but on MessageWidget init, so None value can be handled correclty - Message widget add itself to mess_data before parsing kv, so call to properties in kv can update the widget correctly (specially important for embedded bridge)
author Goffi <goffi@goffi.org>
date Sun, 15 Jan 2017 18:02:53 +0100
parents f67b9baa81f0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # Copyright (C) 2016 Jérôme Poisson (goffi@goffi.org)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
3
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This program is free software: you can redistribute it and/or modify
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it under the terms of the GNU Affero General Public License as published by
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # the Free Software Foundation, either version 3 of the License, or
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # (at your option) any later version.
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
8
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # GNU Affero General Public License for more details.
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
13
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # You should have received a copy of the GNU Affero General Public License
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
16
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
17 #:set common_height 30
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
18 #:set button_height 50
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
19
62
1922506846be design fixes:
Goffi <goffi@goffi.org>
parents: 53
diff changeset
20 <EmptyWidget,TextWidget,LabelWidget,JidWidget,StringWidget,PasswordWidget,JidInputWidget>:
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
21 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
22 height: dp(common_height)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
23
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
24
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
25 <ButtonWidget>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
26 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
27 height: dp(button_height)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
28
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
29
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
30 <BoolWidget>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
31 size_hint: 1, 1
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
32
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
33
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
34 <DividerWidget>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
35 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
36 height: dp(20)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
37 canvas.before:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
38 Color:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
39 rgba: 1, 1, 1, 0.8
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
40 Line
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
41 points: 0, dp(10), self.width, dp(10)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
42 width: dp(3)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
43
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
44
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
45 <ListWidgetItem>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
46 size_hint_y: None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
47 height: dp(button_height)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
48
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
49
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
50 <ListWidget>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
51 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
52 height: dp(button_height)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
53
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
54
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
55 <AdvancedListRow>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
56 canvas.before:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
57 Color:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
58 rgba: 1, 1, 1, 0.2 if self.global_index%2 else 0.1
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
59 Rectangle:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
60 pos: self.pos
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
61 size: self.size
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
62 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
63 height: self.minimum_height
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
64 rows: 1
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
65 canvas.after:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
66 Color:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
67 rgba: 0, 0, 1, 0.5 if self.selected else 0
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
68 Rectangle:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
69 pos: self.pos
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
70 size: self.size
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
71
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
72
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
73 <AdvancedListContainer>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
74 cols: 1
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
75 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
76 height: self.minimum_height
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
77
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
78
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
79 <VerticalContainer>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
80 cols: 1
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
81 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
82 height: self.minimum_height
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
83
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
84
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
85 <PairsContainer>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
86 cols: 2
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
87 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
88 height: self.minimum_height
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
89
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
90
69
a9c6b089070d xmlui: improvments to prepare parameters:
Goffi <goffi@goffi.org>
parents: 62
diff changeset
91 <TabsContainer>:
a9c6b089070d xmlui: improvments to prepare parameters:
Goffi <goffi@goffi.org>
parents: 62
diff changeset
92 size_hint: 1, None
a9c6b089070d xmlui: improvments to prepare parameters:
Goffi <goffi@goffi.org>
parents: 62
diff changeset
93 height: 100
a9c6b089070d xmlui: improvments to prepare parameters:
Goffi <goffi@goffi.org>
parents: 62
diff changeset
94
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
95
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
96 <FormButton>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
97 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
98 height: dp(button_height)
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
99
99
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
100
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
101 <FileDialog>:
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
102 orientation: "vertical"
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
103 message: message
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
104 file_chooser: file_chooser
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
105 Label:
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
106 id: message
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
107 size_hint: 1, None
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
108 text_size: root.width, None
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
109 size: self.texture_size
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
110 FileChooserListView:
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
111 id: file_chooser
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
112 Button:
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
113 size_hint: 1, None
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
114 height: dp(50)
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
115 text: "choose"
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
116 on_release: root.onSelect(file_chooser.selection)
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
117 Button:
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
118 size_hint: 1, None
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
119 height: dp(50)
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
120 text: "cancel"
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
121 on_release: root.onCancel()
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
122
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
123
f67b9baa81f0 xmlui: FileDialog first draft
Goffi <goffi@goffi.org>
parents: 69
diff changeset
124
53
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
125 <XMLUIPanelGrid>:
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
126 cols: 1
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
127 size_hint: 1, None
65775152aac1 xmlui: implemented most of XMLUI, not finished yet
Goffi <goffi@goffi.org>
parents:
diff changeset
128 height: self.minimum_height