diff cagou/kv/root_widget.kv @ 347:bf9474e164f3

core (RootWidget): a red "plug" symbol is now shown when profile is not connected.
author Goffi <goffi@goffi.org>
date Sat, 04 Jan 2020 16:24:57 +0100
parents 1b835bcfa663
children 5d994be1161b
line wrap: on
line diff
--- a/cagou/kv/root_widget.kv	Sat Jan 04 16:24:57 2020 +0100
+++ b/cagou/kv/root_widget.kv	Sat Jan 04 16:24:57 2020 +0100
@@ -92,23 +92,34 @@
     height: self.HEIGHT
     padding: app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, 0
     IconButton:
-        source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_48.png") if root.notes else ''
+        source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_48.png")
         allow_stretch: True
         size_hint: None, None
         pos_hint: {'center_y': .5}
         height: dp(25)
-        width: self.norm_image_size[0]
+        width: dp(35) if root.notes else 0
+        opacity: 1 if root.notes else 0
         on_release: root.notes_drop.open(self) if root.notes else None
     ScreenManager:
         id: manager
     NotifsIcon:
         id: notifs_icon
         allow_stretch: True
-        source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_miroir_48.png") if self.notifs else ''
+        source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_miroir_48.png")
         size_hint: None, None
         pos_hint: {'center_y': .5}
         height: dp(25)
-        width: self.norm_image_size[0]
+        width: dp(35) if self.notifs else 0
+        opacity: 1 if self.notifs else 0
+    Symbol:
+        id: disconnected_icon
+        size_hint: None, 1
+        pos_hint: {'center_y': .5}
+        font_size: dp(23)
+        width: 0 if app.connected else dp(30)
+        opacity: 0 if app.connected else 1
+        symbol: "plug"
+        color: 0.80, 0.0, 0.0, 1
 
 <RootMenus>:
     size_hint: 1, None