#:kivy 1.7.1

Calculator:

<Calculator>:
    orientation: 'vertical'
    spacing: '5dp'
    display: id_display
    info: id_info

    size: ('100dp', '300dp')

    Label:
        font_size: '50dp'
        text_size: (self.width * 0.9, self.height * 0.9)
        size: (root.width, root.height * 0.22)
        halign: 'right'
        text: '0'
        id: id_display

    Label:
        font_size: '12dp'
        text_size: (self.width * 0.9, self.height * 0.9)
        size: (root.width, root.height * 0.15)
        halign: 'right'
        id: id_info

    GridLayout:
        size: (root.width, root.height * 0.6)
        rows:   6
        cols: 4

        Button:
            text: 'CLR'
            on_press: root.clr()

        Button:
            text: '('
            on_press: root.append('(')

        Button:
            text: ')'
            on_press: root.append(')')

        Button:
            text: '^'
            on_press: root.append('^')

        Button:
            text: 'CE'
            on_press: root.ce()

        Button:
            text: '/'
            on_press: root.append('/')

        Button:
            text: '*'
            on_press: root.append('*')

        Button:
            text: '-'
            on_press: root.append('-')

        Button:
            text: '7'
            on_press: root.append('7')

        Button:
            text: '8'
            on_press: root.append('8')

        Button:
            text: '9'
            on_press: root.append('9')

        #   a placeholder for a double row + key
        Button:
            text: ' '

        Button:
            text: '4'
            on_press: root.append('4')

        Button:
            text: '5'
            on_press: root.append('5')

        Button:
            text: '6'
            on_press: root.append('6')

        Button:
            text: '+'
#            size_hint_y: 100/6*2
            on_press: root.append('+')

        Button:
            text: '1'
            on_press: root.append('1')

        Button:
            text: '2'
            on_press: root.append('2')

        Button:
            text: '3'
            on_press: root.append('3')

        #   a placeholder for a double row = key
        Button:
            text: ' '

        Button:
            text: '0'
            on_press: root.append('0')

        #   a placeholder for a double column 0 key
        Button:
            text: ' '

        Button:
            text: '.'
            on_press: root.append('.')


        Button:
            text: '='
            on_press: root.compute()

