From f2c61f905414e8b6654a4e79529997e854488462 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 3 Sep 2012 12:22:31 +0800 Subject: [PATCH] IDEMPIERE-405 Zk: Replace hardcoded style with css class. Fixed desktop left column not resizable. Use css standard approach for centering of dashboard widget. Fixed confirm panel not using available width on firefox. --- .../webui/desktop/DashboardController.java | 17 +++++++++++++---- .../adempiere/webui/desktop/DefaultDesktop.java | 2 +- .../webui/panel/InfoBPartnerPanel.java | 2 +- .../org/adempiere/webui/panel/InfoPanel.java | 1 + .../adempiere/webui/window/WLocationDialog.java | 1 + .../adempiere/webui/window/WLocatorDialog.java | 1 + .../theme/default/css/theme.css.dsp | 17 ++++++++++++----- 7 files changed, 30 insertions(+), 11 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java index 34d2558747..2492867dbb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java @@ -98,6 +98,7 @@ public class DashboardController implements EventListener { dashboardLayout = new Anchorlayout(); dashboardLayout.setSclass("dashboard-layout"); dashboardLayout.setVflex("1"); + dashboardLayout.setHflex("1"); maximizedHolder = new Anchorchildren(); maximizedHolder.setAnchor("100% 100%"); @@ -136,26 +137,34 @@ public class DashboardController implements EventListener { dps = MDashboardPreference.getForSession(isShowInDashboard, AD_User_ID, AD_Role_ID); // based on user and role noOfCols = MDashboardPreference.getForSessionColumnCount(isShowInDashboard, AD_User_ID, AD_Role_ID); - width = noOfCols <= 0 ? 100 : (100-1) / noOfCols; + width = noOfCols <= 0 ? 100 : 100 / noOfCols; + int useWidth = 0; for (final MDashboardPreference dp : dps) - { + { MDashboardContent dc = new MDashboardContent(dp.getCtx(), dp.getPA_DashboardContent_ID(), dp.get_TrxName()); int columnNo = dp.getColumnNo(); if(dashboardColumnLayout == null || currentColumnNo != columnNo) { + int anchorWidth = width; + if (columnNo == noOfCols) { + anchorWidth = 100 - useWidth; + } else { + useWidth = useWidth + width; + } + dashboardColumnLayout = new Vlayout(); dashboardColumnLayout.setAttribute("ColumnNo", columnNo); dashboardColumnLayout.setAttribute("IsShowInDashboard", isShowInDashboard); dashboardColumnLayout.setAttribute("IsAdditionalColumn", false); Anchorchildren dashboardColumn = new Anchorchildren(); - dashboardColumn.setAnchor((width-2) + "%" + " 100%"); + dashboardColumn.setAnchor(anchorWidth + "%" + " 100%"); dashboardColumn.setDroppable("true"); dashboardColumn.addEventListener(Events.ON_DROP, this); dashboardColumn.appendChild(dashboardColumnLayout); columnList.add(dashboardColumn); dashboardLayout.appendChild(dashboardColumn); - dashboardColumnLayout.setWidth("100%"); + dashboardColumnLayout.setHflex("1"); currentColumnNo = columnNo; } 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 0ebbd4961e..c5ae43cd3d 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 @@ -121,7 +121,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria w.setCollapsible(true); w.setSplittable(true); w.setFlex(false); - w.setHflex("min"); + w.setHflex("1"); w.addEventListener(Events.ON_OPEN, new EventListener() { @Override public void onEvent(Event event) throws Exception { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java index 5e39b0bb40..cd4d98a2a6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java @@ -262,7 +262,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl South south = new South(); layout.appendChild(south); southBody = new Vbox(); - southBody.setWidth("100%"); + southBody.setHflex("1"); south.appendChild(southBody); southBody.appendChild(new Separator()); southBody.appendChild(confirmPanel); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index 81c57b6fa4..5e5162a59b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -292,6 +292,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM confirmPanel = new ConfirmPanel(true, true, false, true, true, true); // Elaine 2008/12/16 confirmPanel.addActionListener(Events.ON_CLICK, this); + confirmPanel.setHflex("1"); // Elaine 2008/12/16 confirmPanel.getButton(ConfirmPanel.A_CUSTOMIZE).setVisible(hasCustomize()); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java index 3fe07fc736..33932ae62e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java @@ -173,6 +173,7 @@ public class WLocationDialog extends Window implements EventListener this.setWidth("380px"); this.setClosable(true); this.setBorder("normal"); + this.setShadow(true); this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java index 0987e7d1f2..142f2b92c3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java @@ -283,6 +283,7 @@ public class WLocatorDialog extends Window implements EventListener this.setClosable(true); this.setBorder("normal"); this.setWidth("260Px"); + this.setShadow(true); this.setSizable(true); // Elaine 2009/02/02 - window set to resizable } 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 32f5edd072..69529d0990 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -269,6 +269,10 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { border-top: 1px solid #c5c5c5; } +.desktop-left-column .z-anchorlayout-body { + overflow-x: hidden; +} + .desktop-hometab { margin-left: 2px !important; } @@ -297,15 +301,17 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { } .dashboard-layout { - width: 99%; - height: 99%; + width: 100%; + height: 100%; position: absolute; } .dashboard-widget { margin-top: 4px; - margin-left: 8px; + margin-left: auto; + margin-right: auto; position: relative; + width: 92%; } .dashboard-report-iframe { @@ -844,12 +850,12 @@ div.simileAjax-bubble-container { } .info-panel .z-center { - text-align: -webkit-center; - text-align: -moz-center; } .info-panel .z-listbox { width: 99% !important; + position: relative; + margin: auto; } .info-panel .z-south { @@ -899,6 +905,7 @@ div.simileAjax-bubble-container { .confirm-panel { width: 100%; height: 36px; + position: relative; } .confirm-panel .z-hbox {