Scripting UI Limitations

I’ve been experimenting with the studio scripting system for making custom UIs, particularly a simple Git UI, and I’ve run into a some annoying limitations. My current working version is here, and here’s what it looks like:

Ones I can work around:

  • Size policies seem to have no effect, regardless of where they’re placed or how they’re specified. I’ve read this post that mentions that they don’t apply to the entire window, but they also have no effect applied to individual elements. The LineEdit at the bottom and the separator at the top are supposed to expand horizontally, and the changes list should be limited in size, but none of those have any effect.
    • For the changes list, I can make it cut off after some number of elements, but a scrollbar would be significantly nicer to use.
  • Having a proper separator element would be nice; here it’s emulated with a label with <hr />, but that doesn’t resize properly. (That might be solved with size policies though.)
  • Having proper backgrounds on layout elements would be helpful, especially since those are already available in deck UIs. Here it’s emulated with a label with <div style="...">, but they’re extremely fragile and extremely limited (most styling elements don’t work, alignment is difficult…). Deck UIs already have a related option, though having custom colours helps for this UI.

Things that don’t work:

  • setEditText and setRegExpValidator have no effect.

Things that would be nice to have:

  • Pixmaps, like in deck UIs, would help for adding indicators to UIs.
  • Being able to provide windows from outside menu buttons, e.g. in a right-click menu or as a persistent window/panel.
  • Having push buttons with images as labels.
  • (Semi-related) having push buttons in deck UIs, e.g. for auto-configuring parameters for a plugin effect.

For Git specifically the builtin VCS integration is possible, but hard to use with the lack of documentation; and there’s other UIs I’d like to put together that would also benefit from knowing how to get around these/having some fixed.

Thank you for having scripting as-is, it’s come very handy so far!

Thanks for the suggestions, I’ve noted a bunch of them on our internal improvement tracker!

I can also confirm what you’ve said about sizePolicy not functioning properly. It seems that this is an issue with the alignment options - aligning along one axis seemingly breaks the specified sizePolicy on that axis. For example, using studio.ui.alignment.AlignLeft breaks horizontalPolicy, but verticalPolicy still functions as expected. I’d recommend testing some other alignment options to see whether any of them allow you to work around the issue in your particular case.

Can I get you to elaborate on what exactly you mean by this? On what layouts/widgets are you wanting to use these on, and for what purpose?