]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #1960 (IE and disabled datefield) and removes odd usage of ITextField just...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 4 Aug 2008 13:05:45 +0000 (13:05 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 4 Aug 2008 13:05:45 +0000 (13:05 +0000)
svn changeset:5129/svn branch:trunk

WebContent/ITMILL/themes/default/datefield/datefield.css
WebContent/ITMILL/themes/default/styles.css
src/com/itmill/toolkit/terminal/gwt/client/ui/ITextualDate.java

index b7c1e378403871d9235ddabd134059af7b1c825e..7bdc5262e6f1e4c7980ec6a7349fa0ba20a3678b 100644 (file)
 .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);
+}
+
index cbd1d2803c99adb6c0f8ae5829bfa241aa17be75..be51f448dd38a577f7064e98ce9aa23fc0d7a132 100644 (file)
@@ -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;
index fc67d36e20561eeac0e40f1c5efecdef264c1760..a08dcba1beeff010f05c20fe6fae0faa844e44b9 100644 (file)
@@ -7,16 +7,18 @@ package com.itmill.toolkit.terminal.gwt.client.ui;
 import java.util.Date;\r
 \r
 import com.google.gwt.i18n.client.DateTimeFormat;\r
+import com.google.gwt.user.client.DOM;\r
 import com.google.gwt.user.client.ui.ChangeListener;\r
+import com.google.gwt.user.client.ui.TextBox;\r
 import com.google.gwt.user.client.ui.Widget;\r
 import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;\r
+import com.itmill.toolkit.terminal.gwt.client.BrowserInfo;\r
 import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener;\r
 import com.itmill.toolkit.terminal.gwt.client.Focusable;\r
 import com.itmill.toolkit.terminal.gwt.client.LocaleNotLoadedException;\r
 import com.itmill.toolkit.terminal.gwt.client.LocaleService;\r
 import com.itmill.toolkit.terminal.gwt.client.Paintable;\r
 import com.itmill.toolkit.terminal.gwt.client.UIDL;\r
-import com.itmill.toolkit.terminal.gwt.client.Util;\r
 \r
 public class ITextualDate extends IDateField implements Paintable, Field,\r
         ChangeListener, ContainerResizedListener, Focusable {\r
@@ -24,7 +26,7 @@ public class ITextualDate extends IDateField implements Paintable, Field,
     private static final String PARSE_ERROR_CLASSNAME = CLASSNAME\r
             + "-parseerror";\r
 \r
-    private final ITextField text;\r
+    private final TextBox text;\r
 \r
     private String formatStr;\r
 \r
@@ -36,7 +38,11 @@ public class ITextualDate extends IDateField implements Paintable, Field,
 \r
     public ITextualDate() {\r
         super();\r
-        text = new ITextField();\r
+        text = new TextBox();\r
+        // use normal textfield styles as a basis\r
+        text.setStyleName(ITextField.CLASSNAME);\r
+        // add datefield spesific style name also\r
+        text.addStyleName(CLASSNAME + "-textfield");\r
         text.addChangeListener(this);\r
         add(text);\r
     }\r
@@ -222,8 +228,9 @@ public class ITextualDate extends IDateField implements Paintable, Field,
 \r
     public void setWidth(String newWidth) {\r
         if (!"".equals(newWidth) && (width == null || !newWidth.equals(width))) {\r
-            if (Util.isIE6()) {\r
-                text.setColumns(1); // in IE6 cols ~ min-width\r
+            if (BrowserInfo.get().isIE6()) {\r
+                // in IE6 cols ~ min-width\r
+                DOM.setElementProperty(text.getElement(), "size", "1");\r
             }\r
             needLayout = true;\r
             width = newWidth;\r
@@ -234,6 +241,10 @@ public class ITextualDate extends IDateField implements Paintable, Field,
             }\r
         } else {\r
             if ("".equals(newWidth) && width != null && !"".equals(width)) {\r
+                if (BrowserInfo.get().isIE6()) {\r
+                    // revert IE6 hack\r
+                    DOM.setElementProperty(text.getElement(), "size", "");\r
+                }\r
                 super.setWidth("");\r
                 needLayout = true;\r
                 iLayout();\r