IDEMPIERE-3535 Implement font icon theme / integrate fix from Murilo (muriloht) for the lock button

This commit is contained in:
Carlos Ruiz 2018-01-05 15:20:29 +01:00
parent caf3ca2367
commit 391b57de2a
1 changed files with 18 additions and 9 deletions

View File

@ -587,15 +587,24 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
{
this.btnLock.setPressed(locked);
String size = Env.getContext(Env.getCtx(), "#ZK_Toolbar_Button_Size");
String suffix = "24.png";
if (!Util.isEmpty(size))
{
suffix = size + ".png";
}
String imgURL = "images/"+ (this.btnLock.isPressed() ? "LockX" : "Lock") + suffix;
imgURL = ThemeManager.getThemeResource(imgURL);
this.btnLock.setImage(imgURL);
if (ThemeManager.isUseFontIconForImage())
{
String iconSclass = "z-icon-" + (this.btnLock.isPressed() ? "lock" : "unlock") ;
this.btnLock.setIconSclass(iconSclass);
LayoutUtils.addSclass("font-icon-toolbar-button", this.btnLock);
}
else
{
String size = Env.getContext(Env.getCtx(), "#ZK_Toolbar_Button_Size");
String suffix = "24.png";
if (!Util.isEmpty(size))
{
suffix = size + ".png";
}
String imgURL = "images/"+ (this.btnLock.isPressed() ? "LockX" : "Lock") + suffix;
imgURL = ThemeManager.getThemeResource(imgURL);
this.btnLock.setImage(imgURL);
}
}
public void enablePostIt(boolean enabled)