From 90b35e5bc7f08cbcfbae0f0cce4650f66f36f7ae Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 24 Jun 2013 15:32:40 +0800 Subject: [PATCH] IDEMPIERE-1100 BP field split in two lines. --- .../adempiere/webui/component/EditorBox.java | 12 ++-- .../adempiere/webui/component/NumberBox.java | 16 ++++- .../webui/editor/WTableDirEditor.java | 1 + .../theme/default/css/theme.css.dsp | 64 +++++++++++-------- 4 files changed, 58 insertions(+), 35 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/EditorBox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/EditorBox.java index 79456ed4d4..01c5c9a5f3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/EditorBox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/EditorBox.java @@ -32,7 +32,6 @@ public class EditorBox extends Div { this); protected Textbox txt; protected Button btn; -// private Hlayout hlayout; public EditorBox() { initComponents(); @@ -54,9 +53,9 @@ public class EditorBox extends Div { } private void initComponents() { -// hlayout = new Hlayout(); -// hlayout.setHflex("1"); txt = new Textbox(); + txt.setSclass("editor-input"); + txt.setHflex("0"); appendChild(txt); btn = new Button(); btn.setTabindex(-1); @@ -103,6 +102,11 @@ public class EditorBox extends Div { if (btn.getParent() != null) btn.detach(); } + if (enabled) { + LayoutUtils.removeSclass("editor-input-disd", txt); + } else { + LayoutUtils.addSclass("editor-input-disd", txt); + } } /** @@ -147,12 +151,10 @@ public class EditorBox extends Div { public void setTableEditorMode(boolean flag) { if (flag) { - txt.setHflex("0"); setHflex("0"); LayoutUtils.addSclass("grid-editor-input", txt); LayoutUtils.addSclass("grid-editor-button", btn); } else { - txt.setHflex("1"); setHflex("1"); LayoutUtils.removeSclass("grid-editor-input", txt); LayoutUtils.removeSclass("grid-editor-button", btn); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java index 1a28e2308c..72455afab2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java @@ -82,7 +82,8 @@ public class NumberBox extends Div if (integral) decimalBox.setScale(0); decimalBox.setStyle("display: inline-block;text-align:right"); - decimalBox.setHflex("1"); + decimalBox.setHflex("0"); + decimalBox.setSclass("editor-input"); appendChild(decimalBox); btn = new Button(); @@ -385,11 +386,22 @@ public class NumberBox extends Div decimalBox.setReadonly(!enabled); btn.setEnabled(enabled); if (enabled) + { + if (btn.getParent() != decimalBox.getParent()) + btn.setParent(decimalBox.getParent()); btn.setPopup(popup); + } else { Popup p = null; btn.setPopup(p); + if (btn.getParent() != null) + btn.detach(); + } + if (enabled) { + LayoutUtils.removeSclass("editor-input-disd", decimalBox); + } else { + LayoutUtils.addSclass("editor-input-disd", decimalBox); } } @@ -437,12 +449,10 @@ public class NumberBox extends Div public void setTableEditorMode(boolean flag) { if (flag) { - decimalBox.setHflex("0"); setHflex("0"); LayoutUtils.addSclass("grid-editor-input", decimalBox); LayoutUtils.addSclass("grid-editor-button", btn); } else { - decimalBox.setHflex("1"); setHflex("1"); LayoutUtils.removeSclass("grid-editor-input", decimalBox); LayoutUtils.removeSclass("grid-editor-button", btn); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java index f9cc4659b6..e173bd9f59 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java @@ -319,6 +319,7 @@ ContextMenuListener, IZoomableEditor @Override public void setReadWrite(boolean readWrite) { getComponent().setEnabled(readWrite); + getComponent().setButtonVisible(readWrite); } private void refreshList() 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 08dbf2358d..6e66d362dd 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -988,18 +988,25 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer { padding: 0px; margin: 0px; background-color: transparent; + position: relative; } -.editor-box .z-textbox { - display: inline-block; - border-right-color: transparent; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; +.editor-input { + box-sizing: border-box; + -moz-box-sizing: border-box; /* Firefox */ + display: inline-block; + padding-right: 22px; + width: 100%; + height: 21px; } -.editor-box .z-textbox:focus { +.editor-input:focus { border: 1px solid #0000ff; } + +.editor-input-disd { + padding-right: 0px !important; +} .editor-button { padding: 0px; @@ -1008,11 +1015,11 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer { background-color: transparent; background-image: none; width: 19px; - height: 20px; - border: 1px solid #e6e6e6; - border-top-color: #b2b2b2; - border-left-width: 0px; - border-radius: 0 2px 2px 0; + height: 18px; + border: none; + position: absolute; + right: 2px; + top: 1px; } .editor-button :hover { @@ -1024,12 +1031,11 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer { text-align: left; width: 16px; height: 16px; - padding: 2px 1px; + padding: 1px 1px; } .editor-box .grid-editor-input.z-textbox { - width: 90%; } .grid-editor-button { @@ -1043,19 +1049,7 @@ span.z-tree-tee, span.z-tree-last, span.z-tree-firstspacer { white-space:nowrap; } -.number-box .z-decimalbox { - display: inline-block; - border-right-color: transparent; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; -} - .number-box .grid-editor-input.z-decimalbox { - width: 80%; -} - -.number-box .z-decimalbox:focus { - border: 1px solid #0000ff; } .datetime-box { @@ -1325,11 +1319,27 @@ tbody.z-grid-empty-body td { } i.grid-combobox-editor { - width: 96% !important; + width: 99% !important; + position: relative; } .grid-combobox-editor input { - width: 85% !important; + width: 100% !important; + padding-right: 22px; + box-sizing: border-box; + -moz-box-sizing: border-box; /* Firefox */ + height: 21px; +} + +.grid-combobox-editor .z-combobox-btn { + position: absolute; + right: 0px; + top: 0px; + border-radius: 0px 0px; +} + +.grid-combobox-editor.z-combobox-focus .z-combobox-btn { + border-left: 1px solid #0000ff; } .embedded-dialog {