mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
More work on IE 6 bugs.
This commit is contained in:
@@ -143,7 +143,7 @@ public class FridgeApp implements EntryPoint {
|
||||
magnetFactory = new MagnetFactory(dragController, magnetClickListener);
|
||||
|
||||
VerticalPanel vPanel = new VerticalPanel();
|
||||
vPanel.setWidth("100%");
|
||||
vPanel.setStyleName("my-FridgeApp");
|
||||
vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
|
||||
vPanel.add(createTextPanel());
|
||||
vPanel.add(createButtonPanel());
|
||||
|
||||
@@ -17,9 +17,25 @@ public class FridgeTextPanel extends Composite {
|
||||
public FridgeTextPanel (MagnetFactory magnetFactory) {
|
||||
this.magnetFactory = magnetFactory;
|
||||
mainPanel = new FlowPanel();
|
||||
initWidget(mainPanel);
|
||||
FlowPanel wrapper = new FlowPanel();
|
||||
wrapper.add(createMinHeightProp());
|
||||
wrapper.add(mainPanel);
|
||||
wrapper.add(createFloatClearer());
|
||||
initWidget(wrapper);
|
||||
setStylePrimaryName("my-FridgeTextPanel");
|
||||
}
|
||||
|
||||
private Widget createMinHeightProp() {
|
||||
Widget prop = new FlowPanel();
|
||||
prop.setStylePrimaryName("prop");
|
||||
return prop;
|
||||
}
|
||||
|
||||
private Widget createFloatClearer() {
|
||||
Widget clear = new FlowPanel();
|
||||
clear.setStylePrimaryName("clear");
|
||||
return clear;
|
||||
}
|
||||
|
||||
public void setEngaged(boolean engaged) {
|
||||
if (engaged) {
|
||||
@@ -32,11 +48,13 @@ public class FridgeTextPanel extends Composite {
|
||||
public String getText () {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Widget w : mainPanel) {
|
||||
String word = ((Magnet)w).getText();
|
||||
if (sb.length() > 0) {
|
||||
sb.append(' ');
|
||||
if (w instanceof Magnet) {
|
||||
String word = ((Magnet)w).getText();
|
||||
if (sb.length() > 0) {
|
||||
sb.append(' ');
|
||||
}
|
||||
sb.append(word);
|
||||
}
|
||||
sb.append(word);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -52,12 +70,12 @@ public class FridgeTextPanel extends Composite {
|
||||
fireChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void clear () {
|
||||
mainPanel.clear();
|
||||
fireChange();
|
||||
}
|
||||
|
||||
|
||||
public void addMagnet (Magnet magnet) {
|
||||
mainPanel.add(magnetFactory.createUsedMagnet(magnet));
|
||||
fireChange();
|
||||
@@ -70,7 +88,7 @@ public class FridgeTextPanel extends Composite {
|
||||
fireChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void fireChange() {
|
||||
listeners.fireChange(this);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@ body {
|
||||
background: url("brushed-metal.png");
|
||||
}
|
||||
|
||||
.my-FridgeApp {
|
||||
|
||||
}
|
||||
|
||||
.my-FridgeTextPanel, .my-FridgeBagPanel, .my-translations, .my-SettingsPanel {
|
||||
margin: 1em;
|
||||
}
|
||||
@@ -9,7 +13,6 @@ body {
|
||||
.my-FridgeTextPanel, .my-FridgeBagPanel {
|
||||
min-height: 2.4em;
|
||||
padding: 0.2em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.my-FridgeTextPanel {
|
||||
@@ -22,6 +25,20 @@ body {
|
||||
background-color: #dddddd;
|
||||
}
|
||||
|
||||
/* IE min-height hack */
|
||||
.my-FridgeTextPanel .prop {
|
||||
height: 2.4em;
|
||||
float: right;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
/* Used for clearing floats to ensure that float container is tall enough */
|
||||
.my-FridgeTextPanel .clear {
|
||||
clear: both;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-FridgeBagPanel {
|
||||
border: 3px solid #dddddd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user