From: Matti Tahvonen Date: Thu, 5 Feb 2009 10:37:13 +0000 (+0000) Subject: fixes #2484 and most likely causes multiple regressions :-( X-Git-Tag: 6.7.0.beta1~3211 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cdb3ad1b60bb58144ac92d7c167343bf250ba084;p=vaadin-framework.git fixes #2484 and most likely causes multiple regressions :-( svn changeset:6738/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java index a30b884b94..8318658de5 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java @@ -18,6 +18,7 @@ import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.ComplexPanel; 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.ICaption; import com.itmill.toolkit.terminal.gwt.client.Paintable; import com.itmill.toolkit.terminal.gwt.client.RenderInformation; @@ -385,15 +386,16 @@ public class ITabsheet extends ITabsheetBase { Style style = tp.getElement().getStyle(); String overflow = style.getProperty("overflow"); style.setProperty("overflow", "hidden"); - String width = style.getProperty("width"); - style.setProperty("width", tabsWidth + "px"); + style.setPropertyPx("width", tabsWidth); + Style wrapperstyle = tp.getWidget(tp.getVisibleWidget()).getElement() + .getParentElement().getStyle(); + wrapperstyle.setPropertyPx("width", tabsWidth); // Get content width from actual widget int contentWidth = 0; if (tp.getWidgetCount() > 0) { contentWidth = tp.getWidget(tp.getVisibleWidget()).getOffsetWidth(); } - style.setProperty("width", width); style.setProperty("overflow", overflow); // Set widths to max(tabs,content) @@ -401,17 +403,14 @@ public class ITabsheet extends ITabsheetBase { tabsWidth = contentWidth; } - tabs.getStyle().setPropertyPx("width", tabsWidth); + int outerWidth = tabsWidth + getContentAreaBorderWidth(); - /* - * tb width includes the spacerTd width so the content area will be as - * wide as the tab bar - */ - int realWidth = tb.getOffsetWidth(); - contentWidth = realWidth - getContentAreaBorderWidth(); + tabs.getStyle().setPropertyPx("width", outerWidth); + style.setPropertyPx("width", tabsWidth); + wrapperstyle.setPropertyPx("width", tabsWidth); - contentNode.getStyle().setPropertyPx("width", contentWidth); - super.setWidth(realWidth + "px"); + contentNode.getStyle().setPropertyPx("width", tabsWidth); + super.setWidth(outerWidth + "px"); updateOpenTabSize(); } @@ -663,6 +662,14 @@ public class ITabsheet extends ITabsheetBase { DOM.setStyleAttribute(scroller, "display", "none"); } + if (BrowserInfo.get().isSafari()) { + // fix tab height for safari, bugs sometimes if tabs contain icons + String property = tabs.getStyle().getProperty("height"); + if (property == null || property.equals("")) { + tabs.getStyle().setPropertyPx("height", tb.getOffsetHeight()); + } + } + } private void showAllTabs() { diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheetPanel.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheetPanel.java index c7ff6a08fb..20b2309718 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheetPanel.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheetPanel.java @@ -160,6 +160,7 @@ public class ITabsheetPanel extends ComplexPanel { // widget wrapper height wrapperDiv.getStyle().setPropertyPx("height", height); + runWebkitOverflowAutoFix(); } public void runWebkitOverflowAutoFix() {