From 3f13b7472ac597a193529c05b07b44c5aadc565b Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 29 Aug 2013 11:25:31 +0800 Subject: [PATCH] IDEMPIERE-1313 Web Client: Reduce space used by collapsed context help pane. --- .../webui/desktop/DefaultDesktop.java | 21 ++++++++- .../theme/default/css/theme.css.dsp | 43 +++++++++++++++++-- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java index 7389d57016..2b0bde8a07 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java @@ -27,6 +27,7 @@ import org.adempiere.base.event.IEventManager; import org.adempiere.base.event.IEventTopics; import org.adempiere.model.MBroadcastMessage; import org.adempiere.util.ServerContext; +import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.adwindow.ADWindow; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.BusyDialog; @@ -71,6 +72,7 @@ import org.zkoss.zk.au.out.AuScript; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Desktop; import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.HtmlBasedComponent; import org.zkoss.zk.ui.Page; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; @@ -164,7 +166,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria @Override public void onEvent(Event event) throws Exception { OpenEvent oe = (OpenEvent) event; - updateMenuCollapsedPreference(!oe.isOpen()); + updateMenuCollapsedPreference(!oe.isOpen()); } }); w.addEventListener(Events.ON_SWIPE, new EventListener() { @@ -192,6 +194,14 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria public void onEvent(Event event) throws Exception { OpenEvent oe = (OpenEvent) event; updateHelpCollapsedPreference(!oe.isOpen()); + HtmlBasedComponent comp = windowContainer.getComponent(); + if (comp != null) { + if (oe.isOpen()) { + LayoutUtils.removeSclass("with-right-icon", comp); + } else { + LayoutUtils.addSclass("with-right-icon", comp); + } + } } }); @@ -210,7 +220,10 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria }); boolean helpCollapsed= pref.isPropertyBool(UserPreference.P_HELP_COLLAPSED); - e.setOpen(!helpCollapsed); + e.setOpen(!helpCollapsed); + Clients.evalJavaScript("$('.desktop-layout > div > .z-east-colpsd > .z-borderlayout-icon').attr('title', '" + + Msg.getElement(Env.getCtx(), "AD_CtxHelp_ID") + "');"); + helpController.render(e, this); @@ -267,6 +280,10 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria max.setSclass("window-container-toolbar-btn"); max.setStyle("cursor: pointer; border: 1px solid transparent; padding: 2px;"); + if (!e.isOpen()) { + LayoutUtils.addSclass("with-right-icon", windowContainer.getComponent()); + } + return layout; } 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 62f8aaa861..265169e913 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -496,6 +496,10 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { margin: 0px !important; } +.desktop-tabbox.with-right-icon .z-tabs .z-toolbar-tabs-body { + margin-right: 12px !important; +} + .desktop-tabbox .z-tabs .z-toolbar-tabs-body .z-toolbarbutton { padding: 0px !important; border: 1px solid transparent !important; @@ -1504,8 +1508,8 @@ i.grid-combobox-editor { .z-west-splt-btn-over, .z-north-splt-btn-over, .z-south-splt-btn-over { - -webkit-filter: brightness(-30%); - filter: brightness(-30%); + -webkit-filter: brightness(50%); + filter: brightness(50%); } .help-content @@ -1910,4 +1914,37 @@ table.z-vbox > tbody > tr > td > table { .payment-rule-editor .editor-button :hover { border-radius: 0px; background-color: #ddd; -} \ No newline at end of file +} + +<%-- Context Help --%> +.desktop-layout > div > .z-east-colpsd { + border: none; + width: 0px !important; + position: absolute; + overflow: visible; + padding: 0px !important; + margin: 0px !important; +} + +.desktop-layout > div > .z-east-colpsd > .z-borderlayout-icon { + background-image: url(${c:encodeURL('/theme/default/images/Help16.png')}) !important; + background-position:center !important; + width: 16px; + height: 16px; + position: relative; + left: -20px; + background-size: 16px 16px; + margin-left: 0px !important; + margin-right: 0px !important; + margin-top: 4px !important; + padding: 3px !important; +} + +.desktop-layout > div > .z-east-colpsd > .z-borderlayout-icon:hover { + background-color:#DDD !important; + -webkit-box-shadow:inset 0px 0px 3px #CCC; + -moz-box-shadow:inset 0px 0px 3px #CCC; + -o-box-shadow:inset 0px 0px 3px #CCC; + -ms-box-shadow:inset 0px 0px 3px #CCC; + box-shadow:inset 0px 0px 3px #CCC; +}