TotalCross / totalcross

TotalCross is a Software Development Kit that helps cross platform application development. Currently supported platforms are: Windows, Wince, Android, iOS, Linux and Linux ARM for embedded systems.
https://www.totalcross.com
GNU Lesser General Public License v2.1
222 stars 40 forks source link

MessageBox's gap and insideGap parameters are not working #372

Closed LuizAntonioPS closed 2 years ago

LuizAntonioPS commented 2 years ago

Describe the bug

MessageBox's gap and insideGap parameters are not working. The UI behavior does not differ from the default when I change these parameters.

Device:

Expected behavior

When gap parameter is set, the space between the MessageBox buttons should change. When insideGap parameter is set, the space between the text and the button border should change.

To Reproduce

You can reproduce this bug using the default simulator or deploying the code on the cited device.

setUIStyle(Settings.FLAT_UI);
public class Dialog extends MessageBox {
   public Dialog(String title, String message, String[] buttons) {
      super(title, message, buttons); //gap, insideGap and allSameWidth not working
      Font big_font = Font.getFont(true, MaterialConstants.TEXT_SIZE_BIG);
      messageFont = big_font;
      buttonsFont = big_font;
      messageForeColor = MaterialConstants.DIALOG_MSG_FORE_COLOR;
      buttonForeColor = MaterialConstants.DIALOG_BTN_FORE_COLOR;
      setTextAlignment(CENTER);
      setRect(CENTER, CENTER, SCREENSIZE + 50, SCREENSIZE);
      paddingBottom = 30;
   }  
}
new Dialog("", "Are you ok?\n", new String[]{"YES", "NO"}).popup();

Screenshots

super(title, message, buttons); // default gap and insideGap image

super(title, message, buttons, 16, UnitsConverter.toPixels(48 + DP)); // set gap and insideGap image