From ead856abe072991ab3254f8a47cc2a71e349eb8b Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Mon, 15 Sep 2008 12:05:26 +0000 Subject: [PATCH] fixes #2072, added "dragcurtain" for FF svn changeset:5398/svn branch:trunk --- .../terminal/gwt/client/ui/ISplitPanel.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ISplitPanel.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ISplitPanel.java index 5378fc261f..4aa6ff6b74 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ISplitPanel.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ISplitPanel.java @@ -10,6 +10,7 @@ import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.ComplexPanel; +import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; @@ -56,6 +57,8 @@ public class ISplitPanel extends ComplexPanel implements Paintable, private String splitterStyleName; + private Element draggingCurtain; + public ISplitPanel() { this(ORIENTATION_HORIZONTAL); } @@ -340,6 +343,9 @@ public class ISplitPanel extends ComplexPanel implements Paintable, if (DOM.compare(trg, splitter) || DOM.compare(trg, DOM.getChild(splitter, 0))) { resizing = true; + if (BrowserInfo.get().isGecko()) { + showDraggingCurtain(); + } DOM.setCapture(getElement()); origX = DOM.getElementPropertyInt(splitter, "offsetLeft"); origY = DOM.getElementPropertyInt(splitter, "offsetTop"); @@ -390,10 +396,41 @@ public class ISplitPanel extends ComplexPanel implements Paintable, public void onMouseUp(Event event) { DOM.releaseCapture(getElement()); + if (BrowserInfo.get().isGecko()) { + hideDraggingCurtain(); + } resizing = false; onMouseMove(event); } + /** + * Used in FF to avoid losing mouse capture when pointer is moved on an + * iframe. + */ + private void showDraggingCurtain() { + if (draggingCurtain == null) { + draggingCurtain = DOM.createDiv(); + DOM.setStyleAttribute(draggingCurtain, "position", "absolute"); + DOM.setStyleAttribute(draggingCurtain, "top", "0px"); + DOM.setStyleAttribute(draggingCurtain, "left", "0px"); + DOM.setStyleAttribute(draggingCurtain, "width", "100%"); + DOM.setStyleAttribute(draggingCurtain, "height", "100%"); + DOM.setStyleAttribute(draggingCurtain, "zIndex", "" + + IToolkitOverlay.Z_INDEX); + DOM.appendChild(RootPanel.getBodyElement(), draggingCurtain); + } + } + + /** + * Hides dragging curtain + */ + private void hideDraggingCurtain() { + if (draggingCurtain != null) { + DOM.removeChild(RootPanel.getBodyElement(), draggingCurtain); + draggingCurtain = null; + } + } + private static int splitterSize = -1; private int getSplitterSize() { -- 2.39.5