#:import webbrowser webbrowser
#:import MDBottomNavigation kivymd.tabs.MDBottomNavigation
#:import ScrollableLabel etherollapp.etheroll.scrollablelabel.ScrollableLabel


<AboutOverview>:
    orientation: 'vertical'
    MDLabel:
        markup: True
        text: root.about_text_property
        theme_text_color: 'Primary'
        on_ref_press: webbrowser.open(root.project_page_property)


<AboutChangelog>:
    orientation: 'vertical'
    ScrollableLabel:
        text: root.changelog_text_property
        theme_text_color: 'Primary'


<AboutDiagnostic>:
    orientation: 'vertical'
    ScrollView:
        MDTextField:
            multiline: True
            readonly: True
            text: root.stream_property
    AnchorLayout:
        size_hint_y: None
        MDRaisedButton:
            text: "Run diagnostic"
            on_release: root.run_tests()


<About@MDBottomNavigation>:
    MDBottomNavigationItem:
        name: "about_overview"
        text: "Overview"
        icon: 'github-circle'
        AboutOverview:
    MDBottomNavigationItem:
        name: "about_changelog"
        text: "Changelog"
        icon: 'format-list-bulleted'
        AboutChangelog:
    MDBottomNavigationItem:
        name: "about_diagnostic"
        text: "Diagnostic"
        icon: 'bug'
        AboutDiagnostic:


<AboutScreen>:
    name: 'about'
    on_pre_enter:
        # workaround for broken MDBottomNavigation, refs
        # https://github.com/AndreMiras/PyWallet/issues/38
        Window.dispatch('on_resize', *Window.size)
    About:
        id: about_id
