Mercurial > libervia-desktop-kivy
annotate src/cagou/kv/root_widget.kv @ 33:c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
when a notification from backend is coming, it's added to a notification icon (on the right for important notifications which need user action, while left icon is used for notes).
If user click on the notification icon, the XMLUI replace the main widget with a rise animation. When action is finished, ui is closed with a fall out animation.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 21 Aug 2016 21:41:52 +0200 |
parents | 8b5827c43155 |
children | bd3ecac18870 |
rev | line source |
---|---|
29 | 1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client |
2 # Copyright (C) 2016 Jérôme Poisson (goffi@goffi.org) | |
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 | |
17 #:import IconButton cagou.core.common.IconButton | |
18 | |
19 # <NotifIcon>: | |
20 # source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") | |
21 # size_hint: None, None | |
22 # size: self.texture_size | |
23 | |
24 <Note>: | |
25 text: self.message | |
26 | |
27 <NoteDrop>: | |
28 canvas.before: | |
29 Color: | |
30 rgba: 1, 1, 1, 1 | |
31 BorderImage: | |
32 pos: self.pos | |
33 size: self.size | |
34 source: 'atlas://data/images/defaulttheme/button' | |
35 size_hint: 1, None | |
36 height: 50 | |
37 | |
38 <NotesDrop>: | |
39 clear_btn: clear_btn.__self__ | |
40 auto_width: False | |
41 size_hint: 0.8, None | |
42 Button: | |
43 id: clear_btn | |
44 text: "clear" | |
45 bold: True | |
46 size_hint: 1, None | |
47 height: 50 | |
48 on_release: del root.notes[:]; root.dismiss() | |
49 | |
50 <RootHeadWidget>: | |
51 manager: manager | |
33
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
52 notifs_icon: notifs_icon |
29 | 53 size_hint: 1, None |
54 height: 35 | |
55 IconButton: | |
56 source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") if root.notes else app.expand("{media}/misc/black.png") | |
57 size_hint: None, 1 | |
58 width: self.texture_size[0] | |
59 on_release: root.notes_drop.open(self) if root.notes else None | |
60 ScreenManager: | |
61 id: manager | |
33
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
62 NotifsIcon: |
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
63 id: notifs_icon |
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
64 source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") if self.notifs else app.expand("{media}/misc/black.png") |
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
65 size_hint: None, 1 |
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
66 width: self.texture_size[0] |
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
67 |