From f3aeef67677518c87572495c1e63ee0de87c7679 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Mon, 4 Aug 2008 13:05:45 +0000 Subject: [PATCH] fixes #1960 (IE and disabled datefield) and removes odd usage of ITextField just to get proper style names svn changeset:5129/svn branch:trunk --- .../themes/default/datefield/datefield.css | 11 ++++ WebContent/ITMILL/themes/default/styles.css | 56 +++++++++++++++++++ .../terminal/gwt/client/ui/ITextualDate.java | 21 +++++-- 3 files changed, 83 insertions(+), 5 deletions(-) diff --git a/WebContent/ITMILL/themes/default/datefield/datefield.css b/WebContent/ITMILL/themes/default/datefield/datefield.css index b7c1e37840..7bdc5262e6 100644 --- a/WebContent/ITMILL/themes/default/datefield/datefield.css +++ b/WebContent/ITMILL/themes/default/datefield/datefield.css @@ -192,3 +192,14 @@ .i-datefield-rendererror .i-textfield { background: #ff9999; } + +/* IE somehow loses generic i-disabled alpha. See #1960 */ +* html .i-disabled .i-datefield-button, +* html .i-disabled .i-datefield-textfield { + filter: alpha(opacity=30); +} +*+ html .i-disabled .i-datefield-button, +*+ html .i-disabled .i-datefield-textfield { + filter: alpha(opacity=30); +} + diff --git a/WebContent/ITMILL/themes/default/styles.css b/WebContent/ITMILL/themes/default/styles.css index cbd1d2803c..be51f448dd 100644 --- a/WebContent/ITMILL/themes/default/styles.css +++ b/WebContent/ITMILL/themes/default/styles.css @@ -519,6 +519,17 @@ input.i-modified, .i-datefield-rendererror .i-textfield { background: #ff9999; } + +/* IE somehow loses generic i-disabled alpha. See #1960 */ +* html .i-disabled .i-datefield-button, +* html .i-disabled .i-datefield-textfield { + filter: alpha(opacity=30); +} +*+ html .i-disabled .i-datefield-button, +*+ html .i-disabled .i-datefield-textfield { + filter: alpha(opacity=30); +} + .i-expandlayout-lo-table { margin:0; padding:0; @@ -656,6 +667,51 @@ input.i-modified, .i-gridlayout-spacing .i-gridlayout-firstrow { padding-top: 0; } +/* + *MenuBar styles + */ + +/*Top menu */ +.i-menubar table { + font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif; + + border-right: 2px solid #c6cbcc; + border-bottom: 2px solid #c6cbcc; + border-top: 1px solid #d0d4d5; + border-left: 1px solid #d0d4d5; + + background-color : #e9eced; + white-space: nowrap; +} + +.i-menubar .gwt-MenuItem { + cursor : default; + + padding : 0px 10px; + margin : 0px 10px; + + background-color : #e9eced; + } + +.i-menubar .gwt-MenuItem-selected { + background-color : #fff; + } + +/*Submenu*/ +.i-menubar_submenu { + font-size : 12px; + padding : 3px; + font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif; + color: #464f52; + background-color : #e9eced; + white-space: nowrap; + + border-right: 2px solid #c6cbcc; + border-bottom: 2px solid #c6cbcc; + border-top: 1px solid #d0d4d5; + border-left: 1px solid #d0d4d5; + +} .i-Notification { font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif; diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java index fc67d36e20..a08dcba1be 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java @@ -7,16 +7,18 @@ package com.itmill.toolkit.terminal.gwt.client.ui; import java.util.Date; import com.google.gwt.i18n.client.DateTimeFormat; +import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.ChangeListener; +import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.Widget; import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; +import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; import com.itmill.toolkit.terminal.gwt.client.Focusable; import com.itmill.toolkit.terminal.gwt.client.LocaleNotLoadedException; import com.itmill.toolkit.terminal.gwt.client.LocaleService; import com.itmill.toolkit.terminal.gwt.client.Paintable; import com.itmill.toolkit.terminal.gwt.client.UIDL; -import com.itmill.toolkit.terminal.gwt.client.Util; public class ITextualDate extends IDateField implements Paintable, Field, ChangeListener, ContainerResizedListener, Focusable { @@ -24,7 +26,7 @@ public class ITextualDate extends IDateField implements Paintable, Field, private static final String PARSE_ERROR_CLASSNAME = CLASSNAME + "-parseerror"; - private final ITextField text; + private final TextBox text; private String formatStr; @@ -36,7 +38,11 @@ public class ITextualDate extends IDateField implements Paintable, Field, public ITextualDate() { super(); - text = new ITextField(); + text = new TextBox(); + // use normal textfield styles as a basis + text.setStyleName(ITextField.CLASSNAME); + // add datefield spesific style name also + text.addStyleName(CLASSNAME + "-textfield"); text.addChangeListener(this); add(text); } @@ -222,8 +228,9 @@ public class ITextualDate extends IDateField implements Paintable, Field, public void setWidth(String newWidth) { if (!"".equals(newWidth) && (width == null || !newWidth.equals(width))) { - if (Util.isIE6()) { - text.setColumns(1); // in IE6 cols ~ min-width + if (BrowserInfo.get().isIE6()) { + // in IE6 cols ~ min-width + DOM.setElementProperty(text.getElement(), "size", "1"); } needLayout = true; width = newWidth; @@ -234,6 +241,10 @@ public class ITextualDate extends IDateField implements Paintable, Field, } } else { if ("".equals(newWidth) && width != null && !"".equals(width)) { + if (BrowserInfo.get().isIE6()) { + // revert IE6 hack + DOM.setElementProperty(text.getElement(), "size", ""); + } super.setWidth(""); needLayout = true; iLayout(); -- 2.39.5