You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jo...@apache.org on 2020/06/20 20:25:52 UTC
[isis] 01/09: ISIS-2350 RoToolPanel shows object icon
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 27dc5ad79d7ba798c768a1713ab30944c0f95903
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri Jun 12 10:41:20 2020 +0200
ISIS-2350 RoToolPanel shows object icon
---
.../apache/isis/client/kroviz/ui/kv/RoToolPanel.kt | 35 ++++++++++++++++++----
1 file changed, 30 insertions(+), 5 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoToolPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoToolPanel.kt
index ba2b587..a7289ee 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoToolPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoToolPanel.kt
@@ -69,22 +69,47 @@ object RoToolPanel : SimplePanel() {
}
private fun addButton(exp: Exposer) {
- val b = buildButton(exp.iconName, "dynamic sample").onClick {
-
+ var iconName = ""
+ val ed = exp.dynamise()
+ if (ed.hasOwnProperty("iconName") as Boolean) {
+ iconName = ed["iconName"] as String
+ }
+ val b = buildButton(iconName, "dynamic sample")
+ val tObject = exp.delegate
+ val m = MenuFactory.buildFor(
+ tObject,
+ false,
+ ButtonStyle.LINK)
+ console.log("[RoToolPanel.addButton]")
+ console.log(exp)
+ console.log(m)
+ b.apply {
+ onEvent {
+ dblclick = {
+ console.log("dblclick")
+ m.toggle()
+ m.show()
+ }
+ }
}
buttons.add(b)
panel.add(b)
}
private fun buildButton(iconName: String, toolTip: String): Button {
- return Button(
+ val icon =
+ if (iconName.startsWith("fa")) iconName else {
+ IconManager.find(iconName)
+ }
+ val b = Button(
text = "",
- icon = IconManager.find(iconName),
- style = ButtonStyle.LIGHT).apply {
+ icon = icon,
+ style = ButtonStyle.LINK).apply {
padding = CssSize(-16, UNIT.px)
margin = CssSize(0, UNIT.px)
title = toolTip
}
+ return b
}
}