IDEMPIERE-724 Zk: Make iDempiere theme more easily customizable. Some style tweaks. Added maximized button for tab container.

This commit is contained in:
Heng Sin Low 2013-05-16 12:00:40 +08:00
parent ac70fdec1e
commit a87e9773b5
5 changed files with 45 additions and 45 deletions

View File

@ -145,7 +145,6 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btnIgnore = createButton("Ignore", "Ignore", "Ignore");
btnIgnore.setTooltiptext(btnIgnore.getTooltiptext()+ " Alt+Z");
addSeparator();
btnHelp = createButton("Help", "Help","Help");
btnHelp.setTooltiptext(btnHelp.getTooltiptext()+ " Alt+H");
btnNew = createButton("New", "New", "New");
@ -159,7 +158,6 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btnSave.setTooltiptext(btnSave.getTooltiptext()+ " Alt+S");
btnSaveAndCreate = createButton("SaveCreate", "SaveCreate", "SaveCreate");
btnSaveAndCreate.setTooltiptext(btnSaveAndCreate.getTooltiptext()+ " Alt+A");
addSeparator();
btnRefresh = createButton("Refresh", "Refresh", "Refresh");
btnRefresh.setTooltiptext(btnRefresh.getTooltiptext()+ " Alt+E");
btnFind = createButton("Find", "Find", "Find");
@ -168,18 +166,15 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btnChat = createButton("Chat", "Chat", "Chat");
btnGridToggle = createButton("Toggle", "Multi", "Multi");
btnGridToggle.setTooltiptext(btnGridToggle.getTooltiptext()+ " Alt+T");
addSeparator();
btnParentRecord = createButton("ParentRecord", "Parent", "Parent");
btnParentRecord.setTooltiptext(btnParentRecord.getTooltiptext()+ " Alt+Up");
btnDetailRecord = createButton("DetailRecord", "Detail", "Detail");
btnDetailRecord.setTooltiptext(btnDetailRecord.getTooltiptext()+ " Alt+Down");
addSeparator();
btnReport = createButton("Report", "Report", "Report");
btnReport.setTooltiptext(btnReport.getTooltiptext()+ " Alt+R");
btnArchive = createButton("Archive", "Archive", "Archive");
btnPrint = createButton("Print", "Print", "Print");
btnPrint.setTooltiptext(btnPrint.getTooltiptext()+ " Alt+P");
addSeparator();
btnLock = createButton("Lock", "Lock", "Lock"); // Elaine 2008/12/04
btnLock.setVisible(isPersonalLock);
btnZoomAcross = createButton("ZoomAcross", "ZoomAcross", "ZoomAcross");
@ -188,7 +183,6 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btnProductInfo = createButton("ProductInfo", "Product", "InfoProduct");
btnProductInfo.setVisible(isAllowProductInfo);
addSeparator();
btnCustomize= createButton("Customize", "Customize", "Customize");
btnCustomize.setDisabled(false);

View File

@ -32,10 +32,8 @@ import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.sys.ExecutionCtrl;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Caption;
import org.zkoss.zul.Div;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image;
import org.zkoss.zul.Space;
import org.zkoss.zul.Tabpanels;
import org.zkoss.zul.Tabs;
@ -65,10 +63,6 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
*/
private static final long serialVersionUID = -7914602940626352282L;
private static final String INFO_INDICATOR_IMAGE = "images/InfoIndicator16.png";
private static final String ERROR_INDICATOR_IMAGE = "images/ErrorIndicator16.png";
private Tabbox tabbox;
private EventListener<Event> eventListener;
@ -78,8 +72,6 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
private Div msgPopupCnt;
private Window msgPopup;
private Caption msgPopupCaption;
private int prevSelectedIndex = 0;
@ -413,18 +405,11 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
messageContainer.getChildren().clear();
messageContainer.setAttribute(STATUS_ERROR_ATTRIBUTE, error);
messageContainer.setAttribute(STATUS_TEXT_ATTRIBUTE, status);
messageContainer.setSclass(error ? "docstatus-error" : "docstatus-normal");
if (status == null || status.trim().length() == 0)
return;
Image image = null;
if (error)
image = new Image(ThemeManager.getThemeResource(ERROR_INDICATOR_IMAGE));
else
image = new Image(ThemeManager.getThemeResource(INFO_INDICATOR_IMAGE));
image.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE);
messageContainer.appendChild(image);
String labelText = buildLabelText(status);
if (error) {
Clients.showNotification(buildNotificationText(status), "error", findTabpanel(this), "top_left", 3500, true);
@ -432,8 +417,6 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
Label label = new Label(labelText);
messageContainer.appendChild(label);
if (labelText.length() != status.length()) {
image.addEventListener(Events.ON_CLICK, this);
image.setStyle("cursor: pointer");
label.addEventListener(Events.ON_CLICK, this);
label.setStyle("cursor: pointer");
@ -501,7 +484,6 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
}
private void showPopup(boolean error, Component messageContainer) {
msgPopupCaption.setImage(error ? ERROR_INDICATOR_IMAGE : INFO_INDICATOR_IMAGE);
LayoutUtils.openOverlappedWindow(messageContainer, msgPopup, "overlap_end");
}
@ -520,8 +502,6 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
msgPopup.appendChild(msgPopupCnt);
msgPopup.setPage(SessionManager.getAppDesktop().getComponent().getPage());
msgPopup.setShadow(true);
msgPopupCaption = new Caption();
msgPopup.appendChild(msgPopupCaption);
}
@Override

View File

@ -159,16 +159,6 @@ public class StatusBar extends Panel implements EventListener<Event>
if (text == null || text.trim().length() == 0 )
return;
/*
Image image = null;
if (error)
image = new Image(ThemeManager.getThemeResource(ERROR_INDICATOR_IMAGE));
else
image = new Image(ThemeManager.getThemeResource(INFO_INDICATOR_IMAGE));
image.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE);
*/
// messageContainer.appendChild(image);
String labelText = buildLabelText(m_statusText);
if (error) {
Clients.showNotification(buildNotificationText(m_statusText), "error", findTabpanel(this), "top_left", 3500, true);

View File

@ -32,6 +32,7 @@ import org.adempiere.webui.apps.ProcessDialog;
import org.adempiere.webui.apps.WReport;
import org.adempiere.webui.component.Tab;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.component.ToolBar;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.event.DrillEvent;
import org.adempiere.webui.event.MenuListener;
@ -95,6 +96,10 @@ import org.zkoss.zul.West;
*/
public class DefaultDesktop extends TabbedDesktop implements MenuListener, Serializable, EventListener<Event>, EventHandler, DesktopCleanup
{
private static final String IMAGES_UPARROW_PNG = "images/uparrow.png";
private static final String IMAGES_DOWNARROW_PNG = "images/downarrow.png";
/**
* generated serial version ID
*/
@ -128,6 +133,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
private HelpController helpController;
private ToolBarButton max;
public DefaultDesktop()
{
super();
@ -254,6 +261,13 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
Adempiere.getThreadPoolExecutor().submit(runnable);
ToolBar toolbar = new ToolBar();
windowContainer.getComponent().appendChild(toolbar);
max = new ToolBarButton();
toolbar.appendChild(max);
max.setImage(ThemeManager.getThemeResource(IMAGES_UPARROW_PNG));
max.addEventListener(Events.ON_CLICK, this);
return layout;
}
@ -288,7 +302,20 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
if(eventName.equals(Events.ON_CLICK))
{
if(comp instanceof ToolBarButton)
if (comp == max)
{
if (layout.getNorth().isVisible())
{
layout.getNorth().setVisible(false);
max.setImage(ThemeManager.getThemeResource(IMAGES_DOWNARROW_PNG));
}
else
{
layout.getNorth().setVisible(true);
max.setImage(ThemeManager.getThemeResource(IMAGES_UPARROW_PNG));
}
}
else if(comp instanceof ToolBarButton)
{
ToolBarButton btn = (ToolBarButton) comp;

View File

@ -457,6 +457,10 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
margin-left: 4px !important;
}
.desktop-tabbox .z-toolbar-tabs-body {
padding-top: 10px !important;
}
.desktop-menu-popup {
z-index: 9999;
background-color: #fff;
@ -502,7 +506,9 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
}
.z-panel {
border: 1px solid #c5c5c5;
border-radius: 3px;
border: 1px solid #d8d8d8;
border-bottom-width: 2px;
}
.z-panel-noborder {
@ -514,13 +520,15 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
}
.z-panel-hl {
padding-bottom: 1px;
border-bottom: 1px solid #008BB6;
padding-bottom: 4px;
border-bottom: none;
}
.z-panel-hl .z-panel-header {
padding: 0 0 2px 0;
color: #333; font-weight: bold;
color: #262626;
font-weight: 300;
font-size: 13px;
}
.desktop-home-tabpanel .z-panel-tl, .desktop-home-tabpanel .z-panel-tr,
@ -551,7 +559,7 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
margin-left: auto;
margin-right: auto;
position: relative;
width: 92%;
width: 92%;
}
.dashboard-report-iframe {
@ -666,11 +674,11 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
padding-right: 4px;
}
.adwindow-status-docinfo .z-label, .adwindow-status-docstatus .z-label {
.docstatus-normal .z-label {
color: #6a6a6a;
}
.adwindow-status-docstatus .docstatus-error .z-label {
.docstatus-error .z-label {
color: red;
}
@ -682,6 +690,7 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
.adwindow-toolbar {
border: 0px;
padding: 2px 4px;
height: 26px;
background-image: none;
background-color: #fff;