<RootLayout>:
    orientation: 'vertical'

    ActionBar:
        pos_hint: {'top':1}

        ActionView:
            use_separator: True

            ActionPrevious:
                id: app_ver
                title: 'Tachograph Card Authorizer'
                with_previous: False

            ActionButton:
                text: 'Server settings'
                on_press: root.popup_server_settings()

            ActionButton:
                text: 'Change log'
                on_press: root.popup_change_log()

#             ActionGroup:
#                 text: 'Unit tools'
#                 mode: 'spinner'
#                 ActionButton:
#                     text: 'Unit 1'
#                 ActionButton:
#                     text: 'Unit 2'
#                 ActionButton:
#                     text: 'Unit 3'
#                 ActionButton:
#                     text: 'Unit 4'

    TextInput:
        id: textbox
        multiline: True
        size_hint: 1, 0.8
        # pos_hint: {'center_x': 0.5, 'center_y': 0.1}
        # on_text: app.submit_pulse_text(args[1])

    Button:
        id: btn
        # pos_hint: {'center_x': 0.5, 'center_y': 0.3}
        size_hint: 1, 0.2
        text: 'Start authorization'
        on_release: app.authorize()

<ServerSettings>:
    rows: 4
    padding: 50
    orientation: 'vertical'

    ipinput: ip_input
    portinput: port_input
    btnupdate: btn_update

    TextInput:
        id: ip_input
        size_hint: 0.8, 0.1
        pos_hint: {'x': 0.1, 'y': 0.7}
        text: root.showInitIp()

    TextInput:
        id: port_input
        size_hint: 0.8, 0.1
        pos_hint: {'x': 0.1, 'y': 0.6}
        text: root.showInitPort()

    # TextInput:
    #     id: token_input
    #     size_hint: 0.8, 0.1
    #     pos_hint: {'x': 0.1, 'y': 0.4}
    #     text: 'Token'

    Button:
        id: btn_update
        text: 'Save settings'
        size_hint: 0.8, 0.2
        pos_hint: {'x': 0.1, 'y': 0.1}
        on_press: root.updateConfig()

<ServerSettingsNotification>:
    rows: 4
    padding: 50
    orientation: 'vertical'

    btnupdate: btn_update

    Button:
        id: btn_update
        text: 'Save settings'
        size_hint: 0.8, 0.2
        pos_hint: {'x': 0.1, 'y': 0.1}
        on_press: root.Cancel()

<ChangeLog>:
    orientation: 'vertical'
    changeloginput: changelog_input

    TextInput:
        background_color: 0, 0, 0, 0
        canvas.before:
            Color:
                rgba: 1, 1, 1, 1

        id: changelog_input
        multiline: True
        size_hint: 1, 1
        pos_hint: {'x': 0, 'y': 0}
        text: root.updateLog()
