#:import colors kivymd.color_definitions.colors
#:import gch kivy.utils.get_color_from_hex
#:import environ os.environ


<ShrineRegisterScreen>
    name: "register screen"

    canvas:
        Color:
            rgba: root.theme_cls.bg_dark
        Rectangle:
            pos: self.pos
            size: self.size

    MDIconButton:
        id: button_back
        icon: "arrow-left"
        pos_hint: {"top": 1, "left": 1}

    BoxLayout:
        orientation: "vertical"
        size_hint: .2, .2
        pos_hint: {"center_x": .5, "center_y": .7}
        spacing: "10dp"

        Image:
            source:
                f"{environ['KITCHEN_SINK_ROOT']}/studies/shrine/data/images/shrine-white.png" \
                if root.theme_cls.theme_style == "Dark" \
                else f"{environ['KITCHEN_SINK_ROOT']}/studies/shrine/data/images/shrine-dark.png"
            size_hint_x: .8
            pos_hint: {"center_x": .5}

        Label:
            text: root.title
            color: root.theme_cls.text_color
            font_size: "24sp"
            size_hint_y: None
            height: self.texture_size[1]

    BoxLayout:
        orientation: "vertical"
        size_hint_y: None
        height: self.minimum_height
        spacing: "10dp"
        padding: "30dp"
        pos_hint: {"center_y": .3}

        MDTextField:
            hint_text: "Username"

        MDTextField:
            hint_text: "Password"

        Widget:
            size_hint_y: None
            height: "40dp"

        BoxLayout:
            spacing: "10dp"

            Widget:

            MDFlatButton:
                id: button_cancel
                text: "CANCEL"

            MDFillRoundFlatButton:
                id: button_next
                text: "NEXT"
                on_release: root.parent.current = "shrine root screen"
                md_bg_color: gch(colors[root.theme_cls.primary_palette]["200"])
