togglebutton one pixel too wide, missing right border

9 views
Skip to first unread message

howud...@gmail.com

unread,
Sep 22, 2016, 10:31:51 AM9/22/16
to CodenameOne Discussions
IDE: Eclipse
Simulator
native theme

Toggle button appears to be one pixel too wide.  In the screenshots you can see that the right border is not being drawn.  The screenshot includes the main app as well as a small test app.

 protected void initManualComponents() {
    setLayout
(new BorderLayout());

   
Container cntRoom = new Container(new GridLayout(12,2));
   
Label lblPreferred = new Label("Room:");
    lblPreferred
.setAlignment(Label.RIGHT);
    cntRoom
.add(lblPreferred);
    cntRoom
.add(CheckBox.createToggle("Test1"));
    cntRoom
.add(new Label());
    cntRoom
.add(CheckBox.createToggle("Test2"));
    cntRoom
.add(new Label());
    cntRoom
.add(CheckBox.createToggle("Test3"));
    cntRoom
.add(new Label());
    add
(BorderLayout.CENTER, cntRoom);
 
}



Shai Almog

unread,
Sep 23, 2016, 2:02:24 AM9/23/16
to CodenameOne Discussions, howud...@gmail.com
The default native theme assumes they will be chained together in a horizontal component group to give them the round effect. We should probably improve that design.

howud...@gmail.com

unread,
Sep 23, 2016, 11:12:09 AM9/23/16
to CodenameOne Discussions, howud...@gmail.com
it should be easy enough to see if it's the last component in the group, or only one in the group and draw the right side border
Reply all
Reply to author
Forward
0 new messages