omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Sidebar UI -- close programmatically

    Pythonista
    3
    3
    2410
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Helgi
      Helgi last edited by

      I've stumbled upon a nice sidebar UI script made to work together with the Working Copy app.

      The script presents a very narrow sidebar with just one column of buttons. As it turns out, for a sidebar that narrow, the close button overlaps with the 'open console' chevron, so it's impossible to close the sidebar. Is it a known issue?

      To circumvent this, I wanted to add a custom 'close' button that calls close() on the view. However, it looks like close() doesn't work for sidebars (it works OK for me for sheets, fullscreens and popovers). Is it a known issue? I wasn't able to find anything stating this in the docs.

      If I succeed with adding a custom close button, I'd like to hide the standard close button on the sidebar (which is not usable anyway). Is there any way I can do this? hide_title_bar doesn't work for me.

      I believe this questions are not covered on the forum, at least I wasn't able to find anything like them.

      Tested with Pythonista 1.5.

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        Sidebar and panel mode views cannot be closed programmatically, this is a known bug/limitation. A workaround could be to present an empty view with the same mode, which would at least make the X button usable again, but that of course still requires extra user interaction.

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          As a hack, you can set the frame to 0,0,0,0 and present as a sidebar again. This has some unfortunate behavior of returning on_screen as True, but otherwise seems to hide the view.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors