[Fixed 2.8] Lua Api: Bug / Problems With Aligners (Part 1)

Ok so, i wrote another example tool to show some gui related problems:

Gui redraw bug with width = 100%


2992 com.test.guibugs.xrnx

Sorry for the lag. Had no time yet to have a look at this and your other report, but will do.
One quick note until I’ve checked this: Aligners always imply a width or height of 100%, that’s the whole purpose of them. Probably you want a plain “column” or “row” in such cases instead?

my thread quite likely is related to a problem dread experienced: Aligners Ignore "mode" Setting

The problems with aligners do only arise when one wants to use aligners (for the “modes”) within rows/columns (for the “style” property) with a width of 100%.
So, i figured that the way it actually works is like this:

vertical_aligner:

   
vb:row{  
 style = "group", --eg.  
 height = "100%",  
 vb:vertical_aligner {  
 mode = "center",  
 vb:blub {}  
 }  
 },  
  

horizontal_aligner:

  
vb:column {  
 style = "group",  
 width = "100%",  
 vb:horizontal_aligner {  
 mode = "center",  
 vb:blub {},  
 }  
 },  
  

… everything else, like a vertical_aligner with a column (not a row) as in BlueReactions tool, or setting height 100% for a column etc wont work.
So, i think i can actually live with that (x … but it took me ages to figure out, and i don’t feel it is exactly intuitive.
I do wonder a bit why we actually have two gui elements (rows/columns and vertical/horizontal aligners) and not one for the task of grouping stuff (with joined “style” and “mode” properties)?

Once again sorry for the lag and thanks for the excellent examples. This stuff is a pain to explain and debug, so your tool helps a lot here.

horizontal_aligner uses a width of 100% by default. Which means it uses the full width of it’s parent. In your case, the parent is a vb:column, which only has your aligner as child.

If you want to align the aligner to the dialog, remove the second vb:column, or give the parent column it a width of 100% as well:

  
vb:column {   
 vb:text { text = "some very long text" },  
},  
vb:column {  
 width = "100%",   
 vb:horizontal_aligner {  
 mode = "center",  
 -- some views that should be centered  
 }  
}  
  
OR  
  
vb:column {   
 vb:text { text = "some very long text" },  
},  
vb:horizontal_aligner {  
 mode = "center",  
 -- some views that should be centered  
}  
  

This indeed should not happen. As said before, a horizontal aligner has a width of 100% by default, a vertical aligner a height of 100% by default. But it should be possible to override this with a fixed width or height.

I have a fix for this here now, but am not sure if it’s a good idea to apply this now. Will test first how many other tools get broken by this. If it’s too many, we will need to apply this in the next API version change.

Tested the fix with a bunch of tools and found no broken tools.
So most of the troubles mentioned above will be fixed in the update.