From 536955c281ab3ff5d1163a5523588a87203867f7 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Mon, 19 Mar 2012 16:16:54 +0800 Subject: [PATCH] IDEMPIERE-181 Zk6: Fixed toolbar appearance --- .../webui/component/ToolBarButton.java | 17 +++++++++++------ .../webui/panel/AbstractADWindowPanel.java | 3 ++- .../theme/default/css/theme.css.dsp | 14 +++++++++----- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java index 1c0f709153..1686c0f537 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ToolBarButton.java @@ -47,13 +47,18 @@ public class ToolBarButton extends org.zkoss.zul.Toolbarbutton public void setPressed(boolean pressed) { this.pressed = pressed; // Elaine 2008/12/09 + + if (!getMode().equals("toggle")) + setMode("toggle"); + if (!isDisabled()) { - if (pressed) { - LayoutUtils.addSclass("depressed", this); - } else { - if (this.getSclass() != null && this.getSclass().indexOf("depressed") >= 0) - this.setSclass(this.getSclass().replace("depressed", "")); - } +// if (pressed) { +// LayoutUtils.addSclass("depressed", this); +// } else { +// if (this.getSclass() != null && this.getSclass().indexOf("depressed") >= 0) +// this.setSclass(this.getSclass().replace("depressed", "")); +// } + setChecked(pressed); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index 13099c2540..8c7f4dbc4d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -1288,11 +1288,12 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To } if (canHaveAttachment) { - toolbar.enableAttachment(true); toolbar.getButton("Attachment").setPressed(curTab.hasAttachment()); + toolbar.enableAttachment(true); } else { + toolbar.getButton("Attachment").setPressed(false); toolbar.enableAttachment(false); } diff --git a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp index f306c0c2e8..27db9b64ac 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -109,7 +109,11 @@ html,body { padding: 0px; } -.toolbar-button img { +.z-toolbarbutton-cnt { + padding: 0px; +} + +.toolbar-button .z-toolbarbutton-body .z-toolbarbutton-cnt img { width: 22px; height: 22px; padding: 0px 1px 0px 1px; @@ -118,7 +122,7 @@ html,body { border-color: transparent; } -.embedded-toolbar-button img { +.embedded-toolbar-button .z-toolbarbutton-body .z-toolbarbutton-cnt img { width: 16px; height: 16px; padding: 0px 1px 0px 1px; @@ -128,12 +132,12 @@ html,body { } .depressed img { - border-style: inset; +/* border-style: inset;*/ border-width: 1px; border-color: #9CBDFF; background-color: #C4DCFB; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; +/* -moz-border-radius: 5px; + -webkit-border-radius: 5px;*/ padding: 0px 1px 0px 1px; }