# HG changeset patch # User Goffi # Date 1485459569 -3600 # Node ID e0c41f209c289fcea07674b3f4bf8d4c31fe6f34 # Parent 15434a7787ed287aaa80ad214d7a8eee3a1d24f0 CagouWidget: instances can now add their own extra widgets in header with headerInputAddExtra diff -r 15434a7787ed -r e0c41f209c28 src/cagou/core/cagou_widget.py --- 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) diff -r 15434a7787ed -r e0c41f209c28 src/cagou/kv/cagou_widget.kv --- a/src/cagou/kv/cagou_widget.kv Thu Jan 26 20:39:18 2017 +0100 +++ b/src/cagou/kv/cagou_widget.kv Thu Jan 26 20:39:29 2017 +0100 @@ -50,7 +50,9 @@ : header_input: header_input + header_box: header_box BoxLayout: + id: header_box size_hint: 1, None height: dp(32) HeaderWidgetCurrent: