From b2a0016a9cc3ea4de517dad6da601193de97c3d9 Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 18 May 2021 15:41:32 +0200 Subject: [PATCH] fixed action activation --- .../sebserver/gui/content/action/ActionPane.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java index 9b544cf6..0d59014f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java @@ -119,7 +119,7 @@ public class ActionPane implements TemplateComposer { continue; } - de_activate_action_icon(event, parent, actionItem); + de_activate_action_icon(event, parent, actionItem, ad); } if (event.decoration != null) { @@ -131,7 +131,7 @@ public class ActionPane implements TemplateComposer { actionItemToDecorate, event.decoration._2.title); } - de_activate_action_icon(event, parent, actionItemToDecorate); + de_activate_action_icon(event, parent, actionItemToDecorate, event.decoration._1); } }); } @@ -139,12 +139,13 @@ public class ActionPane implements TemplateComposer { private void de_activate_action_icon( final ActionActivationEvent event, final Composite parent, - final TreeItem actionItemToDecorate) { + final TreeItem actionItemToDecorate, + final ActionDefinition actionDef) { final PageAction action = (PageAction) actionItemToDecorate.getData(ACTION_EVENT_CALL_KEY); final Image image = event.activation - ? event.decoration._1.icon.getImage(parent.getDisplay()) - : event.decoration._1.icon.getGreyedImage(parent.getDisplay()); + ? actionDef.icon.getImage(parent.getDisplay()) + : actionDef.icon.getGreyedImage(parent.getDisplay()); actionItemToDecorate.setImage(image); if (event.activation) { actionItemToDecorate.setForeground(null); @@ -153,7 +154,7 @@ public class ActionPane implements TemplateComposer { .setForeground(new Color(parent.getDisplay(), new RGBA(150, 150, 150, 50))); ActionPane.this.pageService.getPolyglotPageService().injectI18n( actionItemToDecorate, - (action != null) ? action.getTitle() : event.decoration._1.title); + (action != null) ? action.getTitle() : actionDef.title); } }