annotate cagou/kv/widgets_handler.kv @ 305:b2727877bad4

remote: fixed workflow and size for XMLUI panel used with Ad-Hoc commands: the XMLUI panel was added to the StackLayout used for discovery, resulting in a bad sizing. This patch fixes this by moving discovery panel to a new widget, and adding a main BoxLayout where the XMLUI panel are added. The XMLUI close callback is now handled properly. fix 325
author Goffi <goffi@goffi.org>
date Fri, 19 Jul 2019 17:13:05 +0200
parents 1b835bcfa663
children 19422bbd9c8e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
282
1b835bcfa663 date update
Goffi <goffi@goffi.org>
parents: 154
diff changeset
2 # Copyright (C) 2016-2019 Jérôme Poisson (goffi@goffi.org)
13
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This program is free software: you can redistribute it and/or modify
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it under the terms of the GNU Affero General Public License as published by
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # the Free Software Foundation, either version 3 of the License, or
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # (at your option) any later version.
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # GNU Affero General Public License for more details.
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # You should have received a copy of the GNU Affero General Public License
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
12a189fbb9ba widget handler first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16
154
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
17 <WHWrapper>:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
18 carousel: carousel
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
19 _sp_top_y: self.y + self.height - self.sp_size
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
20 padding: self.split_size + self.split_margin, self.split_size + self.split_margin, 0, 0
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
21
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
22 canvas.before:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
23 # 2 lines to indicate the split zones
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
24 Color:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
25 rgba: self.split_color if self._split != 'left' else self.split_color_del if self._split_del else self.split_color_move
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
26 Rectangle:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
27 pos: self.pos
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
28 size: self.split_size, self.height
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
29 Color:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
30 rgba: self.split_color if self._split != 'top' else self.split_color_del if self._split_del else self.split_color_move
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
31 Rectangle:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
32 pos: self.x, self.y + self.height - self.split_size
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
33 size: self.width, self.split_size
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
34 # 3 dots to indicate the main split points
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
35 Color:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
36 rgba: 0, 0, 0, 1
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
37 Point:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
38 # left
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
39 points: self.x + self.sp_size, self.y + self.height / 2 - self.sp_size - self.sp_space, self.x + self.sp_size, self.y + self.height / 2, self.x + self.sp_size, self.y + self.height / 2 + self.sp_size + self.sp_space
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
40 pointsize: self.sp_size
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
41 Point:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
42 # top
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
43 points: self.x + self.width / 2 - self.sp_size - self.sp_space, root._sp_top_y, self.x + self.width / 2, root._sp_top_y, self.x + self.width / 2 + self.sp_size + self.sp_space, root._sp_top_y
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
44 pointsize: self.sp_size
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
45
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
46 Carousel:
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
47 id: carousel
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
48 direction: 'right'
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
49 ignore_perpendicular_swipes: True
a5e8833184c6 widget handler: refactoring:
Goffi <goffi@goffi.org>
parents: 126
diff changeset
50 loop: True