Commit c9c79272 authored by ethanhon's avatar ethanhon Committed by Evan W. Patton

Align labeled text boxes in the middle

parent d128b796
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Copyright 2011-2018 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package com.google.appinventor.client.widgets;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
......@@ -35,10 +36,13 @@ public class LabeledTextBox extends Composite {
HorizontalPanel panel = new HorizontalPanel();
Label label = new Label(caption);
panel.add(label);
panel.setCellVerticalAlignment(label, HasVerticalAlignment.ALIGN_MIDDLE);
textbox = new TextBox();
textbox.setStylePrimaryName("ode-LabeledTextBox");
textbox.setWidth("100%");
panel.add(textbox);
panel.setCellWidth(label, "40%");
panel.setCellVerticalAlignment(textbox, HasVerticalAlignment.ALIGN_MIDDLE);
initWidget(panel);
......@@ -57,11 +61,14 @@ public class LabeledTextBox extends Composite {
HorizontalPanel panel = new HorizontalPanel();
Label label = new Label(caption);
panel.add(label);
panel.setCellVerticalAlignment(label, HasVerticalAlignment.ALIGN_MIDDLE);
textbox = new TextBox();
textbox.setStylePrimaryName("ode-LabeledTextBox");
defaultTextBoxColor = textbox.getElement().getStyle().getBorderColor();
textbox.setWidth("100%");
panel.add(textbox);
panel.setCellWidth(label, "40%");
panel.setCellVerticalAlignment(textbox, HasVerticalAlignment.ALIGN_MIDDLE);
HorizontalPanel errorPanel = new HorizontalPanel();
errorLabel = new Label("");
......
......@@ -1340,6 +1340,10 @@ path.ode-SimpleMockMapFeature-selected {
width: 100%;
}
.ode-DialogBox .ode-LabeledTextBox {
margin-bottom: 0;
}
/* AI2 Extensions Styles */
a.ode-ExtensionAnchor {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment