IDEMPIERE-4973 : Render Quick info only when help panel (Right side P… (#1243)
* IDEMPIERE-4973 : Render Quick info only when help panel (Right side Panel) open * IDEMPIERE-4973: Fixing issue pointed by hengsin
This commit is contained in:
parent
24836a7c6c
commit
38fd810122
|
@ -175,6 +175,12 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
|
|
||||||
private ToolBarButton westBtn;
|
private ToolBarButton westBtn;
|
||||||
|
|
||||||
|
// For quick info optimization
|
||||||
|
private GridTab gridTab;
|
||||||
|
|
||||||
|
// Right side Quick info is visible
|
||||||
|
private boolean isQuickInfoOpen = true;
|
||||||
|
|
||||||
public DefaultDesktop()
|
public DefaultDesktop()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
@ -259,6 +265,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(Event event) throws Exception {
|
public void onEvent(Event event) throws Exception {
|
||||||
OpenEvent oe = (OpenEvent) event;
|
OpenEvent oe = (OpenEvent) event;
|
||||||
|
isQuickInfoOpen = oe.isOpen();
|
||||||
updateHelpCollapsedPreference(!oe.isOpen());
|
updateHelpCollapsedPreference(!oe.isOpen());
|
||||||
HtmlBasedComponent comp = windowContainer.getComponent();
|
HtmlBasedComponent comp = windowContainer.getComponent();
|
||||||
if (comp != null) {
|
if (comp != null) {
|
||||||
|
@ -331,7 +338,10 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
eastPopup = new Popup();
|
eastPopup = new Popup();
|
||||||
ToolBarButton btn = new ToolBarButton();
|
ToolBarButton btn = new ToolBarButton();
|
||||||
btn.setIconSclass("z-icon-remove");
|
btn.setIconSclass("z-icon-remove");
|
||||||
btn.addEventListener(Events.ON_CLICK, evt -> eastPopup.close());
|
btn.addEventListener(Events.ON_CLICK, evt -> {
|
||||||
|
eastPopup.close();
|
||||||
|
isQuickInfoOpen = false;
|
||||||
|
});
|
||||||
eastPopup.appendChild(btn);
|
eastPopup.appendChild(btn);
|
||||||
btn.setStyle("position: absolute; top: 20px; right: 0px; padding: 2px 0px;");
|
btn.setStyle("position: absolute; top: 20px; right: 0px; padding: 2px 0px;");
|
||||||
eastPopup.setStyle("padding-top: 20px;");
|
eastPopup.setStyle("padding-top: 20px;");
|
||||||
|
@ -339,6 +349,9 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
eastPopup.setPage(getComponent().getPage());
|
eastPopup.setPage(getComponent().getPage());
|
||||||
eastPopup.setHeight("100%");
|
eastPopup.setHeight("100%");
|
||||||
helpController.setupFieldTooltip();
|
helpController.setupFieldTooltip();
|
||||||
|
eastPopup.addEventListener(Events.ON_OPEN, (OpenEvent oe) -> {
|
||||||
|
isQuickInfoOpen = oe.isOpen();
|
||||||
|
});
|
||||||
|
|
||||||
westPopup = new Popup();
|
westPopup = new Popup();
|
||||||
westPopup.setStyle("padding-top: 10px;");
|
westPopup.setStyle("padding-top: 10px;");
|
||||||
|
@ -424,6 +437,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
contextHelp.setSclass("window-container-toolbar-btn context-help-btn");
|
contextHelp.setSclass("window-container-toolbar-btn context-help-btn");
|
||||||
contextHelp.setTooltiptext(Util.cleanAmp(Msg.getElement(Env.getCtx(), "AD_CtxHelp_ID")));
|
contextHelp.setTooltiptext(Util.cleanAmp(Msg.getElement(Env.getCtx(), "AD_CtxHelp_ID")));
|
||||||
contextHelp.setVisible(!e.isVisible());
|
contextHelp.setVisible(!e.isVisible());
|
||||||
|
isQuickInfoOpen = e.isVisible();
|
||||||
|
|
||||||
if (!mobile) {
|
if (!mobile) {
|
||||||
boolean headerCollapsed= pref.isPropertyBool(UserPreference.P_HEADER_COLLAPSED);
|
boolean headerCollapsed= pref.isPropertyBool(UserPreference.P_HEADER_COLLAPSED);
|
||||||
|
@ -654,6 +668,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
if (mobile && eastPopup != null)
|
if (mobile && eastPopup != null)
|
||||||
{
|
{
|
||||||
eastPopup.open(layout.getCenter(), "overlap_end");
|
eastPopup.open(layout.getCenter(), "overlap_end");
|
||||||
|
isQuickInfoOpen = true;
|
||||||
|
updateHelpQuickInfo(gridTab);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -662,6 +678,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
LayoutUtils.removeSclass("slide", layout.getEast());
|
LayoutUtils.removeSclass("slide", layout.getEast());
|
||||||
contextHelp.setVisible(false);
|
contextHelp.setVisible(false);
|
||||||
updateHelpCollapsedPreference(false);
|
updateHelpCollapsedPreference(false);
|
||||||
|
isQuickInfoOpen = true;
|
||||||
|
updateHelpQuickInfo(gridTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (comp == westBtn)
|
else if (comp == westBtn)
|
||||||
|
@ -971,7 +989,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
Component window = getActiveWindow();
|
Component window = getActiveWindow();
|
||||||
ADWindow adwindow = ADWindow.findADWindow(window);
|
ADWindow adwindow = ADWindow.findADWindow(window);
|
||||||
if (adwindow != null) {
|
if (adwindow != null) {
|
||||||
gridTab = adwindow.getADWindowContent().getActiveGridTab();
|
gridTab = adwindow.getADWindowContent().getActiveGridTab();
|
||||||
}
|
}
|
||||||
updateHelpQuickInfo(gridTab);
|
updateHelpQuickInfo(gridTab);
|
||||||
}
|
}
|
||||||
|
@ -988,7 +1006,9 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateHelpQuickInfo(GridTab gridTab) {
|
public void updateHelpQuickInfo(GridTab gridTab) {
|
||||||
helpController.renderQuickInfo(gridTab);
|
this.gridTab = gridTab;
|
||||||
|
if (isQuickInfoOpen)
|
||||||
|
helpController.renderQuickInfo(gridTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue