2
votes

I have a new GuiBuilder Form with a Layered Layout and scrollable Y, the problem comes when I set to landscape mode then my 4th button suddenly disappears at the bottom, it seems the autosize is cutting off my 4th button even scrolling down I can't find it, and I set that button to Scroll visible. Why it keeps disappearing? How to fix it?. In Portrait mode it's ok though.

EDITED:

My .gui XML as requested:

<?xml version="1.0" encoding="UTF-8"?>

<component type="Form" layout="LayeredLayout" layeredLayoutPreferredWidthMM="0.0" layeredLayoutPreferredHeightMM="0.0"  autolayout="true" title="MainMenu" scrollableX="false" scrollableY="true" name="MainMenu">
  <component type="Button" text="First Button" name="Button1">
    <layoutConstraint insets="auto 5.0mm auto 5.0mm" referenceComponents="-1 -1 -1 -1" referencePositions="0.0 0.0 0.0 0.0" />
  </component>
  <component type="Button" text="Second Button" name="Button2">
    <layoutConstraint insets="0.0mm -0.026454926mm auto 0.0mm" referenceComponents="0 0 -1 0 " referencePositions="1.0 0.0 0.0 0.0" />
  </component>
  <component type="Button" text="Exit" name="Button4">
    <layoutConstraint insets="0.0mm -0.026454926mm auto 0.0mm" referenceComponents="4 4 -1 4 " referencePositions="1.0 0.0 0.0 0.0" />
  </component>
  <component type="Label" icon="resFile:mylogo.png" name="Logo">
    <layoutConstraint insets="auto auto 0.0mm auto" referenceComponents="-1 0 0 0 " referencePositions="0.0 0.0 1.0 0.0" />
  </component>
  <component type="Button" text="Change Theme" name="Button3">
    <layoutConstraint insets="0.0mm -0.026455045mm auto 0.0mm" referenceComponents="1 1 -1 1 " referencePositions="1.0 0.0 0.0 0.0" />
  </component>
</component>

This is the button which is causing the issue: <component type="Button" text="Exit" name="Button4">

1
Can you edit the question and include the .gui XML for the form? - Shai Almog
@ShaiAlmog Updated my question. - Simple
The reference component seems wrong, I think you need to link it to a different component but Steve might know better. - Shai Almog

1 Answers

1
votes

This was a bug in how LayeredLayout calculates the preferred size of a container which affects how its children get laid out when they would be below the fold. This has been fixed in git and will be included in the next update on Friday.

You should be able to work around this for now by overriding the preferred height of the form to a size that includes all of the buttons. This can either be done programmatically using myForm.setPreferredH(500) (for example), or using the GUI builder, by pressing the "0 x 0in" button in the lower left bar of the canvas, then pressing the "Match Preview" button .

enter image description here