comparison libervia/desktop_kivy/kv/root_widget.kv @ 493:b3cedbee561d

refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
author Goffi <goffi@goffi.org>
date Fri, 02 Jun 2023 18:26:16 +0200
parents cagou/kv/root_widget.kv@3c9ba4a694ef
children
comparison
equal deleted inserted replaced
492:5114bbb5daa3 493:b3cedbee561d
1 #Libervia Desktop-Kivy
2 # Copyright (C) 2016-2021 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 libervia.desktop_kivy.core.common.IconButton
18 #:import C libervia.desktop_kivy.core.constants.Const
19
20 # <NotifIcon>:
21 # source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png")
22 # size_hint: None, None
23 # size: self.texture_size
24
25 <Note>:
26 text: self.message
27 text_size: self.parent.size if self.parent else (100, 100)
28 halign: 'center'
29 padding_x: dp(5)
30 shorten: True
31 shorten_from: 'right'
32
33 <NoteDrop>:
34 orientation: 'horizontal'
35 size_hint: 1, None
36 height: max(label.height, dp(45))
37 symbol: symbol
38 canvas.before:
39 BorderImage:
40 pos: self.pos
41 size: self.size
42 source: 'atlas://data/images/defaulttheme/button'
43 Widget:
44 size_hint: None, 1
45 width: dp(20)
46 Symbol:
47 id: symbol
48 size_hint: None, 1
49 width: dp(30)
50 padding_y: dp(10)
51 valign: 'top'
52 haligh: 'right'
53 symbol: root.symbol or root.level
54 color:
55 C.COLOR_PRIM_LIGHT if root.symbol is None else \
56 {C.XMLUI_DATA_LVL_INFO: app.c_prim_light,\
57 C.XMLUI_DATA_LVL_WARNING: C.COLOR_WARNING,\
58 C.XMLUI_DATA_LVL_ERROR: C.COLOR_ERROR}[root.level]
59 Label:
60 id: label
61 size_hint: 1, None
62 color: 1, 1, 1, 1
63 text: root.message
64 text_size: self.width, None
65 halign: 'center'
66 size: self.texture_size
67 padding: dp(2), dp(10)
68
69 <NotesDrop>:
70 clear_btn: clear_btn.__self__
71 auto_width: False
72 size_hint: 0.9, None
73 size_hint_max_x: dp(400)
74 canvas.before:
75 Color:
76 rgba: 0.8, 0.8, 0.8, 1
77 Rectangle:
78 pos: self.pos
79 size: self.size
80 Button:
81 id: clear_btn
82 text: "clear"
83 bold: True
84 size_hint: 1, None
85 height: dp(50)
86 on_release: del root.notes[:]; root.dismiss()
87
88 <RootHeadWidget>:
89 manager: manager
90 notifs_icon: notifs_icon
91 size_hint: 1, None
92 height: self.HEIGHT
93 padding: app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, 0
94 IconButton:
95 source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_48.png")
96 allow_stretch: True
97 size_hint: None, None
98 pos_hint: {'center_y': .5}
99 height: dp(25)
100 width: dp(35) if root.notes else 0
101 opacity: 1 if root.notes else 0
102 on_release: root.notes_drop.open(self) if root.notes else None
103 ScreenManager:
104 id: manager
105 NotifsIcon:
106 id: notifs_icon
107 allow_stretch: True
108 source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_miroir_48.png")
109 size_hint: None, None
110 pos_hint: {'center_y': .5}
111 height: dp(25)
112 width: dp(35) if self.notifs else 0
113 opacity: 1 if self.notifs else 0
114 Symbol:
115 id: disconnected_icon
116 size_hint: None, 1
117 pos_hint: {'center_y': .5}
118 font_size: dp(23)
119 width: 0 if app.connected else dp(30)
120 opacity: 0 if app.connected else 1
121 symbol: "plug"
122 color: 0.80, 0.0, 0.0, 1
123
124 <LiberviaDesktopKivyRootWidget>:
125 root_body: root_body
126 RootBody:
127 id: root_body
128 orientation: "vertical"