forked from GitHub/gf-core
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);
|
magnetFactory = new MagnetFactory(dragController, magnetClickListener);
|
||||||
|
|
||||||
VerticalPanel vPanel = new VerticalPanel();
|
VerticalPanel vPanel = new VerticalPanel();
|
||||||
vPanel.setWidth("100%");
|
vPanel.setStyleName("my-FridgeApp");
|
||||||
vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
|
vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
|
||||||
vPanel.add(createTextPanel());
|
vPanel.add(createTextPanel());
|
||||||
vPanel.add(createButtonPanel());
|
vPanel.add(createButtonPanel());
|
||||||
|
|||||||
@@ -17,9 +17,25 @@ public class FridgeTextPanel extends Composite {
|
|||||||
public FridgeTextPanel (MagnetFactory magnetFactory) {
|
public FridgeTextPanel (MagnetFactory magnetFactory) {
|
||||||
this.magnetFactory = magnetFactory;
|
this.magnetFactory = magnetFactory;
|
||||||
mainPanel = new FlowPanel();
|
mainPanel = new FlowPanel();
|
||||||
initWidget(mainPanel);
|
FlowPanel wrapper = new FlowPanel();
|
||||||
|
wrapper.add(createMinHeightProp());
|
||||||
|
wrapper.add(mainPanel);
|
||||||
|
wrapper.add(createFloatClearer());
|
||||||
|
initWidget(wrapper);
|
||||||
setStylePrimaryName("my-FridgeTextPanel");
|
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) {
|
public void setEngaged(boolean engaged) {
|
||||||
if (engaged) {
|
if (engaged) {
|
||||||
@@ -32,11 +48,13 @@ public class FridgeTextPanel extends Composite {
|
|||||||
public String getText () {
|
public String getText () {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (Widget w : mainPanel) {
|
for (Widget w : mainPanel) {
|
||||||
String word = ((Magnet)w).getText();
|
if (w instanceof Magnet) {
|
||||||
if (sb.length() > 0) {
|
String word = ((Magnet)w).getText();
|
||||||
sb.append(' ');
|
if (sb.length() > 0) {
|
||||||
|
sb.append(' ');
|
||||||
|
}
|
||||||
|
sb.append(word);
|
||||||
}
|
}
|
||||||
sb.append(word);
|
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
@@ -52,12 +70,12 @@ public class FridgeTextPanel extends Composite {
|
|||||||
fireChange();
|
fireChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear () {
|
public void clear () {
|
||||||
mainPanel.clear();
|
mainPanel.clear();
|
||||||
fireChange();
|
fireChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addMagnet (Magnet magnet) {
|
public void addMagnet (Magnet magnet) {
|
||||||
mainPanel.add(magnetFactory.createUsedMagnet(magnet));
|
mainPanel.add(magnetFactory.createUsedMagnet(magnet));
|
||||||
fireChange();
|
fireChange();
|
||||||
@@ -70,7 +88,7 @@ public class FridgeTextPanel extends Composite {
|
|||||||
fireChange();
|
fireChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fireChange() {
|
protected void fireChange() {
|
||||||
listeners.fireChange(this);
|
listeners.fireChange(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ body {
|
|||||||
background: url("brushed-metal.png");
|
background: url("brushed-metal.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.my-FridgeApp {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.my-FridgeTextPanel, .my-FridgeBagPanel, .my-translations, .my-SettingsPanel {
|
.my-FridgeTextPanel, .my-FridgeBagPanel, .my-translations, .my-SettingsPanel {
|
||||||
margin: 1em;
|
margin: 1em;
|
||||||
}
|
}
|
||||||
@@ -9,7 +13,6 @@ body {
|
|||||||
.my-FridgeTextPanel, .my-FridgeBagPanel {
|
.my-FridgeTextPanel, .my-FridgeBagPanel {
|
||||||
min-height: 2.4em;
|
min-height: 2.4em;
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
overflow: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-FridgeTextPanel {
|
.my-FridgeTextPanel {
|
||||||
@@ -22,6 +25,20 @@ body {
|
|||||||
background-color: #dddddd;
|
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 {
|
.my-FridgeBagPanel {
|
||||||
border: 3px solid #dddddd;
|
border: 3px solid #dddddd;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user