Daniel Erez has uploaded a new change for review. Change subject: webadmin: resizable dialogs - missing resize symbol ......................................................................
webadmin: resizable dialogs - missing resize symbol On resizable dialogs [1], the resize symbol [2] (on bottom-right corner) was missing. Hence: * Extracted the image into 'branding/../images/dialog' folder. * Added '.gwt-DialogBox .dialogBottomRight.resize' style to 'gwt_common.css' file. * Modified ResizableDialogBox file accordingly. [1] only Disk and Storage dialogs are currently resizable [2] screenshot - http://i.imgur.com/nnMwcPh.png Change-Id: I7e9cc8a3140ca62c677b9ac53c00c5460d3b0009 Signed-off-by: Daniel Erez <[email protected]> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/dialog/ResizableDialogBox.java M packaging/branding/ovirt.brand/gwt_common.css R packaging/branding/ovirt.brand/images/dialog/panel_edge_BR_resize.png 3 files changed, 19 insertions(+), 12 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/19701/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/dialog/ResizableDialogBox.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/dialog/ResizableDialogBox.java index ba4942c..fcc6dad 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/dialog/ResizableDialogBox.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/dialog/ResizableDialogBox.java @@ -17,6 +17,8 @@ private static int EDGE_SIZE = 3; private static int EDGE_THRESHOLD = 10; + private static String STYLE_RESIZE_POSTFIX = "resize"; //$NON-NLS-1$ + public ResizableDialogBox() { enableResizeSupport(false); } @@ -85,9 +87,15 @@ public void enableResizeSupport(boolean enabled) { this.resizeSupportEnabled = enabled; - String bottomRightCornerImageUrl = - enabled ? "images/dialog/panel_edge_BR_resize.png" : "images/dialog/panel_edge_BR.png"; //$NON-NLS-1$ //$NON-NLS-2$ - setBackgroundImageByClassName("dialogBottomRight", bottomRightCornerImageUrl); //$NON-NLS-1$ + Element dialogBottomRight = getElementByTagAndClassName("td", "dialogBottomRight"); //$NON-NLS-1$ //$NON-NLS-2$ + assert dialogBottomRight != null; + + if (enabled) { + dialogBottomRight.addClassName(STYLE_RESIZE_POSTFIX); + } + else { + dialogBottomRight.removeClassName(STYLE_RESIZE_POSTFIX); + } } /** @@ -143,20 +151,16 @@ return rightEdge || bottomEdge; } - /** - * Set background by class name - used for displaying 'resize' mark on bottom-right corner - * - * @param className - * @param imageUrl - */ - private void setBackgroundImageByClassName(String className, String imageUrl) { - NodeList<Element> elements = getElement().getElementsByTagName("td"); //$NON-NLS-1$ + private Element getElementByTagAndClassName(String tagName, String className) { + NodeList<Element> elements = getElement().getElementsByTagName(tagName); for (int i = 0; i < elements.getLength(); i++) { Element element = elements.getItem(i); if (element.getClassName().contains(className)) { - element.getStyle().setBackgroundImage("url(" + imageUrl + ")"); //$NON-NLS-1$ //$NON-NLS-2$ + return element; } } + + return null; } } diff --git a/packaging/branding/ovirt.brand/gwt_common.css b/packaging/branding/ovirt.brand/gwt_common.css index 6b06c6a..a020520 100644 --- a/packaging/branding/ovirt.brand/gwt_common.css +++ b/packaging/branding/ovirt.brand/gwt_common.css @@ -22,6 +22,9 @@ .gwt-DialogBox .dialogBottomRight { background: url(images/dialog/panel_edge_BR.png) !important; } +.gwt-DialogBox .dialogBottomRight.resize { + background: url(images/dialog/panel_edge_BR_resize.png) !important; +} .gwt-DialogBox .dialogMiddleLeft { background: url(images/dialog/panel_edge_L.png) !important; diff --git a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/public/images/dialog/panel_edge_BR_resize.png b/packaging/branding/ovirt.brand/images/dialog/panel_edge_BR_resize.png similarity index 100% rename from frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/public/images/dialog/panel_edge_BR_resize.png rename to packaging/branding/ovirt.brand/images/dialog/panel_edge_BR_resize.png Binary files differ -- To view, visit http://gerrit.ovirt.org/19701 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e9cc8a3140ca62c677b9ac53c00c5460d3b0009 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Daniel Erez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
