#:kivy 1.4

BoxLayout:
    id: bl
    orientation: "vertical"
    popup: popup.__self__
    canvas:
        Color:
            rgba: .18, .18, .18, .91
        Rectangle:
            size: self.size
            pos: self.pos
    Bubble:
        size_hint: (None, None)
        size: (150, self.content_height + self.arrow_margin_y)
        pos_hint: {'center_x': .5, 'y': .6}
        arrow_pos: 'bottom_mid'
        BubbleContent:
            orientation: 'horizontal'
            size_hint_y: None
            height: self.minimum_height
            BubbleButton:
                text: 'This is'
            BubbleButton:
                text: 'a'
            BubbleButton:
                text: 'Bubble'
    Button:
        text: 'press to show popup'
        on_release: root.popup.open()
    Popup:
        id: popup
        on_parent: if self.parent == bl: bl.remove_widget(self)
        title: "An example popup"
        content: popupcontent
        Button:
            id: popupcontent
            text: "press to dismiss"
            on_release: popup.dismiss()
