From 3e652da6a61ceda80125829062aad6ad449b859c Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Mon, 19 Mar 2012 17:57:52 +0800 Subject: [PATCH] IDEMPIERE-181 Zk6: Fixed toolbar appearance --- .../adempiere/webui/component/ToolBarButton.java | 14 +++++--------- .../webui/panel/AbstractADWindowPanel.java | 5 ++--- .../theme/default/css/theme.css.dsp | 3 --- 3 files changed, 7 insertions(+), 15 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 1686c0f537..356fb40998 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 @@ -35,7 +35,10 @@ public class ToolBarButton extends org.zkoss.zul.Toolbarbutton public ToolBarButton() {} @Override - public void setDisabled(boolean disabled) { + public void setDisabled(boolean disabled) { + if (disabled && isChecked()) + setChecked(false); // uncheck when button is disabled + super.setDisabled(disabled); if (disabled) { LayoutUtils.addSclass("disableFilter", this); @@ -51,15 +54,8 @@ public class ToolBarButton extends org.zkoss.zul.Toolbarbutton 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 (!isDisabled()) setChecked(pressed); - } } // Elaine 2008/12/09 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 8c7f4dbc4d..47e0288aa9 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,12 +1288,11 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To } if (canHaveAttachment) { - toolbar.getButton("Attachment").setPressed(curTab.hasAttachment()); toolbar.enableAttachment(true); + toolbar.getButton("Attachment").setPressed(curTab.hasAttachment()); } else { - toolbar.getButton("Attachment").setPressed(false); toolbar.enableAttachment(false); } @@ -1505,7 +1504,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To else { curTab.dataIgnore(); - curTab.dataRefresh(false); + curTab.dataRefresh(true); // update statusbar & toolbar curTabpanel.dynamicDisplay(0); toolbar.enableIgnore(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 27db9b64ac..f15e0c224e 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -132,12 +132,9 @@ html,body { } .depressed img { -/* border-style: inset;*/ border-width: 1px; border-color: #9CBDFF; background-color: #C4DCFB; -/* -moz-border-radius: 5px; - -webkit-border-radius: 5px;*/ padding: 0px 1px 0px 1px; }