comparison cagou/kv/root_widget.kv @ 247:cf61a011f731

core (notes), common (symbol): added an icon showing note level: because of Symbol binding, it was difficult to precisely set the icon position, so Symbol has been modified to remove bindings. Added consts for INFO, WARNING and ERROR colors.
author Goffi <goffi@goffi.org>
date Sat, 26 Jan 2019 20:24:48 +0100
parents c5c1dd7f88e1
children ff1efdeff53f
comparison
equal deleted inserted replaced
246:15e47bbb192c 247:cf61a011f731
13 13
14 # You should have received a copy of the GNU Affero General Public License 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/>. 15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 16
17 #:import IconButton cagou.core.common.IconButton 17 #:import IconButton cagou.core.common.IconButton
18 #:import C cagou.core.constants.Const
18 19
19 # <NotifIcon>: 20 # <NotifIcon>:
20 # source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") 21 # source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png")
21 # size_hint: None, None 22 # size_hint: None, None
22 # size: self.texture_size 23 # size: self.texture_size
28 padding_x: dp(5) 29 padding_x: dp(5)
29 shorten: True 30 shorten: True
30 shorten_from: 'right' 31 shorten_from: 'right'
31 32
32 <NoteDrop>: 33 <NoteDrop>:
34 orientation: 'horizontal'
35 size_hint: 1, None
36 height: label.height
37 symbol: symbol
33 canvas.before: 38 canvas.before:
34 BorderImage: 39 BorderImage:
35 pos: self.pos 40 pos: self.pos
36 size: self.size 41 size: self.size
37 source: 'atlas://data/images/defaulttheme/button' 42 source: 'atlas://data/images/defaulttheme/button'
38 size_hint: 1, None 43 Widget:
39 color: 1, 1, 1, 1 44 size_hint: None, 1
40 text: self.message 45 width: dp(20)
41 text_size: self.width, None 46 Symbol:
42 halign: 'center' 47 id: symbol
43 size: self.texture_size 48 size_hint: None, None
44 padding: dp(2), dp(10) 49 width: dp(30)
50 height: label.height
51 padding_y: dp(10)
52 valign: 'top'
53 haligh: 'right'
54 symbol: root.level
55 color:
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)
45 68
46 <NotesDrop>: 69 <NotesDrop>:
47 clear_btn: clear_btn.__self__ 70 clear_btn: clear_btn.__self__
48 auto_width: False 71 auto_width: False
49 size_hint: 0.8, None 72 size_hint: 0.9, None
73 size_hint_max_x: dp(400)
50 canvas.before: 74 canvas.before:
51 Color: 75 Color:
52 rgba: 0.8, 0.8, 0.8, 1 76 rgba: 0.8, 0.8, 0.8, 1
53 Rectangle: 77 Rectangle:
54 pos: self.pos 78 pos: self.pos