annotate cagou/kv/root_widget.kv @ 131:36fc269e2a32

core: changed default background color to white
author Goffi <goffi@goffi.org>
date Fri, 06 Apr 2018 16:12:58 +0200
parents cd99f70ea592
children 11d134eb51d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
126
cd99f70ea592 global file reorganisation:
Goffi <goffi@goffi.org>
parents: 114
diff changeset
2 # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org)
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This program is free software: you can redistribute it and/or modify
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it under the terms of the GNU Affero General Public License as published by
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # the Free Software Foundation, either version 3 of the License, or
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # (at your option) any later version.
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # GNU Affero General Public License for more details.
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # You should have received a copy of the GNU Affero General Public License
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 #:import IconButton cagou.core.common.IconButton
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
18
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
19 # <NotifIcon>:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 # source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png")
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 # size_hint: None, None
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 # size: self.texture_size
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
23
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 <Note>:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 text: self.message
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
26
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 <NoteDrop>:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
28 canvas.before:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 Color:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
30 rgba: 1, 1, 1, 1
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 BorderImage:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32 pos: self.pos
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 size: self.size
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 source: 'atlas://data/images/defaulttheme/button'
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 size_hint: 1, None
114
15434a7787ed core (notifications): notification now grow in height with text size
Goffi <goffi@goffi.org>
parents: 113
diff changeset
36 text_size: self.width, None
15434a7787ed core (notifications): notification now grow in height with text size
Goffi <goffi@goffi.org>
parents: 113
diff changeset
37 halign: 'center'
15434a7787ed core (notifications): notification now grow in height with text size
Goffi <goffi@goffi.org>
parents: 113
diff changeset
38 height: self.texture_size[1]
15434a7787ed core (notifications): notification now grow in height with text size
Goffi <goffi@goffi.org>
parents: 113
diff changeset
39 padding: dp(2), dp(10)
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
40
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 <NotesDrop>:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
42 clear_btn: clear_btn.__self__
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
43 auto_width: False
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
44 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
45 canvas.before:
c439c271ecdd core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents: 85
diff changeset
46 Color:
c439c271ecdd core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents: 85
diff changeset
47 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
48 Rectangle:
c439c271ecdd core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents: 85
diff changeset
49 pos: self.pos
c439c271ecdd core (notifications), CagouWidget: a backround rectangle is drawned behind drop boxes
Goffi <goffi@goffi.org>
parents: 85
diff changeset
50 size: self.size
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
51 Button:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
52 id: clear_btn
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
53 text: "clear"
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
54 bold: True
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
55 size_hint: 1, None
36
bd3ecac18870 cagou widget, root widget: used of dp to specify distances
Goffi <goffi@goffi.org>
parents: 33
diff changeset
56 height: dp(50)
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
57 on_release: del root.notes[:]; root.dismiss()
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
58
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
59 <RootHeadWidget>:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
60 manager: manager
33
c21d1be2e54c core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents: 29
diff changeset
61 notifs_icon: notifs_icon
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
62 size_hint: 1, None
36
bd3ecac18870 cagou widget, root widget: used of dp to specify distances
Goffi <goffi@goffi.org>
parents: 33
diff changeset
63 height: dp(35)
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
64 IconButton:
131
36fc269e2a32 core: changed default background color to white
Goffi <goffi@goffi.org>
parents: 126
diff changeset
65 source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") if root.notes else None
62
1922506846be design fixes:
Goffi <goffi@goffi.org>
parents: 36
diff changeset
66 allow_stretch: True
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
67 size_hint: None, 1
81
3608fef1857d core: use norm_image_size for headers'icons
Goffi <goffi@goffi.org>
parents: 62
diff changeset
68 width: self.norm_image_size[0]
29
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
69 on_release: root.notes_drop.open(self) if root.notes else None
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
70 ScreenManager:
8b5827c43155 notes first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
71 id: manager
33
c21d1be2e54c core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents: 29
diff changeset
72 NotifsIcon:
c21d1be2e54c core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents: 29
diff changeset
73 id: notifs_icon
62
1922506846be design fixes:
Goffi <goffi@goffi.org>
parents: 36
diff changeset
74 allow_stretch: True
131
36fc269e2a32 core: changed default background color to white
Goffi <goffi@goffi.org>
parents: 126
diff changeset
75 source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") if self.notifs else None
33
c21d1be2e54c core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents: 29
diff changeset
76 size_hint: None, 1
81
3608fef1857d core: use norm_image_size for headers'icons
Goffi <goffi@goffi.org>
parents: 62
diff changeset
77 width: self.norm_image_size[0]
33
c21d1be2e54c core: XMLUI notifications coming from backend are handled:
Goffi <goffi@goffi.org>
parents: 29
diff changeset
78
85
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
79 <RootMenus>:
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
80 size_hint: 1, None
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
81 pos_hint: {'top': 1}
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
82
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
83 <CagouRootWidget>:
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
84 root_body: root_body
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
85 root_menus: root_menus
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
86 # main body
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
87 RootBody:
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
88 id: root_body
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
89 orientation: "vertical"
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
90 size_hint: 1, None
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
91 height: root.height - root_menus.height
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
92 # general menus
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
93 # 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
94 RootMenus:
c2a7234d13d2 menu: use of garden's contextmenu for menus
Goffi <goffi@goffi.org>
parents: 81
diff changeset
95 id: root_menus