Mercurial > libervia-desktop-kivy
annotate src/cagou/kv/root_widget.kv @ 113:c439c271ecdd
core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 26 Jan 2017 20:39:15 +0100 |
parents | c2a7234d13d2 |
children | 15434a7787ed |
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
bd3ecac18870
cagou widget, root widget: used of dp to specify distances
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
36 height: dp(50) |
29 | 37 |
38 <NotesDrop>: | |
39 clear_btn: clear_btn.__self__ | |
40 auto_width: False | |
41 size_hint: 0.8, None | |
113
c439c271ecdd
core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents:
85
diff
changeset
|
42 canvas.before: |
c439c271ecdd
core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents:
85
diff
changeset
|
43 Color: |
c439c271ecdd
core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents:
85
diff
changeset
|
44 rgba: 0.8, 0.8, 0.8, 1 |
c439c271ecdd
core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents:
85
diff
changeset
|
45 Rectangle: |
c439c271ecdd
core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents:
85
diff
changeset
|
46 pos: self.pos |
c439c271ecdd
core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents:
85
diff
changeset
|
47 size: self.size |
29 | 48 Button: |
49 id: clear_btn | |
50 text: "clear" | |
51 bold: True | |
52 size_hint: 1, None | |
36
bd3ecac18870
cagou widget, root widget: used of dp to specify distances
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
53 height: dp(50) |
29 | 54 on_release: del root.notes[:]; root.dismiss() |
55 | |
56 <RootHeadWidget>: | |
57 manager: manager | |
33
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
58 notifs_icon: notifs_icon |
29 | 59 size_hint: 1, None |
36
bd3ecac18870
cagou widget, root widget: used of dp to specify distances
Goffi <goffi@goffi.org>
parents:
33
diff
changeset
|
60 height: dp(35) |
29 | 61 IconButton: |
62 source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") if root.notes else app.expand("{media}/misc/black.png") | |
62 | 63 allow_stretch: True |
29 | 64 size_hint: None, 1 |
81
3608fef1857d
core: use norm_image_size for headers'icons
Goffi <goffi@goffi.org>
parents:
62
diff
changeset
|
65 width: self.norm_image_size[0] |
29 | 66 on_release: root.notes_drop.open(self) if root.notes else None |
67 ScreenManager: | |
68 id: manager | |
33
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
69 NotifsIcon: |
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
70 id: notifs_icon |
62 | 71 allow_stretch: True |
33
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
72 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
|
73 size_hint: None, 1 |
81
3608fef1857d
core: use norm_image_size for headers'icons
Goffi <goffi@goffi.org>
parents:
62
diff
changeset
|
74 width: self.norm_image_size[0] |
33
c21d1be2e54c
core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents:
29
diff
changeset
|
75 |
85
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
76 <RootMenus>: |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
77 size_hint: 1, None |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
78 pos_hint: {'top': 1} |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
79 |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
80 <CagouRootWidget>: |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
81 root_body: root_body |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
82 root_menus: root_menus |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
83 # main body |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
84 RootBody: |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
85 id: root_body |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
86 orientation: "vertical" |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
87 size_hint: 1, None |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
88 height: root.height - root_menus.height |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
89 # general menus |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
90 # need to be added at the end so it's drawed above other widgets |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
91 RootMenus: |
c2a7234d13d2
menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents:
81
diff
changeset
|
92 id: root_menus |