diff src/cagou/core/cagou_widget.py @ 115:e0c41f209c28

CagouWidget: instances can now add their own extra widgets in header with headerInputAddExtra
author Goffi <goffi@goffi.org>
date Thu, 26 Jan 2017 20:39:29 +0100
parents 953ddf817b8a
children
line wrap: on
line diff
--- a/src/cagou/core/cagou_widget.py	Thu Jan 26 20:39:18 2017 +0100
+++ b/src/cagou/core/cagou_widget.py	Thu Jan 26 20:39:29 2017 +0100
@@ -50,6 +50,7 @@
 
 class CagouWidget(BoxLayout):
     header_input = properties.ObjectProperty(None)
+    header_box = properties.ObjectProperty(None)
 
     def __init__(self):
         for p in G.host.getPluggedWidgets():
@@ -75,3 +76,7 @@
         if self.collide_point(*touch.pos):
             G.host.selected_widget = self
         super(CagouWidget, self).on_touch_down(touch)
+
+    def headerInputAddExtra(self, widget):
+        """add a widget on the right of header input"""
+        self.header_box.add_widget(widget)