Hi,
> Continuing my exploration of the wonderful features of brick.
> hledger-ui now has a minibuffer for data entry, and I'm currently
> adding a help dialog.
Great!
> I could do this with or without the Dialog widget. Dialog provides
> buttons if I want them, and adds a border automatically. However I
> have to specify its maximum size when I create it, which is currently
> little tricky as I only have that information inside a Widget
> renderer.
Can you say more about what makes this tricky for you?
> However it's implemented, I'd like the end result to be a centered
> bordered box filling most but not all of the screen, with the normal
> screen content still visible behind it (around the margins). I am
> prepending the size-limited dialog (or ordinary) widget to the
> screen's widget list, so it overlays the regular content. If I leave
> it uncentered, I can still see the latter. But I haven't found a way
> to center it without filling outside area with some padding character.
> Is there a way ?
Right now centering works by putting padding around the thing being
centered, rather than using a Vty translation. If the centering code
used a translation instead, that would give the behavior you want.
I've actually had fixing this on my mental TODO list for some time for
exactly the reason you described. It should actually be relatively easy
to do, but there are some consequences that need to be explored: I'm not
sure how a translation will differ from padding when it comes to laying
out such widgets as part of interfaces rather than as individual layers.
So: if you want to take a crack at this, I'd be happy to consider
patches and put them on a branch while we figure out how it'll work.
I'm also happy to take a look at this myself since I've been wanting it,
too. I'll take a look at this later today.
Thanks!
--
Jonathan Daugherty